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.7.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.7-py3-none-any.whl (147.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hgvs-1.5.7.tar.gz
  • Upload date:
  • Size: 2.7 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.7.tar.gz
Algorithm Hash digest
SHA256 5d76d9cde7bd029d770f3e06ddac5b6bba22da2d8698e39a5a403053d9451251
MD5 8d967efd0dc9609dd0819964ef781f41
BLAKE2b-256 e625166c9731ed48f7f5caa1d2c87ea9c11f2e58ab065946f03c49f729a3bbc8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hgvs-1.5.7-py3-none-any.whl
  • Upload date:
  • Size: 147.4 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff13a4df730fc6ecc68579629a200a7c9f403e4e8f0636cb1c819fab8543144
MD5 fa666cf9c695d2cb570bd277adf618ad
BLAKE2b-256 838930df47b2d1171fc4822defd72aa800993af1c80e66253342ca16072fd88f

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgvs-1.5.7-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