varcode 10.2.0__tar.gz → 10.2.1__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-10.2.1/PKG-INFO +150 -0
- varcode-10.2.1/README.md +121 -0
- varcode-10.2.1/tests/__init__.py +13 -0
- varcode-10.2.1/tests/benchmark_vcf_load.py +73 -0
- varcode-10.2.1/tests/common.py +91 -0
- varcode-10.2.1/tests/data.py +67 -0
- varcode-10.2.1/varcode/version.py +1 -0
- varcode-10.2.1/varcode.egg-info/PKG-INFO +150 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode.egg-info/SOURCES.txt +4 -0
- varcode-10.2.0/PKG-INFO +0 -114
- varcode-10.2.0/README.md +0 -85
- varcode-10.2.0/varcode/version.py +0 -1
- varcode-10.2.0/varcode.egg-info/PKG-INFO +0 -114
- {varcode-10.2.0 → varcode-10.2.1}/LICENSE +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/MANIFEST.in +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/pyproject.toml +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/requirements.txt +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/setup.cfg +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_annotator_divergence_scenarios.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_annotator_haplotypes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_annotator_parity_adversarial.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_annotators.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_bnd_retained_segments.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cli_effects.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cli_genes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cli_records.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cli_without_pkg_resources.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_collection_filtering.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_collection_variants_attr_consistency.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_common.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cosmic_mutations.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_cryptic_exons.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_csv_roundtrip.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_dbnsfp_validation.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_default_structural_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_documentation_examples.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_annotation_errors.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_candidates.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_classes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_collection.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_collection_serialization.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_collection_sort_order.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effect_hypotheses.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_effects_from_mutagenix_variants.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_exacto_fusions.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_exonic_splice_site.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_fast_path.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_frameshift_cterminus_regression.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_frameshift_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_fusion_insertions.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_fusion_partner_candidates.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_genome_contig_validation.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_genome_sequence.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_genomic_layout.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_genotype.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_genotype_from_vcf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_germline_context.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_germline_effects.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_germline_overlap.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_haplotype_effect.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_local_sv_insertions.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_maf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_mitochondrial.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_mm10_klf6_frameshift.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_mouse.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_mutant_transcript.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_mutate.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_no_duplicate_variants.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_nonlocal_layout.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_nonlocal_sv_transcripts.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_osteosarc_dataset.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_osteosarc_fusions.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_osteosarc_variants.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_partial_annotators.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_premature_stop_short_description.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_problematic_variants.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_protein_diff_parity.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_read_phase_resolver.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_real_world_callers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_reference.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_reference_mismatch_error.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_reference_segments.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_rna_evidence.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_rna_haplotype_sequences.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_rna_read_phasing_source.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sample_identity.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_selenocysteine.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_selenocysteine_proteins.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_silent_aa_pos.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_silent_hgvs_description.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_splice_graph.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_splice_outcomes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_splice_site_effects.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_stop_codon_classification_bugs.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_string_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_structural_serialization.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_structural_variant_annotator.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_structural_variants.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sv_comparison.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sv_consequences.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sv_selenocysteine.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sv_sequence_changes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_sv_tabular_metadata.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_symbolic_alleles.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_symbolic_sv_padding.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_test_script.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_timings.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_transcript_layout.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_transcript_model.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_transcript_model_start_codons.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_transforms_left_align.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_transforms_pair_breakends.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_variant.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_variant_collection.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_export_integrity.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_limits.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_output.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_parsing.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_phase_resolver.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/tests/test_vcf_spec_examples.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/__init__.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/_sample_vcf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/annotators/__init__.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/annotators/fast.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/annotators/protein_diff.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/annotators/registry.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/__init__.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/effects_script.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/genes_script.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/logging.conf +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/main.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/sample_checks.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/variant_args.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cli/version_info.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/common.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/cryptic_exons.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/csv_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effect_candidates.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effect_hypotheses.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/__init__.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/classify.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/codon_tables.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/common.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_classes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_collection.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_ordering.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_prediction.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_prediction_coding.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_prediction_coding_frameshift.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/effect_prediction_coding_in_frame.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/fast_path.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/mutate.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/selenocysteine.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/sequence_change.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/structural.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/structural_serialization.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/transcript_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/effects/translate.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/errors.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/exacto.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/genome.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/genome_sequence.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/genomic_layout.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/genotype.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/germline.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/maf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/mutant_transcript.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/nucleotides.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/phasing.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/realized_effects.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/reference.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/rna_evidence.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/rna_read_phasing.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/sample_identity.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/splice_graph.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/splice_outcomes.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/string_helpers.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/structural_variant.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/sv_allele_parser.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/sv_comparison.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/transcript_layout.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/transcript_model.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/transforms/__init__.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/ucsc_reference_names.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/util.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/variant.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/variant_collection.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/vcf.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/vcf_output.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode/vcf_parsing.py +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode.egg-info/dependency_links.txt +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode.egg-info/entry_points.txt +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode.egg-info/requires.txt +0 -0
- {varcode-10.2.0 → varcode-10.2.1}/varcode.egg-info/top_level.txt +0 -0
varcode-10.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: varcode
|
|
3
|
+
Version: 10.2.1
|
|
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
|
+
Provides-Extra: test-data
|
|
27
|
+
Requires-Dist: osteosarc==0.2.3; extra == "test-data"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
31
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
32
|
+
[](https://pypi.org/project/varcode/)
|
|
33
|
+
[](https://pypistats.org/packages/varcode)
|
|
34
|
+
|
|
35
|
+
# Varcode
|
|
36
|
+
|
|
37
|
+
Varcode is a Python library that predicts what genomic variants do to genes,
|
|
38
|
+
transcripts, and proteins. Load a VCF or MAF file, and for each variant on each
|
|
39
|
+
overlapping transcript, Varcode reports the predicted consequence (for example
|
|
40
|
+
a substitution such as `p.L159M`, a frameshift, or a gene fusion). Where the
|
|
41
|
+
sequence can be determined, it also gives the mutant protein.
|
|
42
|
+
|
|
43
|
+
## What it does
|
|
44
|
+
|
|
45
|
+
- **Small variants:** SNVs, indels, and multi-base substitutions are classified
|
|
46
|
+
as coding changes (substitution, frameshift, premature stop, and others) or
|
|
47
|
+
by where they fall (UTR, intron, splice site, intergenic).
|
|
48
|
+
- **Splice variants:** returns the possible outcomes, such as exon skipping,
|
|
49
|
+
intron retention, or a cryptic splice site, each with its own predicted
|
|
50
|
+
protein when it can be determined.
|
|
51
|
+
- **Structural variants:** deletions, duplications, inversions, and breakends
|
|
52
|
+
get transcript consequences and gene-fusion candidates.
|
|
53
|
+
- **Patient context (optional):** germline variants, phase from a phased VCF
|
|
54
|
+
or RNA reads, and observed RNA structures refine predictions.
|
|
55
|
+
- **Sample checks:** screens a cohort for possible sample mix-ups using donor
|
|
56
|
+
genotypes and shared somatic mutations.
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
Requires Python 3.9 or later:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install varcode
|
|
64
|
+
pyensembl install --release 81 --species human
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The second command downloads the gene annotation and transcript sequences used
|
|
68
|
+
in the example below (Ensembl 81, GRCh38). For your own data, choose an
|
|
69
|
+
annotation that matches your input's genome build; see
|
|
70
|
+
[reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
71
|
+
|
|
72
|
+
<a id="example"></a>
|
|
73
|
+
|
|
74
|
+
## Quick start
|
|
75
|
+
|
|
76
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from varcode import Variant
|
|
80
|
+
|
|
81
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
82
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
83
|
+
effect = variant.effect_on_transcript(transcript)
|
|
84
|
+
|
|
85
|
+
print(effect.short_description) # p.L159M
|
|
86
|
+
protein = effect.mutant_protein_sequence
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Annotate every variant in a VCF called against the same genome build, and
|
|
90
|
+
print the most severe effect for each:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from varcode import load_vcf
|
|
94
|
+
|
|
95
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
96
|
+
effects = variants.effects()
|
|
97
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
98
|
+
print(variant.short_description, effect.short_description)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or from the command line:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
varcode --genome GRCh38 --vcf variants.vcf --output-csv effects.csv
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
<a id="reading-results"></a>
|
|
108
|
+
|
|
109
|
+
## Reading the results
|
|
110
|
+
|
|
111
|
+
- **One variant, many transcripts.** Each prediction belongs to one
|
|
112
|
+
transcript, and a variant's effect can differ between transcripts.
|
|
113
|
+
`top_priority_effect_per_variant()` picks one per variant for a summary.
|
|
114
|
+
- **"Top priority" means most severe, not most likely.** The ranking is
|
|
115
|
+
Varcode's ordering of consequence severity. It is not a probability, a
|
|
116
|
+
pathogenicity score, or a clinical classification.
|
|
117
|
+
- **Some effects have several possible outcomes.** Splice variants,
|
|
118
|
+
structural variants, and variants with unknown phase keep all their
|
|
119
|
+
candidate outcomes rather than guessing one.
|
|
120
|
+
- **`None` means unknown, not unchanged.** A missing protein sequence means
|
|
121
|
+
Varcode could not determine it.
|
|
122
|
+
- **Predictions are not observations.** A predicted protein doesn't show that
|
|
123
|
+
the transcript or protein is expressed.
|
|
124
|
+
|
|
125
|
+
<a id="further-reading"></a>
|
|
126
|
+
|
|
127
|
+
## Learn more
|
|
128
|
+
|
|
129
|
+
The [documentation](https://openvax.github.io/varcode/) starts with a
|
|
130
|
+
[getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
131
|
+
and then covers sample filtering, splice and structural variants, germline
|
|
132
|
+
and phasing, RNA evidence, and saving results.
|
|
133
|
+
|
|
134
|
+
<a id="effect-types"></a>
|
|
135
|
+
<a id="coordinate-system"></a>
|
|
136
|
+
|
|
137
|
+
Reference pages cover [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
138
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
139
|
+
and the [API](https://openvax.github.io/varcode/api/).
|
|
140
|
+
|
|
141
|
+
Varcode is part of the [OpenVax](https://github.com/openvax) tools.
|
|
142
|
+
[Isovar](https://github.com/openvax/isovar) reconstructs variant sequences from
|
|
143
|
+
RNA reads, and [Vaxrank](https://github.com/openvax/vaxrank) evaluates the resulting
|
|
144
|
+
protein/peptide candidates; see
|
|
145
|
+
[how the libraries fit together](https://openvax.github.io/varcode/library_roles/).
|
|
146
|
+
|
|
147
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
148
|
+
Contributions are welcome; see
|
|
149
|
+
[CONTRIBUTING.md](https://github.com/openvax/varcode/blob/main/CONTRIBUTING.md)
|
|
150
|
+
and the [changelog](https://github.com/openvax/varcode/blob/main/CHANGELOG.md).
|
varcode-10.2.1/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
2
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
3
|
+
[](https://pypi.org/project/varcode/)
|
|
4
|
+
[](https://pypistats.org/packages/varcode)
|
|
5
|
+
|
|
6
|
+
# Varcode
|
|
7
|
+
|
|
8
|
+
Varcode is a Python library that predicts what genomic variants do to genes,
|
|
9
|
+
transcripts, and proteins. Load a VCF or MAF file, and for each variant on each
|
|
10
|
+
overlapping transcript, Varcode reports the predicted consequence (for example
|
|
11
|
+
a substitution such as `p.L159M`, a frameshift, or a gene fusion). Where the
|
|
12
|
+
sequence can be determined, it also gives the mutant protein.
|
|
13
|
+
|
|
14
|
+
## What it does
|
|
15
|
+
|
|
16
|
+
- **Small variants:** SNVs, indels, and multi-base substitutions are classified
|
|
17
|
+
as coding changes (substitution, frameshift, premature stop, and others) or
|
|
18
|
+
by where they fall (UTR, intron, splice site, intergenic).
|
|
19
|
+
- **Splice variants:** returns the possible outcomes, such as exon skipping,
|
|
20
|
+
intron retention, or a cryptic splice site, each with its own predicted
|
|
21
|
+
protein when it can be determined.
|
|
22
|
+
- **Structural variants:** deletions, duplications, inversions, and breakends
|
|
23
|
+
get transcript consequences and gene-fusion candidates.
|
|
24
|
+
- **Patient context (optional):** germline variants, phase from a phased VCF
|
|
25
|
+
or RNA reads, and observed RNA structures refine predictions.
|
|
26
|
+
- **Sample checks:** screens a cohort for possible sample mix-ups using donor
|
|
27
|
+
genotypes and shared somatic mutations.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Requires Python 3.9 or later:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install varcode
|
|
35
|
+
pyensembl install --release 81 --species human
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The second command downloads the gene annotation and transcript sequences used
|
|
39
|
+
in the example below (Ensembl 81, GRCh38). For your own data, choose an
|
|
40
|
+
annotation that matches your input's genome build; see
|
|
41
|
+
[reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
42
|
+
|
|
43
|
+
<a id="example"></a>
|
|
44
|
+
|
|
45
|
+
## Quick start
|
|
46
|
+
|
|
47
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from varcode import Variant
|
|
51
|
+
|
|
52
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
53
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
54
|
+
effect = variant.effect_on_transcript(transcript)
|
|
55
|
+
|
|
56
|
+
print(effect.short_description) # p.L159M
|
|
57
|
+
protein = effect.mutant_protein_sequence
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Annotate every variant in a VCF called against the same genome build, and
|
|
61
|
+
print the most severe effect for each:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from varcode import load_vcf
|
|
65
|
+
|
|
66
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
67
|
+
effects = variants.effects()
|
|
68
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
69
|
+
print(variant.short_description, effect.short_description)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or from the command line:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
varcode --genome GRCh38 --vcf variants.vcf --output-csv effects.csv
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<a id="reading-results"></a>
|
|
79
|
+
|
|
80
|
+
## Reading the results
|
|
81
|
+
|
|
82
|
+
- **One variant, many transcripts.** Each prediction belongs to one
|
|
83
|
+
transcript, and a variant's effect can differ between transcripts.
|
|
84
|
+
`top_priority_effect_per_variant()` picks one per variant for a summary.
|
|
85
|
+
- **"Top priority" means most severe, not most likely.** The ranking is
|
|
86
|
+
Varcode's ordering of consequence severity. It is not a probability, a
|
|
87
|
+
pathogenicity score, or a clinical classification.
|
|
88
|
+
- **Some effects have several possible outcomes.** Splice variants,
|
|
89
|
+
structural variants, and variants with unknown phase keep all their
|
|
90
|
+
candidate outcomes rather than guessing one.
|
|
91
|
+
- **`None` means unknown, not unchanged.** A missing protein sequence means
|
|
92
|
+
Varcode could not determine it.
|
|
93
|
+
- **Predictions are not observations.** A predicted protein doesn't show that
|
|
94
|
+
the transcript or protein is expressed.
|
|
95
|
+
|
|
96
|
+
<a id="further-reading"></a>
|
|
97
|
+
|
|
98
|
+
## Learn more
|
|
99
|
+
|
|
100
|
+
The [documentation](https://openvax.github.io/varcode/) starts with a
|
|
101
|
+
[getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
102
|
+
and then covers sample filtering, splice and structural variants, germline
|
|
103
|
+
and phasing, RNA evidence, and saving results.
|
|
104
|
+
|
|
105
|
+
<a id="effect-types"></a>
|
|
106
|
+
<a id="coordinate-system"></a>
|
|
107
|
+
|
|
108
|
+
Reference pages cover [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
109
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
110
|
+
and the [API](https://openvax.github.io/varcode/api/).
|
|
111
|
+
|
|
112
|
+
Varcode is part of the [OpenVax](https://github.com/openvax) tools.
|
|
113
|
+
[Isovar](https://github.com/openvax/isovar) reconstructs variant sequences from
|
|
114
|
+
RNA reads, and [Vaxrank](https://github.com/openvax/vaxrank) evaluates the resulting
|
|
115
|
+
protein/peptide candidates; see
|
|
116
|
+
[how the libraries fit together](https://openvax.github.io/varcode/library_roles/).
|
|
117
|
+
|
|
118
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
119
|
+
Contributions are welcome; see
|
|
120
|
+
[CONTRIBUTING.md](https://github.com/openvax/varcode/blob/main/CONTRIBUTING.md)
|
|
121
|
+
and the [changelog](https://github.com/openvax/varcode/blob/main/CHANGELOG.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
from __future__ import print_function, division, absolute_import
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
Time how long it takes to open a VCF.
|
|
15
|
+
|
|
16
|
+
Run as:
|
|
17
|
+
python -m profile -s cumtime %(prog)s
|
|
18
|
+
|
|
19
|
+
to get profiling output.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
import argparse
|
|
23
|
+
import time
|
|
24
|
+
|
|
25
|
+
import varcode
|
|
26
|
+
|
|
27
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
28
|
+
|
|
29
|
+
parser.add_argument(
|
|
30
|
+
"path", help="Path or URL to VCF")
|
|
31
|
+
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"--profile", action="store_true",
|
|
34
|
+
default=False,
|
|
35
|
+
help="Run in a profiler.")
|
|
36
|
+
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--no-info-field",
|
|
39
|
+
dest="info_field",
|
|
40
|
+
action="store_false",
|
|
41
|
+
default=True)
|
|
42
|
+
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
"--pyvcf",
|
|
45
|
+
help="use pyvcf implementation",
|
|
46
|
+
action="store_true",
|
|
47
|
+
default=False)
|
|
48
|
+
|
|
49
|
+
def run():
|
|
50
|
+
args = parser.parse_args()
|
|
51
|
+
|
|
52
|
+
extra_args = {}
|
|
53
|
+
if not args.info_field:
|
|
54
|
+
extra_args["include_info"] = False
|
|
55
|
+
|
|
56
|
+
start = time.time()
|
|
57
|
+
|
|
58
|
+
if args.pyvcf:
|
|
59
|
+
result = varcode.load_vcf(
|
|
60
|
+
args.path,
|
|
61
|
+
allow_extended_nucleotides=True)
|
|
62
|
+
else:
|
|
63
|
+
result = varcode.load_vcf_fast(
|
|
64
|
+
args.path,
|
|
65
|
+
allow_extended_nucleotides=True,
|
|
66
|
+
**extra_args)
|
|
67
|
+
|
|
68
|
+
print("Loaded %d variants in %0.3f sec. " % (
|
|
69
|
+
len(result), time.time() - start))
|
|
70
|
+
print(result.to_string(limit=5))
|
|
71
|
+
|
|
72
|
+
if __name__ == '__main__':
|
|
73
|
+
run()
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
expected_effect_properties = [
|
|
15
|
+
'gene',
|
|
16
|
+
'gene_name',
|
|
17
|
+
'gene_id',
|
|
18
|
+
'transcript',
|
|
19
|
+
'transcript_name',
|
|
20
|
+
'transcript_id',
|
|
21
|
+
'modifies_coding_sequence',
|
|
22
|
+
'modifies_protein_sequence',
|
|
23
|
+
'aa_mutation_start_offset',
|
|
24
|
+
'aa_mutation_end_offset',
|
|
25
|
+
'mutant_protein_sequence',
|
|
26
|
+
'short_description'
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
def check_effect_properties(effect):
|
|
30
|
+
assert effect is not None
|
|
31
|
+
# try accessing all the properties to make sure none crash
|
|
32
|
+
for attribute_name in expected_effect_properties:
|
|
33
|
+
getattr(effect, attribute_name)
|
|
34
|
+
assert len(str(effect)) > 0
|
|
35
|
+
assert len(repr(effect)) > 0
|
|
36
|
+
assert effect.short_description is not None, \
|
|
37
|
+
"Expected effect %s to have a `short_description` property" % (effect,)
|
|
38
|
+
assert len(effect.short_description) > 0
|
|
39
|
+
assert effect.__class__.__name__ in str(effect), \
|
|
40
|
+
"Expected string representation of %s to include effect name %s" % (
|
|
41
|
+
effect, effect.__class__.__name__)
|
|
42
|
+
|
|
43
|
+
def expect_effect(
|
|
44
|
+
variant,
|
|
45
|
+
transcript_id=None,
|
|
46
|
+
effect_class=None,
|
|
47
|
+
protein_sequence=None,
|
|
48
|
+
**kwargs):
|
|
49
|
+
if transcript_id is None:
|
|
50
|
+
effects = variant.effects()
|
|
51
|
+
effect = effects.top_priority_effect()
|
|
52
|
+
else:
|
|
53
|
+
transcript = variant.ensembl.transcript_by_id(transcript_id)
|
|
54
|
+
effect = variant.effect_on_transcript(transcript)
|
|
55
|
+
check_effect_properties(effect)
|
|
56
|
+
if effect_class is not None:
|
|
57
|
+
# Splice-disrupting effects are always wrapped in a
|
|
58
|
+
# SpliceOutcomeSet (varcode 6.0+); when the caller asks for a
|
|
59
|
+
# splice-signal class (ExonicSpliceSite, SpliceDonor, ...),
|
|
60
|
+
# match against the wrapper's `disrupted_signal_class`.
|
|
61
|
+
from varcode import SpliceOutcomeSet
|
|
62
|
+
actual_class = effect.__class__
|
|
63
|
+
matches = (
|
|
64
|
+
actual_class is effect_class
|
|
65
|
+
or (actual_class is SpliceOutcomeSet
|
|
66
|
+
and getattr(effect, "disrupted_signal_class", None)
|
|
67
|
+
is effect_class))
|
|
68
|
+
assert matches, \
|
|
69
|
+
"Expected effect class %s but got %s" % (
|
|
70
|
+
effect_class.__name__,
|
|
71
|
+
actual_class.__name__)
|
|
72
|
+
if protein_sequence is not None:
|
|
73
|
+
assert effect.mutant_protein_sequence == protein_sequence, \
|
|
74
|
+
"Expected protein sequence %s but got %s" % (
|
|
75
|
+
protein_sequence,
|
|
76
|
+
effect.mutant_protein_sequence)
|
|
77
|
+
for field, expected_value in kwargs.items():
|
|
78
|
+
actual_value = getattr(effect, field)
|
|
79
|
+
if isinstance(expected_value, int):
|
|
80
|
+
format_string = "Expected %s=%d but got %s"
|
|
81
|
+
elif isinstance(expected_value, float):
|
|
82
|
+
format_string = "Expected %s=%f but got %s"
|
|
83
|
+
else:
|
|
84
|
+
format_string = "Expected %s='%s' but got '%s'"
|
|
85
|
+
assert actual_value == expected_value, format_string % (field, expected_value, actual_value)
|
|
86
|
+
|
|
87
|
+
def eq_(x, y, s=None):
|
|
88
|
+
if s is None:
|
|
89
|
+
assert x == y, "%s != %s" % (x, y)
|
|
90
|
+
else:
|
|
91
|
+
assert x == y, s
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
Helper functions and shared datasets for tests
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import os
|
|
18
|
+
from pyensembl import cached_release
|
|
19
|
+
from varcode import Variant, VariantCollection, load_maf
|
|
20
|
+
import pandas as pd
|
|
21
|
+
|
|
22
|
+
# Pin shared fixtures to the suite's standard GRCh38 release (81) rather than
|
|
23
|
+
# letting Variant default to "GRCh38", which resolves to pyensembl's LATEST
|
|
24
|
+
# release (e.g. 115). That default is not installed in CI (the
|
|
25
|
+
# openvax/ensembl-data mirror tops out at GRCh38.95), so any test that
|
|
26
|
+
# annotates these snps -- including test_collection_filtering, which calls
|
|
27
|
+
# .effects() at import -- would flake on "GTF database needs to be created".
|
|
28
|
+
# Release 81 is what the downstream transcript-id assertions were written
|
|
29
|
+
# against.
|
|
30
|
+
ENSEMBL_GRCH38 = cached_release(81)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def data_path(name):
|
|
34
|
+
"""
|
|
35
|
+
Return the absolute path to a file in the varcode/test/data directory.
|
|
36
|
+
The name specified should be relative to varcode/test/data.
|
|
37
|
+
"""
|
|
38
|
+
return os.path.join(os.path.dirname(__file__), "data", name)
|
|
39
|
+
|
|
40
|
+
dbnsp_validation_df = pd.read_csv(data_path('dbnsfp_validation_set.csv'))
|
|
41
|
+
tcga_ov_variants = load_maf(data_path("tcga_ov.head.maf"))
|
|
42
|
+
ov_wustle_variants = load_maf(data_path("ov.wustle.subset5.maf"))
|
|
43
|
+
|
|
44
|
+
snp_rs4244285 = Variant(
|
|
45
|
+
contig=10,
|
|
46
|
+
start=94781859,
|
|
47
|
+
ref="G",
|
|
48
|
+
alt="A",
|
|
49
|
+
ensembl=ENSEMBL_GRCH38)
|
|
50
|
+
snp_rs1537415 = Variant(
|
|
51
|
+
contig=9,
|
|
52
|
+
start=135637876,
|
|
53
|
+
ref="C",
|
|
54
|
+
alt="G",
|
|
55
|
+
ensembl=ENSEMBL_GRCH38)
|
|
56
|
+
snp_rs3892097 = Variant(
|
|
57
|
+
contig=22,
|
|
58
|
+
start=42524947,
|
|
59
|
+
ref="G",
|
|
60
|
+
alt="A",
|
|
61
|
+
ensembl=ENSEMBL_GRCH38)
|
|
62
|
+
|
|
63
|
+
db_snp_variants = VariantCollection([
|
|
64
|
+
snp_rs4244285,
|
|
65
|
+
snp_rs1537415,
|
|
66
|
+
snp_rs3892097,
|
|
67
|
+
])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "10.2.1"
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: varcode
|
|
3
|
+
Version: 10.2.1
|
|
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
|
+
Provides-Extra: test-data
|
|
27
|
+
Requires-Dist: osteosarc==0.2.3; extra == "test-data"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
[](https://github.com/openvax/varcode/actions/workflows/tests.yml)
|
|
31
|
+
[](https://coveralls.io/github/openvax/varcode?branch=main)
|
|
32
|
+
[](https://pypi.org/project/varcode/)
|
|
33
|
+
[](https://pypistats.org/packages/varcode)
|
|
34
|
+
|
|
35
|
+
# Varcode
|
|
36
|
+
|
|
37
|
+
Varcode is a Python library that predicts what genomic variants do to genes,
|
|
38
|
+
transcripts, and proteins. Load a VCF or MAF file, and for each variant on each
|
|
39
|
+
overlapping transcript, Varcode reports the predicted consequence (for example
|
|
40
|
+
a substitution such as `p.L159M`, a frameshift, or a gene fusion). Where the
|
|
41
|
+
sequence can be determined, it also gives the mutant protein.
|
|
42
|
+
|
|
43
|
+
## What it does
|
|
44
|
+
|
|
45
|
+
- **Small variants:** SNVs, indels, and multi-base substitutions are classified
|
|
46
|
+
as coding changes (substitution, frameshift, premature stop, and others) or
|
|
47
|
+
by where they fall (UTR, intron, splice site, intergenic).
|
|
48
|
+
- **Splice variants:** returns the possible outcomes, such as exon skipping,
|
|
49
|
+
intron retention, or a cryptic splice site, each with its own predicted
|
|
50
|
+
protein when it can be determined.
|
|
51
|
+
- **Structural variants:** deletions, duplications, inversions, and breakends
|
|
52
|
+
get transcript consequences and gene-fusion candidates.
|
|
53
|
+
- **Patient context (optional):** germline variants, phase from a phased VCF
|
|
54
|
+
or RNA reads, and observed RNA structures refine predictions.
|
|
55
|
+
- **Sample checks:** screens a cohort for possible sample mix-ups using donor
|
|
56
|
+
genotypes and shared somatic mutations.
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
Requires Python 3.9 or later:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install varcode
|
|
64
|
+
pyensembl install --release 81 --species human
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The second command downloads the gene annotation and transcript sequences used
|
|
68
|
+
in the example below (Ensembl 81, GRCh38). For your own data, choose an
|
|
69
|
+
annotation that matches your input's genome build; see
|
|
70
|
+
[reference setup](https://openvax.github.io/varcode/getting_started/#reference-data).
|
|
71
|
+
|
|
72
|
+
<a id="example"></a>
|
|
73
|
+
|
|
74
|
+
## Quick start
|
|
75
|
+
|
|
76
|
+
Predict the effect of a single GRCh38 variant on a CFTR transcript:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from varcode import Variant
|
|
80
|
+
|
|
81
|
+
variant = Variant("7", 117_531_100, "T", "A", genome=81)
|
|
82
|
+
transcript = variant.genome.transcript_by_id("ENST00000003084")
|
|
83
|
+
effect = variant.effect_on_transcript(transcript)
|
|
84
|
+
|
|
85
|
+
print(effect.short_description) # p.L159M
|
|
86
|
+
protein = effect.mutant_protein_sequence
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Annotate every variant in a VCF called against the same genome build, and
|
|
90
|
+
print the most severe effect for each:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from varcode import load_vcf
|
|
94
|
+
|
|
95
|
+
variants = load_vcf("variants.vcf", genome=81)
|
|
96
|
+
effects = variants.effects()
|
|
97
|
+
for variant, effect in effects.top_priority_effect_per_variant().items():
|
|
98
|
+
print(variant.short_description, effect.short_description)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or from the command line:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
varcode --genome GRCh38 --vcf variants.vcf --output-csv effects.csv
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
<a id="reading-results"></a>
|
|
108
|
+
|
|
109
|
+
## Reading the results
|
|
110
|
+
|
|
111
|
+
- **One variant, many transcripts.** Each prediction belongs to one
|
|
112
|
+
transcript, and a variant's effect can differ between transcripts.
|
|
113
|
+
`top_priority_effect_per_variant()` picks one per variant for a summary.
|
|
114
|
+
- **"Top priority" means most severe, not most likely.** The ranking is
|
|
115
|
+
Varcode's ordering of consequence severity. It is not a probability, a
|
|
116
|
+
pathogenicity score, or a clinical classification.
|
|
117
|
+
- **Some effects have several possible outcomes.** Splice variants,
|
|
118
|
+
structural variants, and variants with unknown phase keep all their
|
|
119
|
+
candidate outcomes rather than guessing one.
|
|
120
|
+
- **`None` means unknown, not unchanged.** A missing protein sequence means
|
|
121
|
+
Varcode could not determine it.
|
|
122
|
+
- **Predictions are not observations.** A predicted protein doesn't show that
|
|
123
|
+
the transcript or protein is expressed.
|
|
124
|
+
|
|
125
|
+
<a id="further-reading"></a>
|
|
126
|
+
|
|
127
|
+
## Learn more
|
|
128
|
+
|
|
129
|
+
The [documentation](https://openvax.github.io/varcode/) starts with a
|
|
130
|
+
[getting-started guide](https://openvax.github.io/varcode/getting_started/)
|
|
131
|
+
and then covers sample filtering, splice and structural variants, germline
|
|
132
|
+
and phasing, RNA evidence, and saving results.
|
|
133
|
+
|
|
134
|
+
<a id="effect-types"></a>
|
|
135
|
+
<a id="coordinate-system"></a>
|
|
136
|
+
|
|
137
|
+
Reference pages cover [effect types](https://openvax.github.io/varcode/effect_types/),
|
|
138
|
+
[coordinate conventions](https://openvax.github.io/varcode/getting_started/#coordinate-conventions),
|
|
139
|
+
and the [API](https://openvax.github.io/varcode/api/).
|
|
140
|
+
|
|
141
|
+
Varcode is part of the [OpenVax](https://github.com/openvax) tools.
|
|
142
|
+
[Isovar](https://github.com/openvax/isovar) reconstructs variant sequences from
|
|
143
|
+
RNA reads, and [Vaxrank](https://github.com/openvax/vaxrank) evaluates the resulting
|
|
144
|
+
protein/peptide candidates; see
|
|
145
|
+
[how the libraries fit together](https://openvax.github.io/varcode/library_roles/).
|
|
146
|
+
|
|
147
|
+
For bugs or questions, [open an issue](https://github.com/openvax/varcode/issues).
|
|
148
|
+
Contributions are welcome; see
|
|
149
|
+
[CONTRIBUTING.md](https://github.com/openvax/varcode/blob/main/CONTRIBUTING.md)
|
|
150
|
+
and the [changelog](https://github.com/openvax/varcode/blob/main/CHANGELOG.md).
|
|
@@ -3,6 +3,10 @@ MANIFEST.in
|
|
|
3
3
|
README.md
|
|
4
4
|
pyproject.toml
|
|
5
5
|
requirements.txt
|
|
6
|
+
tests/__init__.py
|
|
7
|
+
tests/benchmark_vcf_load.py
|
|
8
|
+
tests/common.py
|
|
9
|
+
tests/data.py
|
|
6
10
|
tests/test_annotator_divergence_scenarios.py
|
|
7
11
|
tests/test_annotator_haplotypes.py
|
|
8
12
|
tests/test_annotator_parity_adversarial.py
|