dae.variants_loaders.dae package

Submodules

dae.variants_loaders.dae.loader module

class dae.variants_loaders.dae.loader.DaeTransmittedFamiliesGenotypes(families: FamiliesData, family_data: dict[str, tuple[numpy.ndarray, numpy.ndarray]])[source]

Bases: FamiliesGenotypes

Tuple of families and family data

family_genotype_iterator() Generator[tuple[dae.pedigrees.family.Family, numpy.ndarray, Optional[numpy.ndarray]], None, None][source]
get_family_read_counts(family: Family) ndarray | None[source]
class dae.variants_loaders.dae.loader.DaeTransmittedLoader(families: FamiliesData, summary_filename: str, genome: ReferenceGenome, regions: None = None, params: dict[str, Any] | None = None, **_kwargs: Any)[source]

Bases: VariantsGenotypesLoader

Loader for dae variants.

property chromosomes: list[str]

Return list of all chromosomes.

close() None[source]

Close resources used by the loader.

classmethod parse_cli_arguments(argv: Namespace, use_defaults: bool = False) tuple[list[str], dict[str, Any]][source]

Parse cli arguments.

property variants_filenames: list[str]
class dae.variants_loaders.dae.loader.DenovoFamiliesGenotypes(family: Family, gt: ndarray, best_state: ndarray | None = None)[source]

Bases: FamiliesGenotypes

Tuple of family, genotype, and best_state

family_genotype_iterator() Generator[tuple[dae.pedigrees.family.Family, numpy.ndarray, Optional[numpy.ndarray]], None, None][source]
class dae.variants_loaders.dae.loader.DenovoLoader(families: FamiliesData, denovo_filename: str, genome: ReferenceGenome, regions: list[str] | None = None, params: dict[str, Any] | None = None, sort: bool = True)[source]

Bases: VariantsGenotypesLoader

Load denovo variants.

property chromosomes: list[str]

Return list of all chromosomes.

close() None[source]

Close resources used by the loader.

flexible_denovo_load(filepath: str, genome: ReferenceGenome, families: FamiliesData, denovo_location: str | None = None, denovo_variant: str | None = None, denovo_chrom: str | None = None, denovo_pos: str | None = None, denovo_ref: str | None = None, denovo_alt: str | None = None, denovo_person_id: str | None = None, denovo_family_id: str | None = None, denovo_best_state: str | None = None, denovo_genotype: str | None = None, denovo_sep: str = '\t', **kwargs: Any) DataFrame[source]

Load de Novo variants from a file.

Read a text file containing variants in the form of delimiter-separted values and produce a dataframe.

The text file may use different names for the columns containing the relevant data - these are specified with the provided parameters.

Parameters:
  • filepath (str) – The path to the DSV file to read.

  • genome – A reference genome object.

  • denovo_location (str) – The label or index of the column containing

the CSHL-style location of the variant.

Parameters:

denovo_variant (str) – The label or index of the column containing

the CSHL-style representation of the variant.

Parameters:

denovo_chrom (str) – The label or index of the column containing

the chromosome upon which the variant is located.

Parameters:

denovo_pos (str) – The label or index of the column containing the

position upon which the variant is located.

Parameters:

denovo_ref (str) – The label or index of the column containing the

variant’s reference allele.

Parameters:

denovo_alt (str) – The label or index of the column containing the

variant’s alternative allele.

Parameters:

denovo_person_id (str) – The label or index of the column

containing either a singular person ID or a comma-separated list of person IDs.

Parameters:

denovo_family_id (str) – The label or index of the column

containing a singular family ID.

Parameters:

denovo_best_state (str) – The label or index of the column

containing the best state for the variant.

Parameters:

families (str) – An instance of the FamiliesData class for the

pedigree of the relevant study.

Returns:

Dataframe containing the variants, with the following

header - ‘chrom’, ‘position’, ‘reference’, ‘alternative’, ‘family_id’, ‘genotype’.

Return type:

An instance of Pandas’ DataFrame class.

full_variants_iterator() Generator[tuple[dae.variants.variant.SummaryVariant, list[dae.variants.family_variant.FamilyVariant]], None, None][source]
classmethod parse_cli_arguments(argv: Namespace, use_defaults: bool = False) tuple[list[str], dict[str, Any]][source]

Parse cli arguments.

static produce_genotype(chrom: str, pos: int, genome: ReferenceGenome, family: Family, members_with_variant: list[str]) ndarray[source]

Produce genotype.

reset_regions(regions: str | list[str] | None) None[source]
static split_location(location: str) tuple[str, int][source]

Module contents