varcode 9.3.7__tar.gz → 9.3.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {varcode-9.3.7/varcode.egg-info → varcode-9.3.8}/PKG-INFO +1 -1
- varcode-9.3.8/tests/test_transcript_model_start_codons.py +163 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/transcript_layout.py +35 -27
- varcode-9.3.8/varcode/version.py +1 -0
- {varcode-9.3.7 → varcode-9.3.8/varcode.egg-info}/PKG-INFO +1 -1
- {varcode-9.3.7 → varcode-9.3.8}/varcode.egg-info/SOURCES.txt +1 -0
- varcode-9.3.7/varcode/version.py +0 -1
- {varcode-9.3.7 → varcode-9.3.8}/LICENSE +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/MANIFEST.in +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/README.md +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/pyproject.toml +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/requirements.txt +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/setup.cfg +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_annotator_divergence_scenarios.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_annotator_parity_adversarial.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_annotators.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_bnd_retained_segments.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_cli_effects.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_cli_genes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_cli_without_pkg_resources.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_collection_filtering.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_collection_variants_attr_consistency.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_common.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_cosmic_mutations.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_cryptic_exons.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_csv_roundtrip.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_dbnsfp_validation.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_default_structural_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_documentation_examples.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_annotation_errors.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_candidates.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_classes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_collection.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_collection_serialization.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_collection_sort_order.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effect_hypotheses.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_effects_from_mutagenix_variants.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_exacto_fusions.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_exonic_splice_site.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_fast_path.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_frameshift_cterminus_regression.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_frameshift_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_fusion_partner_candidates.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_genome_contig_validation.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_genome_sequence.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_genomic_layout.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_genotype.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_genotype_from_vcf.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_germline_context.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_germline_effects.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_haplotype_effect.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_maf.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_mitochondrial.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_mm10_klf6_frameshift.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_mouse.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_mutant_transcript.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_mutate.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_no_duplicate_variants.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_nonlocal_sv_transcripts.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_osteosarc_dataset.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_osteosarc_fusions.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_osteosarc_variants.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_partial_annotators.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_premature_stop_short_description.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_problematic_variants.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_protein_diff_parity.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_read_phase_resolver.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_real_world_callers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_reference.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_reference_mismatch_error.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_reference_segments.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_rna_evidence.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_rna_haplotype_sequences.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_rna_read_phasing_source.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_selenocysteine.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_selenocysteine_proteins.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_silent_aa_pos.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_silent_hgvs_description.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_splice_graph.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_splice_outcomes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_splice_site_effects.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_stop_codon_classification_bugs.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_string_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_structural_variant_annotator.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_structural_variants.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_sv_selenocysteine.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_sv_sequence_changes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_sv_tabular_metadata.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_symbolic_alleles.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_symbolic_sv_padding.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_timings.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_transcript_layout.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_transcript_model.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_transforms_left_align.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_transforms_pair_breakends.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_variant.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_variant_collection.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_vcf.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_vcf_output.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_vcf_parsing.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_vcf_phase_resolver.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/tests/test_vcf_spec_examples.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/__init__.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/annotators/__init__.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/annotators/fast.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/annotators/protein_diff.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/annotators/registry.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/__init__.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/effects_script.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/genes_script.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/logging.conf +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/variant_args.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cli/version_info.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/common.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/cryptic_exons.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/csv_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effect_candidates.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effect_hypotheses.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/__init__.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/classify.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/codon_tables.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/common.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_classes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_collection.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_ordering.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_prediction.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_prediction_coding.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_prediction_coding_frameshift.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/effect_prediction_coding_in_frame.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/fast_path.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/mutate.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/selenocysteine.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/sequence_change.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/structural.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/transcript_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/effects/translate.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/errors.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/exacto.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/genome.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/genome_sequence.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/genomic_layout.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/genotype.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/germline.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/maf.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/mutant_transcript.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/nucleotides.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/phasing.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/realized_effects.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/reference.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/rna_evidence.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/rna_read_phasing.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/splice_graph.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/splice_outcomes.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/string_helpers.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/structural_variant.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/sv_allele_parser.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/transcript_model.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/transforms/__init__.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/ucsc_reference_names.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/util.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/variant.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/variant_collection.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/vcf.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/vcf_output.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode/vcf_parsing.py +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode.egg-info/dependency_links.txt +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode.egg-info/entry_points.txt +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode.egg-info/requires.txt +0 -0
- {varcode-9.3.7 → varcode-9.3.8}/varcode.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"""Initiation codons in realized products (openvax/varcode#476)."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from pyensembl import cached_release
|
|
5
|
+
|
|
6
|
+
from varcode import Variant
|
|
7
|
+
from varcode.effect_hypotheses import SplicePlan
|
|
8
|
+
from varcode.effects import AlternateStartCodon, StartLoss, Substitution
|
|
9
|
+
from varcode.genomic_layout import GenomicLayout
|
|
10
|
+
from varcode.nucleotides import reverse_complement
|
|
11
|
+
from varcode.transcript_layout import (
|
|
12
|
+
build_exon_runs,
|
|
13
|
+
classify_products,
|
|
14
|
+
realize_exon_path,
|
|
15
|
+
realize_splice_plan,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
from .test_splice_graph import point
|
|
19
|
+
from .test_transcript_layout import Transcript, provider, structural
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@pytest.mark.parametrize("annotator", ["fast", "protein_diff", "transcript_model"])
|
|
23
|
+
@pytest.mark.parametrize("transcript_id,alt_codon", [
|
|
24
|
+
("ENST00000003084", "CTG"),
|
|
25
|
+
("ENST00000003084", "TTG"),
|
|
26
|
+
("ENST00000357654", "CTG"),
|
|
27
|
+
("ENST00000357654", "TTG"),
|
|
28
|
+
("ENST00000361624", "ATT"),
|
|
29
|
+
("ENST00000361624", "ATC"),
|
|
30
|
+
("ENST00000361624", "ATA"),
|
|
31
|
+
("ENST00000361624", "GTG"),
|
|
32
|
+
])
|
|
33
|
+
def test_recognized_alternate_start_preserves_protein(
|
|
34
|
+
annotator, transcript_id, alt_codon):
|
|
35
|
+
genome = cached_release(81)
|
|
36
|
+
transcript = genome.transcript_by_id(transcript_id)
|
|
37
|
+
ref, alt = "ATG", alt_codon
|
|
38
|
+
if transcript.on_backward_strand:
|
|
39
|
+
ref, alt = reverse_complement(ref), reverse_complement(alt)
|
|
40
|
+
variant = Variant(
|
|
41
|
+
transcript.contig, min(transcript.start_codon_positions), ref, alt,
|
|
42
|
+
genome=genome)
|
|
43
|
+
|
|
44
|
+
effect = variant.effect_on_transcript(transcript, annotator=annotator)
|
|
45
|
+
|
|
46
|
+
assert type(effect) is AlternateStartCodon
|
|
47
|
+
assert effect.ref_codon == "ATG"
|
|
48
|
+
assert effect.alt_codon == alt_codon
|
|
49
|
+
assert effect.modifies_coding_sequence is True
|
|
50
|
+
assert effect.modifies_protein_sequence is False
|
|
51
|
+
if annotator == "transcript_model":
|
|
52
|
+
outcome = effect.candidates[0].outcomes[0]
|
|
53
|
+
assert outcome.baseline.start_codon_present is True
|
|
54
|
+
assert outcome.mutant.start_codon_present is True
|
|
55
|
+
assert outcome.baseline.protein_sequence == str(transcript.protein_sequence)
|
|
56
|
+
assert outcome.mutant.protein_sequence == str(transcript.protein_sequence)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.mark.parametrize("transcript_id,alt_codon", [
|
|
60
|
+
("ENST00000003084", "GTG"),
|
|
61
|
+
("ENST00000357654", "GTG"),
|
|
62
|
+
("ENST00000361624", "CTG"),
|
|
63
|
+
("ENST00000361624", "TTG"),
|
|
64
|
+
])
|
|
65
|
+
def test_start_recognition_uses_the_transcripts_codon_table(
|
|
66
|
+
transcript_id, alt_codon):
|
|
67
|
+
genome = cached_release(81)
|
|
68
|
+
transcript = genome.transcript_by_id(transcript_id)
|
|
69
|
+
ref, alt = "ATG", alt_codon
|
|
70
|
+
if transcript.on_backward_strand:
|
|
71
|
+
ref, alt = reverse_complement(ref), reverse_complement(alt)
|
|
72
|
+
variant = Variant(
|
|
73
|
+
transcript.contig, min(transcript.start_codon_positions), ref, alt,
|
|
74
|
+
genome=genome)
|
|
75
|
+
|
|
76
|
+
effect = variant.effect_on_transcript(transcript, annotator="transcript_model")
|
|
77
|
+
|
|
78
|
+
assert type(effect) is StartLoss
|
|
79
|
+
assert effect.modifies_protein_sequence is True
|
|
80
|
+
assert effect.candidates[0].outcomes[0].mutant.start_codon_present is False
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@pytest.fixture(params=["exon_path", "splice_plan"])
|
|
84
|
+
def realize(request):
|
|
85
|
+
if request.param == "exon_path":
|
|
86
|
+
return realize_exon_path
|
|
87
|
+
|
|
88
|
+
def splice_plan(transcript, layout):
|
|
89
|
+
plan = SplicePlan(
|
|
90
|
+
choices=(),
|
|
91
|
+
kept_runs=tuple(run.key for run in build_exon_runs(transcript, layout)))
|
|
92
|
+
product, unresolved = realize_splice_plan(transcript, layout, plan, ())
|
|
93
|
+
assert unresolved == ()
|
|
94
|
+
return product
|
|
95
|
+
|
|
96
|
+
return splice_plan
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@pytest.mark.parametrize("reverse", [False, True])
|
|
100
|
+
def test_both_layout_paths_translate_alternate_start_as_methionine(realize, reverse):
|
|
101
|
+
transcript = Transcript(reverse)
|
|
102
|
+
layout = GenomicLayout.from_transcript(
|
|
103
|
+
transcript, flank=0, sequence_provider=provider(reverse))
|
|
104
|
+
variant = point(18, "T", "G") if reverse else point(1, "A", "C")
|
|
105
|
+
baseline = realize(transcript, layout)
|
|
106
|
+
mutant = realize(transcript, layout.apply_point_variant(variant))
|
|
107
|
+
|
|
108
|
+
effect = classify_products(variant, transcript, baseline, mutant)
|
|
109
|
+
|
|
110
|
+
assert type(effect) is AlternateStartCodon
|
|
111
|
+
assert (effect.ref_codon, effect.alt_codon) == ("ATG", "CTG")
|
|
112
|
+
assert mutant.cdna_sequence == "CTGCAAGCTTAG"
|
|
113
|
+
assert mutant.protein_sequence == "MQA"
|
|
114
|
+
assert mutant.start_codon_present is True
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@pytest.mark.parametrize("reverse", [False, True])
|
|
118
|
+
def test_deleted_start_is_still_start_loss(realize, reverse):
|
|
119
|
+
transcript = Transcript(reverse)
|
|
120
|
+
layout = GenomicLayout.from_transcript(
|
|
121
|
+
transcript, flank=0, sequence_provider=provider(reverse))
|
|
122
|
+
variant = structural("DEL", *(16, 18) if reverse else (1, 3))
|
|
123
|
+
baseline = realize(transcript, layout)
|
|
124
|
+
mutant = realize(transcript, layout.apply_structural_variant(variant))
|
|
125
|
+
|
|
126
|
+
effect = classify_products(variant, transcript, baseline, mutant)
|
|
127
|
+
|
|
128
|
+
assert type(effect) is StartLoss
|
|
129
|
+
assert mutant.start_codon_present is False
|
|
130
|
+
assert mutant.protein_sequence == ""
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def test_alternate_start_is_compared_to_patient_baseline(realize):
|
|
134
|
+
transcript = Transcript()
|
|
135
|
+
layout = GenomicLayout.from_transcript(
|
|
136
|
+
transcript, flank=0, sequence_provider=provider())
|
|
137
|
+
layout = layout.apply_point_variant(point(1, "A", "C"))
|
|
138
|
+
baseline = realize(transcript, layout)
|
|
139
|
+
variant = point(1, "C", "T")
|
|
140
|
+
mutant = realize(transcript, layout.apply_point_variant(variant))
|
|
141
|
+
|
|
142
|
+
effect = classify_products(variant, transcript, baseline, mutant)
|
|
143
|
+
|
|
144
|
+
assert type(effect) is AlternateStartCodon
|
|
145
|
+
assert (effect.ref_codon, effect.alt_codon) == ("CTG", "TTG")
|
|
146
|
+
assert baseline.protein_sequence == mutant.protein_sequence == "MQA"
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def test_alternate_start_does_not_hide_downstream_protein_change(realize):
|
|
150
|
+
transcript = Transcript()
|
|
151
|
+
layout = GenomicLayout.from_transcript(
|
|
152
|
+
transcript, flank=0, sequence_provider=provider())
|
|
153
|
+
baseline = realize(transcript, layout)
|
|
154
|
+
variant = point(1, "A", "C")
|
|
155
|
+
mutant_layout = layout.apply_point_variant(variant).apply_point_variant(
|
|
156
|
+
point(6, "C", "A"))
|
|
157
|
+
mutant = realize(transcript, mutant_layout)
|
|
158
|
+
|
|
159
|
+
effect = classify_products(variant, transcript, baseline, mutant)
|
|
160
|
+
|
|
161
|
+
assert type(effect) is Substitution
|
|
162
|
+
assert (effect.aa_ref, effect.aa_alt) == ("Q", "K")
|
|
163
|
+
assert mutant.protein_sequence == "MKA"
|
|
@@ -29,6 +29,7 @@ from .effects.codon_tables import (
|
|
|
29
29
|
)
|
|
30
30
|
from .effects.selenocysteine import layout_selenocysteine
|
|
31
31
|
from .effects.effect_classes import (
|
|
32
|
+
AlternateStartCodon,
|
|
32
33
|
FivePrimeUTR,
|
|
33
34
|
Intronic,
|
|
34
35
|
Silent,
|
|
@@ -221,8 +222,29 @@ def _start_offset(layout, selected_runs, transcript):
|
|
|
221
222
|
return None
|
|
222
223
|
|
|
223
224
|
|
|
225
|
+
def _translate_from_start(transcript, cdna, start, pieces):
|
|
226
|
+
"""Return protein, start presence and codon at the mapped CDS start."""
|
|
227
|
+
if start is None:
|
|
228
|
+
return "", False, None
|
|
229
|
+
coding = cdna[start:]
|
|
230
|
+
start_codon = coding[:3].upper()
|
|
231
|
+
codon_table = codon_table_for_transcript(transcript)
|
|
232
|
+
if start_codon not in codon_table.start_codons:
|
|
233
|
+
return "", False, start_codon
|
|
234
|
+
coding = coding[:len(coding) // 3 * 3]
|
|
235
|
+
protein = translate_sequence(
|
|
236
|
+
coding,
|
|
237
|
+
codon_table=codon_table,
|
|
238
|
+
to_stop=True,
|
|
239
|
+
selenocysteine={pos - start for pos in
|
|
240
|
+
layout_selenocysteine(transcript, pieces)})
|
|
241
|
+
# NCBI's recognized initiation codons encode Met at the CDS start,
|
|
242
|
+
# even when their internal translation is another residue (e.g. CTG).
|
|
243
|
+
return "M" + protein[1:], True, start_codon
|
|
244
|
+
|
|
245
|
+
|
|
224
246
|
def realize_exon_path(transcript, layout, kept_run_keys=None):
|
|
225
|
-
"""Splice selected exon runs and translate from the
|
|
247
|
+
"""Splice selected exon runs and translate from the mapped CDS start."""
|
|
226
248
|
runs = build_exon_runs(transcript, layout)
|
|
227
249
|
if kept_run_keys is None:
|
|
228
250
|
selected = runs
|
|
@@ -237,19 +259,8 @@ def realize_exon_path(transcript, layout, kept_run_keys=None):
|
|
|
237
259
|
for run_layout in run_layouts
|
|
238
260
|
for _, position, _ in run_layout.origins())
|
|
239
261
|
start = _start_offset(layout, selected, transcript)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
start_present = False
|
|
243
|
-
else:
|
|
244
|
-
coding = cdna[start:]
|
|
245
|
-
coding = coding[:len(coding) // 3 * 3]
|
|
246
|
-
protein = translate_sequence(
|
|
247
|
-
coding,
|
|
248
|
-
codon_table=codon_table_for_transcript(transcript),
|
|
249
|
-
to_stop=True,
|
|
250
|
-
selenocysteine={pos - start for pos in
|
|
251
|
-
layout_selenocysteine(transcript, run_layouts)})
|
|
252
|
-
start_present = True
|
|
262
|
+
protein, start_present, start_codon = _translate_from_start(
|
|
263
|
+
transcript, cdna, start, run_layouts)
|
|
253
264
|
return RealizedTranscriptProduct(
|
|
254
265
|
transcript=transcript,
|
|
255
266
|
cdna_sequence=cdna,
|
|
@@ -257,6 +268,7 @@ def realize_exon_path(transcript, layout, kept_run_keys=None):
|
|
|
257
268
|
junction_signature=junction_signature(transcript, selected),
|
|
258
269
|
start_codon_present=start_present,
|
|
259
270
|
evidence={
|
|
271
|
+
"start_codon": start_codon,
|
|
260
272
|
"exon_runs": tuple(run.key for run in selected),
|
|
261
273
|
"genomic_positions": genomic_positions,
|
|
262
274
|
})
|
|
@@ -403,20 +415,10 @@ def realize_splice_plan(
|
|
|
403
415
|
if start_offset is not None:
|
|
404
416
|
break
|
|
405
417
|
consumed += piece.length
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
start_present = False
|
|
409
|
-
else:
|
|
410
|
-
coding = cdna[start_offset:]
|
|
411
|
-
coding = coding[:len(coding) // 3 * 3]
|
|
412
|
-
protein = translate_sequence(
|
|
413
|
-
coding,
|
|
414
|
-
codon_table=codon_table_for_transcript(transcript),
|
|
415
|
-
to_stop=True,
|
|
416
|
-
selenocysteine={pos - start_offset for pos in
|
|
417
|
-
layout_selenocysteine(transcript, pieces)})
|
|
418
|
-
start_present = True
|
|
418
|
+
protein, start_present, start_codon = _translate_from_start(
|
|
419
|
+
transcript, cdna, start_offset, pieces)
|
|
419
420
|
evidence = {
|
|
421
|
+
"start_codon": start_codon,
|
|
420
422
|
"exon_runs": tuple(run.key for run in selected),
|
|
421
423
|
"genomic_positions": genomic_positions,
|
|
422
424
|
"splice_choices": tuple(
|
|
@@ -494,6 +496,12 @@ def classify_products(variant, transcript, baseline, mutant):
|
|
|
494
496
|
if baseline.start_codon_present and not mutant.start_codon_present:
|
|
495
497
|
return StartLoss(variant, transcript)
|
|
496
498
|
if baseline.protein_sequence == mutant.protein_sequence:
|
|
499
|
+
ref_codon = baseline.evidence.get("start_codon")
|
|
500
|
+
alt_codon = mutant.evidence.get("start_codon")
|
|
501
|
+
if (baseline.start_codon_present and mutant.start_codon_present
|
|
502
|
+
and ref_codon and alt_codon and ref_codon != alt_codon):
|
|
503
|
+
return AlternateStartCodon(
|
|
504
|
+
variant, transcript, ref_codon=ref_codon, alt_codon=alt_codon)
|
|
497
505
|
return _unchanged_product_effect(variant, transcript, mutant)
|
|
498
506
|
mutant_transcript = MutantTranscript(
|
|
499
507
|
reference_transcript=transcript,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "9.3.8"
|
|
@@ -83,6 +83,7 @@ tests/test_symbolic_sv_padding.py
|
|
|
83
83
|
tests/test_timings.py
|
|
84
84
|
tests/test_transcript_layout.py
|
|
85
85
|
tests/test_transcript_model.py
|
|
86
|
+
tests/test_transcript_model_start_codons.py
|
|
86
87
|
tests/test_transforms_left_align.py
|
|
87
88
|
tests/test_transforms_pair_breakends.py
|
|
88
89
|
tests/test_variant.py
|
varcode-9.3.7/varcode/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "9.3.7"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|