skillfed

varcode

Variant annotation in Python

varcode v7.0.0 96.7K downloads/30d#13,199 on PyPI87
Permissive license Active released

What it is and what it does

Varcode is a Python library for working with genomic variant data and predicting the impact of those variants on protein sequences. It loads variants from standard formats like MAF files, organizes them by gene, and computes detailed mutation effects—such as amino acid substitutions, frameshifts, premature stops, and splice disruptions—on each affected transcript. The library represents effects as typed objects (e.g., `Substitution`, `FrameShift`, `PrematureStop`) that expose the mutant protein sequence, the transcript involved, and the gene context.

The package is built on numpy, pandas, and pyensembl for reference genome lookups. It handles complex scenarios like multi-outcome effects (where a variant's impact is ambiguous without additional information), structural variants, and germline-aware annotation. Users typically load variant collections, filter or group by gene, call `.effects()` to compute annotations, and inspect the resulting effect objects for downstream analysis—such as identifying driver mutations, predicting immunogenicity, or prioritizing variants for experimental validation.

Use it for:

  • Load TCGA or other cancer variant datasets and predict which mutations cause protein-truncating effects like premature stops or frameshifts.
  • Annotate somatic variants in a tumor sample to identify which genes are affected and classify each variant's functional impact.
  • Group variants by gene and compute effects across all transcripts to understand isoform-specific consequences of the same mutation.
  • Filter variant collections for high-priority effects (e.g., nonsense mutations) to prioritize candidates for experimental validation or clinical reporting.
  • Analyze multi-sample VCF files with per-sample genotype information to classify variants as somatic or germline and compute sample-aware effects.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Varcode loads and analyzes genomic variant data, predicting how DNA variants affect protein sequences by annotating their biological effects on genes and transcripts.

Yes. Varcode is actively maintained, has low install friction, carries a permissive license, and fills a specific niche in genomic variant annotation. It is well-suited for researchers and bioinformaticians working with variant data who need reliable effect prediction. Requires Python ≥3.9 and a one-time setup of reference genome data via pyensembl; no known security vulnerabilities.

Install

varcode on PyPI

pip

pip install varcode

uv

uv add varcode

poetry

poetry add varcode

Installing varcode

Before you install

Low install friction with a pure-Python wheel. Active maintenance as of 2026-07-09 with recent release (36 days old). Depends on numpy, pandas, and pyensembl; requires reference genome data installed separately via pyensembl.

License in practice

Licensed under Apache Software License (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

pip install varcode
pyensembl install --release 75

import varcode
variants = varcode.load_maf("variants.maf")
effects = variants.effects()
print(effects[0])

Requires reference genome data installed via pyensembl (e.g., `pyensembl install --release 75 76`) before variant effects can be computed.

Verify before relying

  • Whether pyensembl reference data download and setup is straightforward for first-time users
  • Performance characteristics with large variant sets (e.g., whole-genome or multi-sample VCFs)
  • Completeness of effect annotation coverage across all variant types and edge cases

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 6 — numpy, pandas, pyensembl, memoized_property, serializable, sercol
Maintenance actively maintained — 36 days since the last release
Last repo commit
First released
Downloads 96,701/month — #13,199 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: varcode-7.0.0-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Scientific/Engineering :: Bio-Informatics

Tags

genomic variant annotationpredict protein mutation effectsvariant impact predictionMAF file parsingDNA variant analysistranscript effect annotationsomatic variant classification
bioinformaticsgenomicsvariant-annotation

More Bio-Informatics packages