dae.effect_annotation package
Subpackages
- dae.effect_annotation.effect_checkers package
- Submodules
- dae.effect_annotation.effect_checkers.coding module
- dae.effect_annotation.effect_checkers.effect_checker module
- dae.effect_annotation.effect_checkers.frame_shift module
- dae.effect_annotation.effect_checkers.intron module
- dae.effect_annotation.effect_checkers.promoter module
- dae.effect_annotation.effect_checkers.protein_change module
- dae.effect_annotation.effect_checkers.splice_site module
- dae.effect_annotation.effect_checkers.start_loss module
- dae.effect_annotation.effect_checkers.stop_loss module
- dae.effect_annotation.effect_checkers.utr module
- Module contents
- dae.effect_annotation.tests package
- Submodules
- dae.effect_annotation.tests.conftest module
- dae.effect_annotation.tests.mocks module
- dae.effect_annotation.tests.test_annotation_request module
- dae.effect_annotation.tests.test_coding_tests module
- dae.effect_annotation.tests.test_effect_mixin module
- dae.effect_annotation.tests.test_effect_serialization module
- dae.effect_annotation.tests.test_frame_shift_tests module
- dae.effect_annotation.tests.test_genomic_sequence_tests module
- dae.effect_annotation.tests.test_intron_tests module
- dae.effect_annotation.tests.test_original_variant_annotation_fixed_tests module
- dae.effect_annotation.tests.test_protein_change_tests module
- dae.effect_annotation.tests.test_splice_site_tests module
- dae.effect_annotation.tests.test_start_loss_tests module
- dae.effect_annotation.tests.test_stop_loss_tests module
- dae.effect_annotation.tests.test_utr_tests module
- Module contents
Submodules
dae.effect_annotation.annotation_effects module
dae.effect_annotation.annotation_request module
- class dae.effect_annotation.annotation_request.BaseAnnotationRequest(reference_genome: ReferenceGenome, code: NuclearCode, promoter_len: int, variant: Variant, transcript_model: TranscriptModel)[source]
Bases:
ABC
Effect annotation request description.
- get_coding_left(pos: int, length: int, index: int) str [source]
Return coding sequence to the left of a position.
- get_coding_right(pos: int, length: int, index: int) str [source]
Construct conding sequence to the right of a position.
- class dae.effect_annotation.annotation_request.NegativeStrandAnnotationRequest(reference_genome: ReferenceGenome, code: NuclearCode, promoter_len: int, variant: Variant, transcript_model: TranscriptModel)[source]
Bases:
BaseAnnotationRequest
Effect annotation request on the negative strand.
- class dae.effect_annotation.annotation_request.PositiveStrandAnnotationRequest(reference_genome: ReferenceGenome, code: NuclearCode, promoter_len: int, variant: Variant, transcript_model: TranscriptModel)[source]
Bases:
BaseAnnotationRequest
Effect annotation request on the positive strand.
dae.effect_annotation.annotator module
- class dae.effect_annotation.annotator.AnnotationRequestFactory[source]
Bases:
object
Factory for annotation requests.
- static create_annotation_request(annotator: EffectAnnotator, variant: Variant, transcript_model: TranscriptModel) PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest [source]
Create an annotation request.
- class dae.effect_annotation.annotator.EffectAnnotator(reference_genome: ~dae.genomic_resources.reference_genome.ReferenceGenome, gene_models: ~dae.genomic_resources.gene_models.gene_models.GeneModels, code: ~dae.effect_annotation.gene_codes.NuclearCode = <dae.effect_annotation.gene_codes.NuclearCode object>, promoter_len: int = 0)[source]
Bases:
object
Predicts variant effect.
- annotate(variant: Variant) list[AnnotationEffect] [source]
Annotate effects for a variant.
- annotate_allele(chrom: str, pos: int, ref: str, alt: str, length: int | None = None, seq: str | None = None, variant_type: str | None = None) list[AnnotationEffect] [source]
Annotate effects for a variant.
- annotate_cnv(chrom: str, pos_start: int, pos_end: int, variant_type: Type) list[AnnotationEffect] [source]
Annotate a CNV variant.
- annotate_region(chrom: str, pos_start: int, pos_end: int, effect_type: str = 'unknown') list[AnnotationEffect] [source]
Annotate a region or position.
- static annotate_variant(gm: GeneModels, reference_genome: ReferenceGenome, chrom: str | None = None, position: int | None = None, location: str | None = None, variant: str | None = None, ref: str | None = None, alt: str | None = None, length: int | None = None, seq: str | None = None, variant_type: Type | None = None, promoter_len: int = 0) list[AnnotationEffect] [source]
Build effect annotator and annotate a variant.
- do_annotate_variant(chrom: str | None = None, pos: int | None = None, location: str | None = None, variant: str | None = None, ref: str | None = None, alt: str | None = None, length: int | None = None, seq: str | None = None, variant_type: Type | None = None) list[AnnotationEffect] [source]
Annotate effects for a variant.
- get_effect_for_transcript(variant: Variant, transcript_model: TranscriptModel) AnnotationEffect | None [source]
Calculate effect for a given transcript.
dae.effect_annotation.cli module
- class dae.effect_annotation.cli.AnnotationAttributes(args)[source]
Bases:
object
- ALL_ATTRIBUTE_IDXS = {'effect_details': 2, 'gene_effects': 1, 'worst_effect': 0}
- class dae.effect_annotation.cli.EffectAnnotatorBuilder(args)[source]
Bases:
object
- get_gene_models() GeneModels [source]
- get_genomic_context() GenomicContext [source]
- get_grr() GenomicResourceRepo [source]
- get_refernce_genome() ReferenceGenome [source]
- class dae.effect_annotation.cli.VariantColumnInputFile(args)[source]
Bases:
object
- variant_columns = ['chrom', 'pos', 'location', 'variant', 'ref', 'alt']
dae.effect_annotation.effect module
Classes and helpers for variant annotation effects.
- class dae.effect_annotation.effect.AlleleEffects(worst_effect: str, gene_effects: list[EffectGene], effect_transcripts: dict[str, EffectTranscript])[source]
Bases:
object
Class for allele effect used in alleles.
- classmethod from_effects(effects: list[AnnotationEffect]) AlleleEffects [source]
Build allele effects from list of annotation effect.
- classmethod from_simplified_effects(effect_type: str, effect_genes: list[tuple[str, str]], transcripts: list[tuple[str, str]]) AlleleEffects | None [source]
Build allele effects from simplified effects.
- static from_string(data: str | None) AlleleEffects | None [source]
Build allele effect from string.
- property types: list[str]
- property worst: str
- class dae.effect_annotation.effect.AnnotationEffect(effect_name: str)[source]
Bases:
object
Class to represent variant effect.
- SEVERITY: ClassVar[dict[str, int]] = {"3'UTR": 11, "3'UTR-intron": 6, "5'UTR": 10, "5'UTR-intron": 7, 'CDS': 15, 'CNV+': 35, 'CNV-': 35, 'all': 24, 'coding_unknown': 13, 'frame-shift': 22, 'intergenic': 2, 'intron': 9, 'missense': 17, 'no-frame-shift': 16, 'no-frame-shift-newStop': 20, 'no-mutation': 1, 'noEnd': 18, 'noStart': 19, 'non-coding': 8, 'non-coding-intron': 4, 'nonsense': 21, 'promoter': 5, 'regulatory': 12, 'splice-site': 23, 'synonymous': 14, 'tRNA:ANTICODON': 30, 'unknown': 3}
- classmethod effect_severity(effect: AnnotationEffect) int [source]
- classmethod effects_description(effects: list[AnnotationEffect]) tuple[str, str, str] [source]
Build effects description.
Condider deprecating this.
- classmethod filter_gene_effects(effects: list[AnnotationEffect], effect_type: str) list[list[str]] [source]
Filter and map genes to effects by a group or effect type.
- classmethod gene_effects(effects: list[AnnotationEffect]) list[list[str]] [source]
Build parallel lists of genes and effects in that genes.
Consider deprecating this.
- classmethod simplify_effects(effects: list[AnnotationEffect]) tuple[str, list[tuple[str, str]], list[tuple[str, str | None, str | None, str]]] [source]
Simplify effects.
Consider deprecating this.
- classmethod sort_effects(effects: list[AnnotationEffect]) list[AnnotationEffect] [source]
- classmethod transcript_effects(effects: list[AnnotationEffect]) tuple[list[str], list[str | None], list[str | None], list[str]] [source]
Build parallel lists of transcripts, genes, effects and details.
Consider deprecating this.
- classmethod worst_effect(effects: list[AnnotationEffect]) str [source]
- class dae.effect_annotation.effect.EffectFactory[source]
Bases:
object
Factory class for build annotation effects.
- classmethod create_effect(effect_name: str) AnnotationEffect [source]
- classmethod create_effect_with_aa_change(effect_name: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest) AnnotationEffect [source]
Create effect with amino acid change.
- classmethod create_effect_with_prot_length(effect_name: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest) AnnotationEffect [source]
- classmethod create_effect_with_prot_pos(effect_name: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest) AnnotationEffect [source]
Create effect with protein change position.
- classmethod create_effect_with_request(effect_name: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest) AnnotationEffect [source]
Create effect with annotation request.
- classmethod create_effect_with_tm(effect_name: str, transcript_model: TranscriptModel) AnnotationEffect [source]
Create effect with transcript model.
- classmethod create_intronic_effect(effect_type: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest, start: int, end: int, index: int) AnnotationEffect [source]
Create intronic effect.
- classmethod create_intronic_non_coding_effect(effect_type: str, request: PositiveStrandAnnotationRequest | NegativeStrandAnnotationRequest, start: int, end: int, index: int) AnnotationEffect [source]
Create intronic non coding effect.
- class dae.effect_annotation.effect.EffectGene(symbol: str | None = None, effect: str | None = None)[source]
Bases:
object
Combine gene and effect and that gene.
- classmethod from_gene_effects(gene_effects: list[tuple[str, str]]) list[EffectGene] [source]
Build effect gene objects from list of gene, effect tuples.
- static from_string(data: str) EffectGene | None [source]
Deserialize effect gene.
- classmethod from_tuple(gene_effect: tuple[str, str]) EffectGene [source]
- class dae.effect_annotation.effect.EffectTranscript(transcript_id: str, gene: str | None = None, effect: str | None = None, details: str | None = None)[source]
Bases:
object
Defines effect transcript.
- classmethod from_effect_transcripts(effect_transcripts: list[tuple[str, str]]) dict[str, EffectTranscript] [source]
Build effect transcripts.
- static from_string(data: str) EffectTranscript | None [source]
Deserialize effect transcript/details.
- classmethod from_tuple(transcript_tuple: tuple[str, str | None, str | None, str]) EffectTranscript [source]
- class dae.effect_annotation.effect.EffectTypesMixin[source]
Bases:
object
Helper function to work with variant effects.
- EFFECT_GROUPS: ClassVar[dict[str, list[str]]] = {'CNV': ['CNV+', 'CNV-'], 'LGDs': ['frame-shift', 'nonsense', 'splice-site', 'no-frame-shift-newStop'], 'UTRs': ["3'UTR", "5'UTR", "3'UTR-intron", "5'UTR-intron"], 'coding': ['nonsense', 'frame-shift', 'splice-site', 'no-frame-shift-newStop', 'missense', 'no-frame-shift', 'noStart', 'noEnd', 'synonymous'], 'noncoding': ['non coding', 'intron', 'intergenic', "3'UTR", "5'UTR"], 'nonsynonymous': ['nonsense', 'frame-shift', 'splice-site', 'no-frame-shift-newStop', 'missense', 'no-frame-shift', 'noStart', 'noEnd']}
- EFFECT_TYPES: ClassVar[list[str]] = ["3'UTR", "3'UTR-intron", "5'UTR", "5'UTR-intron", 'frame-shift', 'intergenic', 'intron', 'missense', 'no-frame-shift', 'no-frame-shift-newStop', 'noEnd', 'noStart', 'non-coding', 'non-coding-intron', 'nonsense', 'splice-site', 'synonymous', 'CDS', 'CNV+', 'CNV-']
- EFFECT_TYPES_MAPPING: ClassVar[dict[str, list[str]]] = {"3'-UTR": ["3'UTR", "3'UTR-intron"], "5'-UTR": ["5'UTR", "5'UTR-intron"], 'CNV': ['CNV'], 'CNV+': ['CNV+'], 'CNV-': ['CNV-'], 'Frame-shift': ['frame-shift'], 'Intergenic': ['intergenic'], 'Intron': ['intron', 'non-coding-intron'], 'Missense': ['missense'], 'No-frame-shift': ['no-frame-shift'], 'No-frame-shift-newStop': ['no-frame-shift-newStop'], 'Non coding': ['non-coding'], 'Nonsense': ['nonsense'], 'Nonsynonymous': ['nonsynonymous'], 'Splice-site': ['splice-site'], 'Synonymous': ['synonymous'], 'noEnd': ['noEnd'], 'noStart': ['noStart']}
- EFFECT_TYPES_UI_NAMING: ClassVar[dict[str, str]] = {'frame-shift': 'Frame-shift', 'intron': 'Intron', 'missense': 'Missense', 'no-frame-shift': 'No-frame-shift', 'no-frame-shift-newStop': 'No-frame-shift-newStop', 'non-coding': 'Non coding', 'non-coding-intron': 'Intron', 'nonsense': 'Nonsense', 'splice-site': 'Splice-site', 'synonymous': 'Synonymous'}
- classmethod build_effect_types(effect_types: str | Iterable[str], *, safe: bool = True) list[str] [source]
Build list of effect types.
- classmethod build_effect_types_groups(effect_types: list[str]) list[str] [source]
Expand effect groups into effect types.
- classmethod build_effect_types_list(effect_types: list[str]) list[str] [source]
Fix naming of effect types coming from the UI.
- dae.effect_annotation.effect.expand_effect_types(effect_groups: str | Iterable[str] | Iterable[Iterable[str]]) list[str] [source]
Expand effect type groups into list of effect types.
- dae.effect_annotation.effect.gd2str(eff: AlleleEffects) str [source]
- dae.effect_annotation.effect.ge2str(eff: AlleleEffects) str [source]
- dae.effect_annotation.effect.gene_effect_get_genes(gene_effects: AlleleEffects | None) str [source]
Return comma separted list of genes.
- dae.effect_annotation.effect.gene_effect_get_genes_worst(gene_effects: AlleleEffects | None) str [source]
Return comma separted list of genes.
- dae.effect_annotation.effect.gene_effect_get_worst_effect(gene_effects: AlleleEffects | None) str [source]
dae.effect_annotation.gene_codes module
- class dae.effect_annotation.gene_codes.NuclearCode[source]
Bases:
object
Defines codon to amino acid translation codes.
- CodonsAa = {'Ala': ['GCG', 'GCA', 'GCT', 'GCC'], 'Arg': ['AGG', 'AGA', 'CGG', 'CGA', 'CGT', 'CGC'], 'Asn': ['AAT', 'AAC'], 'Asp': ['GAT', 'GAC'], 'Cys': ['TGT', 'TGC'], 'End': ['TAG', 'TAA', 'TGA'], 'Gln': ['CAG', 'CAA'], 'Glu': ['GAG', 'GAA'], 'Gly': ['GGG', 'GGA', 'GGT', 'GGC'], 'His': ['CAT', 'CAC'], 'Ile': ['ATA', 'ATT', 'ATC'], 'Leu': ['TTG', 'TTA', 'CTG', 'CTA', 'CTT', 'CTC'], 'Lys': ['AAG', 'AAA'], 'Met': ['ATG'], 'Phe': ['TTT', 'TTC'], 'Pro': ['CCG', 'CCA', 'CCT', 'CCC'], 'Ser': ['AGT', 'AGC', 'TCG', 'TCA', 'TCT', 'TCC'], 'Thr': ['ACG', 'ACA', 'ACT', 'ACC'], 'Trp': ['TGG'], 'Tyr': ['TAT', 'TAC'], 'Val': ['GTG', 'GTA', 'GTT', 'GTC']}
- CodonsAaKeys = ['Gly', 'Glu', 'Asp', 'Val', 'Ala', 'Arg', 'Ser', 'Lys', 'Asn', 'Met', 'Ile', 'Thr', 'Trp', 'End', 'Cys', 'Tyr', 'Leu', 'Phe', 'Gln', 'His', 'Pro']
- startCodons = ['ATG']
- stopCodons = ['TAG', 'TAA', 'TGA']