ferro-hgvs
A high-performance HGVS variant nomenclature parser and normalizer written in Rust.
Features
- Full HGVS Parsing: All coordinate systems (g/c/n/r/p/m/o) and edit types
- Variant Normalization: 3' shifting per HGVS specification
- High Performance: ~5M variants/sec single-threaded parsing (>12M/s parallel), zero-copy with nom
- Type-Safe: Leverages Rust's type system for correctness
Installation
Python
pip install ferro-hgvs
Pre-built wheels are available for Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), and Windows (x86_64) on Python 3.10+.
Rust
Add to your Cargo.toml:
[dependencies]
ferro-hgvs = "0.1"
Or install the CLI:
cargo install ferro-hgvs
Quick Start
CLI
# Parse a variant
ferro parse "NM_000088.3:c.459A>G"
# Parse from file
ferro parse -i variants.txt -f json
# Prepare reference data (downloads RefSeq, genome, cdot — RefSeq-only by default)
ferro prepare --output-dir ferro-reference
# Verify reference data is ready
ferro check --reference ferro-reference
# (Optional) pre-build the on-disk cdot cache as a setup step, so the one-time
# cache build doesn't slow the start of a real (or timed/benchmarked) run.
ferro check --reference ferro-reference --build-cache
# Normalize with reference
ferro normalize "NM_000088.3:c.459del" --reference ferro-reference/
Read the warnings. Normalization sometimes repairs a description in a way the normalized string does not record — separately reported cis members merged into one
delins(MEMBERS_COALESCED_FROM_REPORTED_FORM), ains[100_110]reference-range payload replaced by the bases it denotes (INSERTED_SEQUENCE_EXPANDED), a stated reference base that contradicted the reference and was accepted anyway (REFSEQ_MISMATCH). Those are reported aswarning[CODE]: messageon stderr (and in thewarningsarray under--format json, thedetailcolumn under--format tsv), so a pipeline reading only stdout will not see them.--error-mode strictis not a substitute: it rejects a specific ladder of conditions and reports the rest exactly as lenient does.
Throughput tip: when normalizing many variants, feed them sorted by transcript accession (or by genomic position). ferro caches each resolved transcript, so consecutive variants on the same transcript skip the (dominant) cost of re-reading and re-building it from the reference. Sorted input keeps the relevant transcripts resident in the cache and is markedly faster on large batches — see Performance Comparison.
Optional reference data
A bare ferro prepare builds a RefSeq-only reference (accessions NM_/NR_/NP_/NG_). Two opt-in flags provision additional data — pass them at prepare time; they are what a fully-provisioned ("blessed") reference is built with:
# Add Ensembl support (accessions ENST/ENSG/ENSP). Downloads the Ensembl cdot
# metadata and cDNA FASTAs (~1 GB+); off by default. Without it, an ENST/ENSG/ENSP
# input reports "Reference not found" and the message points back at this flag.
ferro prepare --output-dir ferro-reference --ensembl
# Derive version-independent NG_ placements and the NG_→transcript-version map
# (ng_hosted_transcripts) for a curated list of RefSeqGene accessions. Required to
# resolve legacy gene-symbol selectors (NG_(GENE):c.…) and bare-NG_ hosted lookups.
ferro prepare --output-dir ferro-reference \
--derive-ng-placements path/to/ng_accessions.txt
# A fully-provisioned reference combines both in one run:
ferro prepare --output-dir ferro-reference --ensembl \
--derive-ng-placements path/to/ng_accessions.txt
Both flags are incremental: re-running ferro prepare over an existing reference adds the requested data and preserves already-provisioned artifacts.
Library
use ferro_hgvs::{parse_hgvs, HgvsVariant};
fn main() -> Result<(), ferro_hgvs::FerroError> {
let variant = parse_hgvs("NM_000088.3:c.459A>G")?;
match &variant {
HgvsVariant::Cds(v) => println!("CDS variant: {}", v),
HgvsVariant::Genome(v) => println!("Genomic variant: {}", v),
_ => println!("Other: {}", variant),
}
Ok(())
}
Python
import ferro_hgvs
# Parse a variant
variant = ferro_hgvs.parse("NM_000088.3:c.459A>G")
print(variant.variant_type) # "coding"
print(variant.reference) # "NM_000088.3"
print(str(variant)) # "NM_000088.3:c.459A>G"
# Normalize with reference data
normalizer = ferro_hgvs.Normalizer(reference_json="ferro-reference/cdot.json")
normalized = normalizer.normalize("NM_000088.3:c.459del")
# `normalize` returns only the string, so it cannot tell you that normalization
# repaired something. `normalize_with_warnings` returns the same string plus the
# diagnostics — as a free function, or as a Normalizer method.
result = normalizer.normalize_with_warnings("NM_000088.3:c.459del")
print(str(result.result)) # the same normalized string
print([(w.code, w.message) for w in result.warnings])
Documentation
Full guides live in the documentation site (source under docs/src/):
- Normalization rules — ferro's output contract: what a normalized description is allowed to be
- Deriving a description from sequences — turn a window of bases into one canonical description, no reference needed
- Normalize variants · Reference data
- Project to another axis — re-express a variant on a transcript; the projected
c./r.axis applies the coding-axis rules a genomic axis cannot - Error handling — strict / lenient / silent modes and warning codes
- Comparing normalization rules (
FERRO_PARTITION) - Benchmarking
- CLI reference · Supported HGVS syntax
- Why ferro-hgvs? — tool comparison — capability matrix, cross-tool benchmarks, and what
ferro preparebuilds - Interpreting the HGVS recommendations — how ferro reads each clause
Why ferro-hgvs?
ferro-hgvs provides the most comprehensive HGVS variant normalization across all pattern types, with performance orders of magnitude faster than alternatives. For the full capability matrix against mutalyzer / biocommons / hgvs-rs, the cross-tool parse/normalize benchmarks, and what ferro prepare builds, see Why ferro-hgvs? — tool comparison.
Benchmark: Reference Data & Tool Comparison
The main ferro binary includes commands to prepare reference data (ferro prepare) and check its status (ferro check). The ferro-benchmark tool (build with --features benchmark) extends this for tool comparison benchmarks.
| Command | Description |
|---|---|
prepare <tool> |
Prepare reference data for a tool |
check <tool> |
Verify tool configuration and dependencies |
parse <tool> |
Parse HGVS patterns with specified tool |
normalize <tool> |
Normalize HGVS patterns with specified tool |
compare results |
Compare parse/normalize results between tools |
extract |
Extract patterns from ClinVar, VCFs, or create samples |
setup |
Set up UTA database, SeqRepo, and other services |
generate |
Generate summary reports and configs |
collate |
Aggregate sharded results |
Quick Start
# Prepare ferro reference (main binary - no special features needed)
ferro prepare --output-dir data/ferro
# Check reference data
ferro check --reference data/ferro
# Normalize with ferro
ferro normalize -i patterns.txt --reference data/ferro
# For tool comparison, build with benchmark support
cargo build --release --features benchmark
# Prepare other tools (uses ferro reference for transcript data)
ferro-benchmark prepare mutalyzer --ferro-reference data/ferro --output-dir data/mutalyzer
ferro-benchmark prepare biocommons --seqrepo-dir data/seqrepo --uta-dump uta_20210129b.pgd.gz --ferro-reference data/ferro
# Compare results between tools
ferro-benchmark normalize mutalyzer -i patterns.txt -o mutalyzer.json --mutalyzer-settings data/mutalyzer/mutalyzer_settings.conf
ferro-benchmark compare results normalize ferro.json mutalyzer.json -o comparison.json
Supported tools: ferro-hgvs, mutalyzer, biocommons/hgvs, hgvs-rs
Note: The
pixi.tomlandpixi.lockfiles in this repository define a pixi environment for the Python-based external tools (mutalyzer, biocommons/hgvs, seqrepo) used in benchmarking. Runpixi shellto activate it.
See docs/BENCHMARK_GUIDE.md for detailed usage.
Development
cargo build
cargo test # default features
cargo clippy -- -D warnings
The commands above use the default feature set, and CI keeps them compiling (see
the build job). They do not cover the whole suite — the feature-gated tests and
the integration tree need dev, which is what CI runs and what you want before
opening a PR:
cargo nextest run --features dev
cargo clippy --features dev --all-targets -- -D warnings
License
Licensed under the MIT License. See LICENSE for details.
Disclaimer
This software is actively maintained. While we make a best effort to test this software and to fix issues as they are reported, this software is provided as-is without any warranty (see the license for details). Please submit an issue, and better yet a pull request as well, if you discover a bug or identify a missing feature. Please contact Fulcrum Genomics if you are considering using this software or are interested in sponsoring its development.
Contributing
See CONTRIBUTING.md for guidelines.
Metadata
Release files for ferro-hgvs 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ferro_hgvs-1.0.0.tar.gz | 7.4 MB | With provenance | Details for ferro_hgvs-1.0.0.tar.gz |
Built distributions (wheels)
Total release size: 35.8 MB
Release files / ferro_hgvs-1.0.0.tar.gz
| Download URL | ferro_hgvs-1.0.0.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
076baf2f9f3d1be08088df79cfe6884050ede5d249033109941ed7fbab7cdab9
|
|
BLAKE2b-256 checksum How to use checksums |
05c88892446622a6dbb8a0b94b3147b3f61361e3a37c034ae1492dd0b4dc17bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-win_amd64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b5f2c313e8249cece77be3ef541874d20a0bfbeffc1c630420cb07978c5ea93c
|
|
BLAKE2b-256 checksum How to use checksums |
de865d9bf31b825a8e79196ccb863d7af40a6e69aa3862219cab7a4b0b22e246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e214a384952337ebd692ea3e11322d2716a82e51b38044600340955f1802c158
|
|
BLAKE2b-256 checksum How to use checksums |
8501ed3e76144037513c7b109d2d1c876e7ac45ff1da2b7e6866d5874fc3a7ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
374d1b342d1190abc0a6a635c4db6d4065f1efd3a28b86a059384b4855516bcd
|
|
BLAKE2b-256 checksum How to use checksums |
817dcd296c33f64d23a77359ec3aa24b51c241bdd5133012210c1610c48222ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2931d29a568760400d6802bdfa81b963d7c662ec9f64bb3d1f170ecd5b81be38
|
|
BLAKE2b-256 checksum How to use checksums |
5bb368dec23c620da4405d14b06b47a6b6c8b324f60a558ccda36188dfd707a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c07c8358d23bf1ac5d2cafcdb50596fbd83428ed50459a53a4caac2ee918e852
|
|
BLAKE2b-256 checksum How to use checksums |
c09f1c8c252fc5e20caa37604e2d982a821291e168605131ce9f5d8eac97fb11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e5c5f3a21da1501a33811b40a9256c74008590d2481eff726a163ccd02830bd
|
|
BLAKE2b-256 checksum How to use checksums |
1f2f02abedfc057af38487c603ee3a0001ce4c913f47f04b850ae025ee4ea512
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / ferro_hgvs-1.0.0-cp310-abi3-macosx_10_13_x86_64.whl
| Download URL | ferro_hgvs-1.0.0-cp310-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.10 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
4823c51f9856a442afd732e03eec0d90afdf0a2a930528bed5457186458b35c3
|
|
BLAKE2b-256 checksum How to use checksums |
5df740148a367b0cd76bf64b8cf10fe1f860d5110d935103484382ad421fae05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logSecurity for ferro-hgvs 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 8 files in this release have been uploaded with provenance metadata.
Attestation for ferro_hgvs-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.