dae.variants_loaders.cnv package


dae.variants_loaders.cnv.flexible_cnv_loader module

dae.variants_loaders.cnv.flexible_cnv_loader.flexible_cnv_loader(filepath_or_buffer: str | Path | TextIO, families: FamiliesData, genome: ReferenceGenome, cnv_chrom: str | None = None, cnv_start: str | None = None, cnv_end: str | None = None, cnv_location: str | None = None, cnv_person_id: str | None = None, cnv_family_id: str | None = None, cnv_best_state: str | None = None, cnv_variant_type: str | None = None, cnv_plus_values: list[str] | None = None, cnv_minus_values: list[str] | None = None, cnv_sep: str = '\t', **_kwargs: Any) Generator[dict[str, Any], None, None][source]

Load variants from CNVs input and transform them into DataFrames.

This function uses flexible variant loader infrastructure to load variants from a CNVs data input and transform them into a pandas DataFrame.

dae.variants_loaders.cnv.loader module

Defines CNV loader class and helpers.

Copy Number Variants (CNV) loader CNVLoader

This modules provides a class CNVLoader to facilitate loading CNVs specified in various input formats.

There are three groups of input parameters that could be configured by the CNVLoader parameters:

  • location of the variant - VCF-like vs CSHL-like of the variant position;

  • variant genotype - list of person_ids vs CSHL-like family/best state description of the genotype for given family

  • variant type - flexible CNV+/CNV- variant type description.

To configure the CNVLoader you need to pass params dictionary to the constructor of the class.

Parameters that are used to configure input data colums are:

Location of the CNVs

  • cnv_location - column name, that is interpreted as variant location

  • cnv_chrom - column name, interpreted as the chromosome

  • cnv_start - column name, interpreted as the start position of the CNVs

  • cnv_end - column name, interpreted as the end position of the CNVs

Genotype of the CNVs

  • cnv_family_id - column name, specifying the family for the CNVs

  • cnv_best_state - column name, specifying the best state fore the CNVs

  • cnv_person_id - column name, specifying a person, that has given CNV

Variant type for CNVs

  • cnv_variant_type - column name, specifying the CNV variant type

  • cnv_plus_values - list of the values in column cnv_variant_type that are interpreted as CNV+

  • cnv_minus_values - list of values in column cnv_variant_type that are interpreted as CNV-

Additional parameters

Additional parameters, that configure the behavior of the CNVLoader are:

  • cnv_sep - separator character, that split columns in the lines of the input file

  • cnv_transmission_type - the CNV loader is used mostly for importing de Novo variants. In rare cases when we use this loader to import transmitted CNV variants we should pass this parameter to specify that the varirants are not denovo.

class dae.variants_loaders.cnv.loader.CNVLoader(families: FamiliesData, cnv_filenames: list[Union[str, pathlib.Path, TextIO]], genome: ReferenceGenome, regions: list[str] | None = None, params: Dict[str, Any] | None = None)[source]

Bases: VariantsGenotypesLoader

Defines CNV loader class.

property chromosomes: list[str]

Return list of all chromosomes.

close() None[source]

Close resources used by the loader.

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.

reset_regions(regions: str | list[str] | None) None[source]

Module contents