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

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.8rc1.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hgvs-1.5.8rc1-py3-none-any.whl (147.5 kB view details)

Uploaded Python 3

File details

Details for the file hgvs-1.5.8rc1.tar.gz.

File metadata

  • Download URL: hgvs-1.5.8rc1.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hgvs-1.5.8rc1.tar.gz
Algorithm Hash digest
SHA256 cfa0dac434030908b1fcb7c385098527b827befc86f4b29b04d6cef5e7f1bfb4
MD5 9fa4508937c3b444858a39a16b221891
BLAKE2b-256 7308062d5f56ef2ef5bc7203361d2044682df18335809701c4e1f88669c7b706

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgvs-1.5.8rc1.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.8rc1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for hgvs-1.5.8rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1009c556aa7507574453c5e4c9d4b13efb6e5df49ddcc8eff7698d6cd0a2e8a
MD5 d755ca0276b336328e43139bdf664826
BLAKE2b-256 c5dfdca2ca51abe63f520fc071eea26d31cc0cda5bdeaf7d1ad0ad5cea5788e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgvs-1.5.8rc1-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page