tinyhgvs
tinyhgvs is a lightweight HGVS parsing library with a Rust core and a Python
API. The project focuses on a small but expandable data model, clear error
diagnostics for unsupported syntax, and parity between the Rust and Python
surfaces.
Installation
tinyhgvs can be installed directly from PyPI:
Local deployment
For local development of the Python package:
Quick Examples
Parse a coding DNA substitution:
from tinyhgvs import parse_hgvs
variant = parse_hgvs("NM_004006.2:c.357+1G>A")
print(variant.coordinate_system.value)
print(variant.description.edit)
Parse a repeat:
from tinyhgvs import parse_hgvs
variant = parse_hgvs("NM_004006.3:r.-124_-123[14]")
print(variant.description.edit.sequence[0].quantity.count)
Parse a protein frameshift consequence:
from tinyhgvs import parse_hgvs
variant = parse_hgvs("NP_0123456.1:p.Arg97ProfsTer23")
print(variant.description.edit.to_residue)
print(variant.description.edit.stop.ordinal)
Inspect an unsupported syntax error: