varcode 9.2.3__tar.gz → 9.2.5__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.2.5/PKG-INFO +106 -0
- varcode-9.2.5/README.md +79 -0
- varcode-9.2.5/tests/test_bnd_retained_segments.py +111 -0
- varcode-9.2.5/tests/test_documentation_examples.py +127 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/structural.py +15 -9
- {varcode-9.2.3 → varcode-9.2.5}/varcode/mutant_transcript.py +4 -1
- {varcode-9.2.3 → varcode-9.2.5}/varcode/sv_allele_parser.py +11 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/variant.py +1 -1
- {varcode-9.2.3 → varcode-9.2.5}/varcode/variant_collection.py +1 -1
- varcode-9.2.5/varcode/version.py +1 -0
- varcode-9.2.5/varcode.egg-info/PKG-INFO +106 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode.egg-info/SOURCES.txt +2 -0
- varcode-9.2.3/PKG-INFO +0 -287
- varcode-9.2.3/README.md +0 -260
- varcode-9.2.3/varcode/version.py +0 -1
- varcode-9.2.3/varcode.egg-info/PKG-INFO +0 -287
- {varcode-9.2.3 → varcode-9.2.5}/LICENSE +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/MANIFEST.in +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/pyproject.toml +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/requirements.txt +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/setup.cfg +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_annotator_divergence_scenarios.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_annotator_parity_adversarial.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_annotators.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_cli_effects.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_cli_genes.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_cli_without_pkg_resources.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_collection_filtering.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_collection_variants_attr_consistency.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_common.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_cosmic_mutations.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_cryptic_exons.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_csv_roundtrip.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_dbnsfp_validation.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_default_structural_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_annotation_errors.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_candidates.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_classes.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_collection.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_collection_serialization.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_collection_sort_order.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effect_hypotheses.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_effects_from_mutagenix_variants.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_exacto_fusions.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_exonic_splice_site.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_fast_path.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_frameshift_cterminus_regression.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_frameshift_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_genome_contig_validation.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_genome_sequence.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_genomic_layout.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_genotype.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_genotype_from_vcf.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_germline_context.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_germline_effects.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_haplotype_effect.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_maf.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_mitochondrial.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_mm10_klf6_frameshift.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_mouse.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_mutant_transcript.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_mutate.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_no_duplicate_variants.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_nonlocal_sv_transcripts.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_osteosarc_fusions.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_partial_annotators.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_premature_stop_short_description.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_problematic_variants.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_protein_diff_parity.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_read_phase_resolver.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_real_world_callers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_reference.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_reference_mismatch_error.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_reference_segments.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_rna_evidence.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_rna_haplotype_sequences.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_rna_read_phasing_source.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_selenocysteine.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_silent_aa_pos.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_silent_hgvs_description.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_splice_graph.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_splice_outcomes.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_splice_site_effects.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_stop_codon_classification_bugs.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_string_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_structural_variant_annotator.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_structural_variants.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_sv_tabular_metadata.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_symbolic_alleles.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_symbolic_sv_padding.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_timings.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_transcript_layout.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_transcript_model.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_transforms_left_align.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_transforms_pair_breakends.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_variant.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_variant_collection.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_vcf.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_vcf_output.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_vcf_parsing.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_vcf_phase_resolver.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/tests/test_vcf_spec_examples.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/__init__.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/annotators/__init__.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/annotators/fast.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/annotators/protein_diff.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/annotators/registry.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/__init__.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/effects_script.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/genes_script.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/logging.conf +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/variant_args.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cli/version_info.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/common.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/cryptic_exons.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/csv_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effect_candidates.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effect_hypotheses.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/__init__.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/classify.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/codon_tables.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/common.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_classes.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_collection.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_ordering.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_prediction.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_prediction_coding.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_prediction_coding_frameshift.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/effect_prediction_coding_in_frame.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/fast_path.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/mutate.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/transcript_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/effects/translate.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/errors.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/exacto.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/genome.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/genome_sequence.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/genomic_layout.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/genotype.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/germline.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/maf.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/nucleotides.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/phasing.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/realized_effects.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/reference.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/rna_evidence.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/rna_read_phasing.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/splice_graph.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/splice_outcomes.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/string_helpers.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/structural_variant.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/transcript_layout.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/transcript_model.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/transforms/__init__.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/ucsc_reference_names.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/util.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/vcf.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/vcf_output.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode/vcf_parsing.py +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode.egg-info/dependency_links.txt +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode.egg-info/entry_points.txt +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode.egg-info/requires.txt +0 -0
- {varcode-9.2.3 → varcode-9.2.5}/varcode.egg-info/top_level.txt +0 -0
varcode-9.2.5/PKG-INFO
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: varcode
|
|
3
|
+
Version: 9.2.5
|
|
4
|
+
Summary: Variant annotation in Python
|
|
5
|
+
Author-email: Alex Rubinsteyn <alex.rubinsteyn@unc.edu>
|
|
6
|
+
Project-URL: Homepage, https://github.com/openvax/varcode
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/openvax/varcode/issues
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: numpy<3.0.0,>=2.0.0
|
|
19
|
+
Requires-Dist: pandas<3.0.0,>=2.0.0
|
|
20
|
+
Requires-Dist: pyensembl>=2.6.4
|
|
21
|
+
Requires-Dist: memoized_property>=1.0.2
|
|
22
|
+
Requires-Dist: serializable>=1.1.0
|
|
23
|
+
Requires-Dist: sercol>=0.1.4
|
|
24
|
+
Provides-Extra: rna
|
|
25
|
+
Requires-Dist: pysam>=0.21; extra == "rna"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
29
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
30
|
+
[](https://pypi.python.org/pypi/varcode/)
|
|
31
|
+
[](https://pypistats.org/packages/varcode)
|
|
32
|
+
|
|
33
|
+
# Varcode
|
|
34
|
+
|
|
35
|
+
Varcode helps you work with genomic variants in Python and predict their effects
|
|
36
|
+
on genes, transcripts, and protein sequences.
|
|
37
|
+
|
|
38
|
+
Load variants from VCF or MAF files, annotate them, and inspect the results.
|
|
39
|
+
The same interface handles small variants and structural variants; optional
|
|
40
|
+
germline, phasing, and RNA evidence can refine predictions.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Requires Python 3.9 or later:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install varcode
|
|
48
|
+
pyensembl install --release 81 --species human
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The second command downloads the annotation and transcript sequences for the
|
|
52
|
+
GRCh38 example below. Release 81 is pinned for reproducibility, not a requirement
|
|
53
|
+
to use that release for your own data. Choose an annotation matching your
|
|
54
|
+
input's genome build; see [reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
55
|
+
|
|
56
|
+
<a id="example"></a>
|
|
57
|
+
|
|
58
|
+
## Quick start
|
|
59
|
+
|
|
60
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from varcode import Variant
|
|
64
|
+
|
|
65
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
66
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
67
|
+
effect = variant.effect_on_transcript(transcript)
|
|
68
|
+
|
|
69
|
+
print(effect.short_description) # p.L159M
|
|
70
|
+
protein = effect.mutant_protein_sequence
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For a VCF called against the same genome build:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from varcode import load_vcf
|
|
77
|
+
|
|
78
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
79
|
+
effects = variants.effects()
|
|
80
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
81
|
+
print(variant.short_description, effect.short_description)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A variant can affect several transcripts. Priority is a summary of predicted
|
|
85
|
+
consequence, not proof of expression or pathogenicity. A protein sequence may be
|
|
86
|
+
unavailable for unresolved effects.
|
|
87
|
+
|
|
88
|
+
<a id="further-reading"></a>
|
|
89
|
+
|
|
90
|
+
## Learn more
|
|
91
|
+
|
|
92
|
+
Start with the [getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
93
|
+
for file loading, result access, and saving a table. Then follow the
|
|
94
|
+
[task guides](https://openvax.github.io/varcode/#find-your-next-task) for sample
|
|
95
|
+
filtering, structural variants, phasing, and RNA evidence.
|
|
96
|
+
|
|
97
|
+
<a id="effect-types"></a>
|
|
98
|
+
<a id="coordinate-system"></a>
|
|
99
|
+
|
|
100
|
+
Detailed [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
101
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
102
|
+
and the [API reference](https://openvax.github.io/varcode/api/) live in the docs.
|
|
103
|
+
|
|
104
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
105
|
+
Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and the
|
|
106
|
+
[changelog](CHANGELOG.md).
|
varcode-9.2.5/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
2
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
3
|
+
[](https://pypi.python.org/pypi/varcode/)
|
|
4
|
+
[](https://pypistats.org/packages/varcode)
|
|
5
|
+
|
|
6
|
+
# Varcode
|
|
7
|
+
|
|
8
|
+
Varcode helps you work with genomic variants in Python and predict their effects
|
|
9
|
+
on genes, transcripts, and protein sequences.
|
|
10
|
+
|
|
11
|
+
Load variants from VCF or MAF files, annotate them, and inspect the results.
|
|
12
|
+
The same interface handles small variants and structural variants; optional
|
|
13
|
+
germline, phasing, and RNA evidence can refine predictions.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Requires Python 3.9 or later:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install varcode
|
|
21
|
+
pyensembl install --release 81 --species human
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The second command downloads the annotation and transcript sequences for the
|
|
25
|
+
GRCh38 example below. Release 81 is pinned for reproducibility, not a requirement
|
|
26
|
+
to use that release for your own data. Choose an annotation matching your
|
|
27
|
+
input's genome build; see [reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
28
|
+
|
|
29
|
+
<a id="example"></a>
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from varcode import Variant
|
|
37
|
+
|
|
38
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
39
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
40
|
+
effect = variant.effect_on_transcript(transcript)
|
|
41
|
+
|
|
42
|
+
print(effect.short_description) # p.L159M
|
|
43
|
+
protein = effect.mutant_protein_sequence
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For a VCF called against the same genome build:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from varcode import load_vcf
|
|
50
|
+
|
|
51
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
52
|
+
effects = variants.effects()
|
|
53
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
54
|
+
print(variant.short_description, effect.short_description)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
A variant can affect several transcripts. Priority is a summary of predicted
|
|
58
|
+
consequence, not proof of expression or pathogenicity. A protein sequence may be
|
|
59
|
+
unavailable for unresolved effects.
|
|
60
|
+
|
|
61
|
+
<a id="further-reading"></a>
|
|
62
|
+
|
|
63
|
+
## Learn more
|
|
64
|
+
|
|
65
|
+
Start with the [getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
66
|
+
for file loading, result access, and saving a table. Then follow the
|
|
67
|
+
[task guides](https://openvax.github.io/varcode/#find-your-next-task) for sample
|
|
68
|
+
filtering, structural variants, phasing, and RNA evidence.
|
|
69
|
+
|
|
70
|
+
<a id="effect-types"></a>
|
|
71
|
+
<a id="coordinate-system"></a>
|
|
72
|
+
|
|
73
|
+
Detailed [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
74
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
75
|
+
and the [API reference](https://openvax.github.io/varcode/api/) live in the docs.
|
|
76
|
+
|
|
77
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
78
|
+
Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and the
|
|
79
|
+
[changelog](CHANGELOG.md).
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"""A BND fallback describes only its retained reference fragment (#447)."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from pyensembl import cached_release
|
|
5
|
+
|
|
6
|
+
from varcode import StructuralVariant, parse_symbolic_alt
|
|
7
|
+
from varcode.effects import TranslocationToIntergenic
|
|
8
|
+
from varcode.effects.structural import _build_translocation_mutant_transcript
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture(params=["ENST00000003084", "ENST00000357654"])
|
|
12
|
+
def transcript(request):
|
|
13
|
+
return cached_release(81).transcript_by_id(request.param)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def expected_offsets(transcript, position, side):
|
|
17
|
+
"""Independent per-base oracle in transcript order, including the anchor."""
|
|
18
|
+
positions = [p for exon in transcript.exons
|
|
19
|
+
for p in (range(exon.start, exon.end + 1) if transcript.strand == "+"
|
|
20
|
+
else range(exon.end, exon.start - 1, -1))]
|
|
21
|
+
kept = [i for i, p in enumerate(positions)
|
|
22
|
+
if (p <= position if side == "left" else p >= position)]
|
|
23
|
+
return min(kept), max(kept) + 1
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.mark.parametrize("alt,side", [
|
|
27
|
+
("N[22:15500000[", "left"), ("N]22:15500000]", "left"),
|
|
28
|
+
("[22:15500000[N", "right"), ("]22:15500000]N", "right"),
|
|
29
|
+
("ACGT.", "left"), (".ACGT", "right"),
|
|
30
|
+
])
|
|
31
|
+
@pytest.mark.parametrize("location", ["exonic", "exon_start", "exon_end", "intronic"])
|
|
32
|
+
def test_both_strands_and_local_sides(transcript, alt, side, location):
|
|
33
|
+
# An interior exon also permits meaningful suffix/prefix comparisons.
|
|
34
|
+
exon = transcript.exons[2]
|
|
35
|
+
if location == "exonic":
|
|
36
|
+
position = (exon.start + exon.end) // 2
|
|
37
|
+
elif location == "exon_start":
|
|
38
|
+
position = exon.start
|
|
39
|
+
elif location == "exon_end":
|
|
40
|
+
position = exon.end
|
|
41
|
+
else:
|
|
42
|
+
other = transcript.exons[3]
|
|
43
|
+
position = ((exon.end + other.start) // 2 if transcript.strand == "+"
|
|
44
|
+
else (other.end + exon.start) // 2)
|
|
45
|
+
sv = parse_symbolic_alt(transcript.contig, position, "N", alt,
|
|
46
|
+
genome=transcript.genome)
|
|
47
|
+
effect = sv.effect_on_transcript(transcript)
|
|
48
|
+
assert isinstance(effect, TranslocationToIntergenic)
|
|
49
|
+
mt = effect.mutant_transcript
|
|
50
|
+
assert mt is not None
|
|
51
|
+
(segment,) = mt.reference_segments
|
|
52
|
+
assert segment.source is transcript
|
|
53
|
+
assert (segment.start, segment.end) == expected_offsets(transcript, position, side)
|
|
54
|
+
assert segment.strand == "+" # source is already oriented transcript cDNA
|
|
55
|
+
five_prime = (side == "left") == (transcript.strand == "+")
|
|
56
|
+
assert segment.label == ("translocation_5p" if five_prime else "translocation_3p")
|
|
57
|
+
assert segment.length < len(transcript.sequence)
|
|
58
|
+
assert mt.cdna_sequence is None
|
|
59
|
+
assert mt.mutant_protein_sequence is None
|
|
60
|
+
assert mt.evidence["sequence_status"] == "retained_reference_fragment"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_cftr_regression_keeps_51_bases_not_entire_transcript():
|
|
64
|
+
tx = cached_release(81).transcript_by_id("ENST00000003084")
|
|
65
|
+
sv = parse_symbolic_alt("7", tx.exons[0].start + 50, "N", "N]22:15500000]",
|
|
66
|
+
genome=tx.genome)
|
|
67
|
+
mt = sv.effect_on_transcript(tx).mutant_transcript
|
|
68
|
+
(segment,) = mt.reference_segments
|
|
69
|
+
assert (segment.start, segment.end) == (0, 51)
|
|
70
|
+
assert segment.source.sequence[segment.start:segment.end] == tx.sequence[:51]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@pytest.mark.parametrize("alt", [None, "<BND>", "N[?:?[", "N[22:15500000]", ".", "N.N"])
|
|
74
|
+
def test_unknown_local_orientation_is_unresolved(transcript, alt):
|
|
75
|
+
sv = StructuralVariant(transcript.contig, transcript.exons[0].start + 5,
|
|
76
|
+
"BND", alt=alt, genome=transcript.genome)
|
|
77
|
+
assert sv.effect_on_transcript(transcript).mutant_transcript is None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@pytest.mark.parametrize("orientation", ["[[", "]]"])
|
|
81
|
+
def test_mate_orientation_does_not_determine_local_side(transcript, orientation):
|
|
82
|
+
sv = StructuralVariant(transcript.contig, transcript.exons[0].start + 5,
|
|
83
|
+
"BND", mate_contig="22", mate_start=15_500_000,
|
|
84
|
+
mate_orientation=orientation, genome=transcript.genome)
|
|
85
|
+
with pytest.warns(UserWarning, match="can't read the breakend orientation"):
|
|
86
|
+
effect = sv.effect_on_transcript(transcript)
|
|
87
|
+
assert isinstance(effect, TranslocationToIntergenic)
|
|
88
|
+
assert effect.mutant_transcript is None
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@pytest.mark.parametrize("location", ["before", "after", "wrong_contig"])
|
|
92
|
+
def test_unrelated_transcript_does_not_supply_a_segment(transcript, location):
|
|
93
|
+
position = {"before": transcript.start - 1, "after": transcript.end + 1,
|
|
94
|
+
"wrong_contig": transcript.start + 5}[location]
|
|
95
|
+
contig = "1" if location == "wrong_contig" else transcript.contig
|
|
96
|
+
sv = StructuralVariant(contig, position, "BND", alt="N.", genome=transcript.genome)
|
|
97
|
+
assert _build_translocation_mutant_transcript(sv, transcript) is None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@pytest.mark.parametrize("alt", ["N]22:15500000]", "]22:15500000]N", "N.", ".N", "<BND>"])
|
|
101
|
+
def test_supplied_assembly_is_unchanged(transcript, alt):
|
|
102
|
+
assembly = "ATGGCTTAA"
|
|
103
|
+
sv = StructuralVariant(transcript.contig, transcript.exons[0].start + 5,
|
|
104
|
+
"BND", alt=alt, alt_assembly=assembly, genome=transcript.genome)
|
|
105
|
+
mt = sv.effect_on_transcript(transcript).mutant_transcript
|
|
106
|
+
assert mt.cdna_sequence == assembly
|
|
107
|
+
assert mt.mutant_protein_sequence is None
|
|
108
|
+
assert mt.evidence == {"source": "alt_assembly"}
|
|
109
|
+
(segment,) = mt.reference_segments
|
|
110
|
+
assert segment.source.sequence == assembly
|
|
111
|
+
assert (segment.start, segment.end, segment.label) == (0, len(assembly), "alt_assembly")
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""Keep the reader-facing examples executable, using their actual Markdown."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import re
|
|
5
|
+
import shutil
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
from pyensembl import cached_release
|
|
9
|
+
|
|
10
|
+
import varcode
|
|
11
|
+
from varcode import EffectCandidate, StructuralVariant, Variant
|
|
12
|
+
from varcode.effect_hypotheses import RealizedEffectCandidate
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _blocks(path, heading=None):
|
|
19
|
+
text = (ROOT / path).read_text()
|
|
20
|
+
if heading is not None:
|
|
21
|
+
text = text.split(heading + "\n", 1)[1]
|
|
22
|
+
return re.findall(r"```python\n(.*?)```", text, re.S)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _run(blocks, namespace=None):
|
|
26
|
+
namespace = {} if namespace is None else namespace
|
|
27
|
+
for block in blocks:
|
|
28
|
+
exec(compile(block, "documentation example", "exec"), namespace)
|
|
29
|
+
return namespace
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@pytest.fixture
|
|
33
|
+
def input_directory(tmp_path, monkeypatch):
|
|
34
|
+
for fixture in (ROOT / "tests/data/documentation").glob("*.vcf"):
|
|
35
|
+
shutil.copy(fixture, tmp_path / fixture.name)
|
|
36
|
+
shutil.copy(tmp_path / "variants.vcf", tmp_path / "tumor.vcf")
|
|
37
|
+
monkeypatch.chdir(tmp_path)
|
|
38
|
+
return tmp_path
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@pytest.mark.parametrize("path,count", [
|
|
42
|
+
("README.md", 2),
|
|
43
|
+
("docs/getting_started.md", 4),
|
|
44
|
+
("docs/index.md", 1),
|
|
45
|
+
("docs/effect_annotation.md", 3),
|
|
46
|
+
("docs/structural_variants.md", 1),
|
|
47
|
+
("docs/transforms.md", 1),
|
|
48
|
+
("docs/germline.md", 1),
|
|
49
|
+
])
|
|
50
|
+
def test_documentation_first_steps(path, count, input_directory):
|
|
51
|
+
namespace = _run(_blocks(path)[:count])
|
|
52
|
+
if path == "docs/transforms.md":
|
|
53
|
+
assert len(namespace["paired"]) == len(namespace["normalized"]) == 1
|
|
54
|
+
else:
|
|
55
|
+
assert len(namespace["effects"]) > 0
|
|
56
|
+
if path in ("README.md", "docs/getting_started.md"):
|
|
57
|
+
assert namespace["protein"][158] == "M"
|
|
58
|
+
if path == "docs/getting_started.md":
|
|
59
|
+
assert (input_directory / "effects.csv").is_file()
|
|
60
|
+
if path == "docs/structural_variants.md":
|
|
61
|
+
assert namespace["variants"][0].is_structural
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_documentation_germline_scenarios():
|
|
65
|
+
namespace = _run(_blocks(
|
|
66
|
+
"docs/germline.md", "## Concrete example: same codon, three scenarios")[:4])
|
|
67
|
+
assert namespace["eff_cis"].short_description == "p.S159T"
|
|
68
|
+
assert namespace["eff_trans"].short_description == "p.L159M"
|
|
69
|
+
assert {c.effect.short_description for c in namespace["eff"].candidates} == {
|
|
70
|
+
"p.S159T", "p.L159M"}
|
|
71
|
+
|
|
72
|
+
_run(_blocks("docs/germline.md", "## Loss of heterozygosity (LOH)")[:1],
|
|
73
|
+
namespace)
|
|
74
|
+
assert any(getattr(effect, "is_loh", False)
|
|
75
|
+
for effect in namespace["overlap"].effects(germline=namespace["ctx"]))
|
|
76
|
+
|
|
77
|
+
validation = _blocks("docs/germline.md", "## Cross-VCF build mismatch")[:1]
|
|
78
|
+
_run(validation, namespace)
|
|
79
|
+
namespace["ctx"] = varcode.GermlineContext.from_variants(
|
|
80
|
+
[namespace["germline"]], reference_name="GRCh37")
|
|
81
|
+
with pytest.raises(varcode.GenomeBuildMismatchError):
|
|
82
|
+
_run(validation, namespace)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def test_documentation_splice_accessors():
|
|
86
|
+
text = (ROOT / "docs/effect_annotation.md").read_text()
|
|
87
|
+
section = text.split("### The `SpliceOutcomeSet` shape\n", 1)[1]
|
|
88
|
+
section = section.split("### RNA evidence reconciliation\n", 1)[0]
|
|
89
|
+
blocks = re.findall(r"```python\n(.*?)```", section, re.S)
|
|
90
|
+
namespace = _run(blocks[:1])
|
|
91
|
+
namespace["effect"] = namespace["splice_set"]
|
|
92
|
+
_run(blocks[1:], namespace)
|
|
93
|
+
assert isinstance(namespace["splice_set"], varcode.SpliceOutcomeSet)
|
|
94
|
+
assert namespace["coding"] is not None
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@pytest.mark.parametrize("kind", ["point", "BND", "CNV"])
|
|
98
|
+
def test_documentation_experimental_result_access(kind):
|
|
99
|
+
genome = cached_release(81)
|
|
100
|
+
transcript = genome.transcript_by_id("ENST00000003084")
|
|
101
|
+
if kind == "point":
|
|
102
|
+
variant = Variant("7", 117531100, "T", "A", genome)
|
|
103
|
+
elif kind == "BND":
|
|
104
|
+
variant = StructuralVariant(
|
|
105
|
+
"7", transcript.start + 50, "BND", alt="N]22:15500000]",
|
|
106
|
+
mate_contig="22", mate_start=15500000, genome=genome)
|
|
107
|
+
else:
|
|
108
|
+
variant = StructuralVariant(
|
|
109
|
+
"7", transcript.start + 50, "CNV", end=transcript.start + 100,
|
|
110
|
+
genome=genome)
|
|
111
|
+
namespace = dict(varcode=varcode, variant=variant, transcript=transcript)
|
|
112
|
+
advanced_blocks = _blocks("docs/effect_annotation.md",
|
|
113
|
+
"## Advanced: annotators and implementation limits")
|
|
114
|
+
assert "comparison =" in advanced_blocks[0]
|
|
115
|
+
assert "candidate.outcomes" in advanced_blocks[1]
|
|
116
|
+
_run(advanced_blocks[:2], namespace)
|
|
117
|
+
_run(_blocks("docs/effect_annotation.md", "## Read an effect")[:1], namespace)
|
|
118
|
+
candidates = getattr(namespace["experimental"], "candidates", ())
|
|
119
|
+
if kind == "point":
|
|
120
|
+
assert candidates and all(isinstance(c, RealizedEffectCandidate)
|
|
121
|
+
for c in candidates)
|
|
122
|
+
assert namespace["protein"][158] == "M"
|
|
123
|
+
elif kind == "BND":
|
|
124
|
+
assert candidates and all(isinstance(c, EffectCandidate) for c in candidates)
|
|
125
|
+
else:
|
|
126
|
+
assert not candidates
|
|
127
|
+
assert isinstance(namespace["experimental"], varcode.Unresolved)
|
|
@@ -35,7 +35,7 @@ from .effect_helpers import exon_length
|
|
|
35
35
|
from ..mutant_transcript import MutantTranscript, ReferenceSegment
|
|
36
36
|
# Existing assembled-SV pickles use this private module path.
|
|
37
37
|
from ..mutant_transcript import _AssembledAllele # noqa: F401
|
|
38
|
-
from ..sv_allele_parser import breakend_sides
|
|
38
|
+
from ..sv_allele_parser import breakend_sides, _breakend_local_side
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
# --------------------------------------------------------------------
|
|
@@ -501,23 +501,29 @@ def _build_fusion_mutant_transcript(
|
|
|
501
501
|
|
|
502
502
|
|
|
503
503
|
def _build_translocation_mutant_transcript(variant, transcript):
|
|
504
|
-
"""
|
|
505
|
-
:class:`TranslocationToIntergenic`.
|
|
504
|
+
"""Describe only the retained local reference fragment of a BND.
|
|
506
505
|
|
|
507
|
-
|
|
508
|
-
breakpoint
|
|
509
|
-
|
|
510
|
-
with caller-supplied genomic intervals / long-read assemblies.
|
|
506
|
+
The other side and full mutant cDNA/protein remain unknown. Without
|
|
507
|
+
local orientation or a breakpoint on this transcript, no fragment can
|
|
508
|
+
be established. Supplied assemblies are handled by the caller.
|
|
511
509
|
"""
|
|
510
|
+
side = _breakend_local_side(variant.symbolic_alt)
|
|
511
|
+
if (side is None or str(variant.contig) != str(transcript.contig)
|
|
512
|
+
or not transcript.start <= variant.start <= transcript.end):
|
|
513
|
+
return None
|
|
514
|
+
keep_five_prime = _retains_five_prime_end(transcript, side)
|
|
515
|
+
cut = _cdna_cut(transcript, variant.start, keep_five_prime)
|
|
512
516
|
full_len = len(str(transcript.sequence))
|
|
517
|
+
start, end = (0, cut) if keep_five_prime else (cut, full_len)
|
|
513
518
|
segments = (
|
|
514
519
|
ReferenceSegment(
|
|
515
|
-
source=transcript, start=
|
|
516
|
-
|
|
520
|
+
source=transcript, start=start, end=end, strand="+",
|
|
521
|
+
label="translocation_5p" if keep_five_prime else "translocation_3p"),)
|
|
517
522
|
return MutantTranscript(
|
|
518
523
|
reference_transcript=transcript,
|
|
519
524
|
reference_segments=segments,
|
|
520
525
|
cdna_sequence=None,
|
|
526
|
+
evidence={"sequence_status": "retained_reference_fragment"},
|
|
521
527
|
annotator_name="structural_variant")
|
|
522
528
|
|
|
523
529
|
|
|
@@ -232,7 +232,10 @@ class MutantTranscript(DataclassSerializable):
|
|
|
232
232
|
strand segments), produce the mutant cDNA. ``None`` for the
|
|
233
233
|
point-variant shape; a fusion's segments would be
|
|
234
234
|
``(5p_partner_segment, 3p_partner_segment)``. Coordinates are
|
|
235
|
-
in each segment's own reference system.
|
|
235
|
+
in each segment's own reference system. A partial structural model may
|
|
236
|
+
describe only a retained reference fragment: its producer identifies this
|
|
237
|
+
in ``evidence`` and leaves the full ``cdna_sequence`` unknown. Concatenating
|
|
238
|
+
those partial segments does not establish a full allele."""
|
|
236
239
|
|
|
237
240
|
cdna_sequence: Optional[str] = None
|
|
238
241
|
"""The mutated spliced mRNA, when computed. ``None`` if the
|
|
@@ -78,6 +78,17 @@ def breakend_sides(alt):
|
|
|
78
78
|
return this_side, mate_side
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
def _breakend_local_side(alt):
|
|
82
|
+
"""The retained local side, including single breakends with no mate."""
|
|
83
|
+
sides = breakend_sides(alt)
|
|
84
|
+
if sides is not None:
|
|
85
|
+
return sides[0]
|
|
86
|
+
single = _SINGLE_BREAKEND_RE.match(alt or "")
|
|
87
|
+
if single is not None:
|
|
88
|
+
return "right" if single.group("joined_before") else "left"
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
|
|
81
92
|
def _extract_info(info, key):
|
|
82
93
|
"""Pull an INFO field value, handling list-of-ints from CIPOS /
|
|
83
94
|
CIEND and plain ints/strings otherwise. Returns ``None`` if
|
|
@@ -464,7 +464,7 @@ class Variant(Serializable):
|
|
|
464
464
|
:func:`varcode.use_annotator`). String names are resolved
|
|
465
465
|
against the registry. See openvax/varcode#271.
|
|
466
466
|
|
|
467
|
-
phase_resolver :
|
|
467
|
+
phase_resolver : resolver object or None
|
|
468
468
|
Optional phase-evidence source (typically a
|
|
469
469
|
:class:`~varcode.phasing.MolecularPhaseResolver` wrapping an
|
|
470
470
|
upstream RNA-phasing tool, or
|
|
@@ -140,7 +140,7 @@ class VariantCollection(Collection):
|
|
|
140
140
|
the collection. See :meth:`Variant.effects` and
|
|
141
141
|
openvax/varcode#271.
|
|
142
142
|
|
|
143
|
-
phase_resolver :
|
|
143
|
+
phase_resolver : resolver object or None
|
|
144
144
|
Optional phase-evidence source (e.g. a
|
|
145
145
|
:class:`~varcode.phasing.MolecularPhaseResolver` wrapping an
|
|
146
146
|
upstream RNA-phasing tool, or
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "9.2.5"
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: varcode
|
|
3
|
+
Version: 9.2.5
|
|
4
|
+
Summary: Variant annotation in Python
|
|
5
|
+
Author-email: Alex Rubinsteyn <alex.rubinsteyn@unc.edu>
|
|
6
|
+
Project-URL: Homepage, https://github.com/openvax/varcode
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/openvax/varcode/issues
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: numpy<3.0.0,>=2.0.0
|
|
19
|
+
Requires-Dist: pandas<3.0.0,>=2.0.0
|
|
20
|
+
Requires-Dist: pyensembl>=2.6.4
|
|
21
|
+
Requires-Dist: memoized_property>=1.0.2
|
|
22
|
+
Requires-Dist: serializable>=1.1.0
|
|
23
|
+
Requires-Dist: sercol>=0.1.4
|
|
24
|
+
Provides-Extra: rna
|
|
25
|
+
Requires-Dist: pysam>=0.21; extra == "rna"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
29
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
30
|
+
[](https://pypi.python.org/pypi/varcode/)
|
|
31
|
+
[](https://pypistats.org/packages/varcode)
|
|
32
|
+
|
|
33
|
+
# Varcode
|
|
34
|
+
|
|
35
|
+
Varcode helps you work with genomic variants in Python and predict their effects
|
|
36
|
+
on genes, transcripts, and protein sequences.
|
|
37
|
+
|
|
38
|
+
Load variants from VCF or MAF files, annotate them, and inspect the results.
|
|
39
|
+
The same interface handles small variants and structural variants; optional
|
|
40
|
+
germline, phasing, and RNA evidence can refine predictions.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Requires Python 3.9 or later:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install varcode
|
|
48
|
+
pyensembl install --release 81 --species human
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The second command downloads the annotation and transcript sequences for the
|
|
52
|
+
GRCh38 example below. Release 81 is pinned for reproducibility, not a requirement
|
|
53
|
+
to use that release for your own data. Choose an annotation matching your
|
|
54
|
+
input's genome build; see [reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
55
|
+
|
|
56
|
+
<a id="example"></a>
|
|
57
|
+
|
|
58
|
+
## Quick start
|
|
59
|
+
|
|
60
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from varcode import Variant
|
|
64
|
+
|
|
65
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
66
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
67
|
+
effect = variant.effect_on_transcript(transcript)
|
|
68
|
+
|
|
69
|
+
print(effect.short_description) # p.L159M
|
|
70
|
+
protein = effect.mutant_protein_sequence
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For a VCF called against the same genome build:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from varcode import load_vcf
|
|
77
|
+
|
|
78
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
79
|
+
effects = variants.effects()
|
|
80
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
81
|
+
print(variant.short_description, effect.short_description)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A variant can affect several transcripts. Priority is a summary of predicted
|
|
85
|
+
consequence, not proof of expression or pathogenicity. A protein sequence may be
|
|
86
|
+
unavailable for unresolved effects.
|
|
87
|
+
|
|
88
|
+
<a id="further-reading"></a>
|
|
89
|
+
|
|
90
|
+
## Learn more
|
|
91
|
+
|
|
92
|
+
Start with the [getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
93
|
+
for file loading, result access, and saving a table. Then follow the
|
|
94
|
+
[task guides](https://openvax.github.io/varcode/#find-your-next-task) for sample
|
|
95
|
+
filtering, structural variants, phasing, and RNA evidence.
|
|
96
|
+
|
|
97
|
+
<a id="effect-types"></a>
|
|
98
|
+
<a id="coordinate-system"></a>
|
|
99
|
+
|
|
100
|
+
Detailed [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
101
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
102
|
+
and the [API reference](https://openvax.github.io/varcode/api/) live in the docs.
|
|
103
|
+
|
|
104
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
105
|
+
Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and the
|
|
106
|
+
[changelog](CHANGELOG.md).
|
|
@@ -6,6 +6,7 @@ requirements.txt
|
|
|
6
6
|
tests/test_annotator_divergence_scenarios.py
|
|
7
7
|
tests/test_annotator_parity_adversarial.py
|
|
8
8
|
tests/test_annotators.py
|
|
9
|
+
tests/test_bnd_retained_segments.py
|
|
9
10
|
tests/test_cli_effects.py
|
|
10
11
|
tests/test_cli_genes.py
|
|
11
12
|
tests/test_cli_without_pkg_resources.py
|
|
@@ -17,6 +18,7 @@ tests/test_cryptic_exons.py
|
|
|
17
18
|
tests/test_csv_roundtrip.py
|
|
18
19
|
tests/test_dbnsfp_validation.py
|
|
19
20
|
tests/test_default_structural_helpers.py
|
|
21
|
+
tests/test_documentation_examples.py
|
|
20
22
|
tests/test_effect_annotation_errors.py
|
|
21
23
|
tests/test_effect_candidates.py
|
|
22
24
|
tests/test_effect_classes.py
|