Skip to main content

HGVS Parser, Formatter, Mapper, Validator

Project description

hgvs - manipulate biological sequence variants according to Human Genome Variation Society recommendations

The hgvs package provides a Python library to parse, format, validate, normalize, and map sequence variants according to Variation Nomenclature (aka Human Genome Variation Society) recommendations.

Specifically, the hgvs package focuses on the subset of the HGVS recommendations that precisely describe sequence-level variation relevant to the application of high-throughput sequencing to clinical diagnostics. The package does not attempt to cover the full scope of HGVS recommendations. Please refer to issues for limitations.

Information

rtd changelog getting_help GitHub license binder

Latest Release

GitHub tag pypi_rel

Development

coveralls issues GitHub Open Pull Requests GitHub license GitHub stars GitHub forks

Features

  • Parsing is based on formal grammar.
  • An easy-to-use object model that represents most variant types (SNVs, indels, dups, inversions, etc) and concepts (intronic offsets, uncertain positions, intervals)
  • A variant normalizer that rewrites variants in canonical forms and substitutes reference sequences (if reference and transcript sequences differ)
  • Formatters that generate HGVS strings from internal representations
  • Tools to map variants between genome, transcript, and protein sequences
  • Reliable handling of regions genome-transcript discrepancies
  • Pluggable data providers support alternative sources of transcript mapping data
  • Extensive automated tests, including those for all variant types and "problematic" transcripts
  • Easily installed using remote data sources. Installation with local data sources is straightforward and completely obviates network access

Citation

Wang M, Callenberg KM, Dalgleish R, Fedtsov A, Fox N, Freeman PJ, et al.
hgvs: A Python package for manipulating sequence variants using HGVS nomenclature: 2018 Update.
Hum Mutat. 2018. doi:10.1002/humu.23615

Important Notes

  • You are encouraged to browse issues. All known issues are listed there. Please report any issues you find.
  • Use a pip package specification to stay within minor releases. For example, hgvs>=1.5,<1.6. hgvs uses Semantic Versioning.

Installing HGVS Locally

Important: For more detailed installation and configuration instructions, see the HGVS readthedocs

Prerequisites

libpq
python3
postgresql

Examples for installation:

MacOS :

brew install libpq
brew install python3
brew install postgresql@14

Ubuntu :

sudo apt install gcc libpq-dev python3-dev

Installation Steps

By default, hgvs uses remote data sources, which makes installation easy. If you would like to use local instances of the data sources, see the readthedocs.

  1. Create a virtual environment using your preferred method.

    Example:

     python3 -m venv venv
    
  2. Run the following commands in your virtual environment:

     source venv/bin/activate
     pip install --upgrade setuptools
     pip install hgvs
    

See Installation instructions for details, including instructions for installing Universal Transcript Archive (UTA) and SeqRepo locally.

Examples and Usage

See examples and readthedocs for usage.

Contributing

The hgvs package is a community effort. Please see Contributing to get started in submitting source code, tests, or documentation. Thanks for getting involved!

Testing

Existing tests use a cache that is committed with the repo to ensure that tests do not require external networking. To develop new tests, which requires loading the cache, you should install UTA and Seqrepo (and the rest service) locally.

docker compose --project-name biocommons -f $PWD/misc/docker-compose.yml up

IMPORTANT: Loading the test caches is currently hampered b #551, #760, and #761. To load reliably, use make test-relearn-iteratively for now.

See Also

Other packages that manipulate HGVS variants:

Project details


Release history Release notifications | RSS feed

This version

1.5.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hgvs-1.5.6.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

hgvs-1.5.6-py3-none-any.whl (145.6 kB view details)

Uploaded Python 3

File details

Details for the file hgvs-1.5.6.tar.gz.

File metadata

  • Download URL: hgvs-1.5.6.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hgvs-1.5.6.tar.gz
Algorithm Hash digest
SHA256 663755fd5db38a897c447dd1ec0a2bfc8157a28ad30378a08489746e3aa61ff2
MD5 5999b787e78e9e6e84fd5bee478dc768
BLAKE2b-256 b9ba23c5b3dea54340b1db2ea8965fe231c391c71b071f68d800bc1bf6b081c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgvs-1.5.6.tar.gz:

Publisher: python-package.yml on biocommons/hgvs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hgvs-1.5.6-py3-none-any.whl.

File metadata

  • Download URL: hgvs-1.5.6-py3-none-any.whl
  • Upload date:
  • Size: 145.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hgvs-1.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7ca4f9fc7be3afca29f5caf1bc5256083fc581a59c6801b7e9654a15d8d2d376
MD5 0b5fb5ba5e86cf0639c14a7d724e9a70
BLAKE2b-256 ac6ea02c3683ffe6985977a13fc2148a855a0bfba6d2c1baa8e83ca3041890b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgvs-1.5.6-py3-none-any.whl:

Publisher: python-package.yml on biocommons/hgvs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page