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
Latest Release
Development
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.
-
Create a virtual environment using your preferred method.
Example:
python3 -m venv venv
-
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
663755fd5db38a897c447dd1ec0a2bfc8157a28ad30378a08489746e3aa61ff2
|
|
MD5 |
5999b787e78e9e6e84fd5bee478dc768
|
|
BLAKE2b-256 |
b9ba23c5b3dea54340b1db2ea8965fe231c391c71b071f68d800bc1bf6b081c1
|
Provenance
The following attestation bundles were made for hgvs-1.5.6.tar.gz
:
Publisher:
python-package.yml
on biocommons/hgvs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
hgvs-1.5.6.tar.gz
-
Subject digest:
663755fd5db38a897c447dd1ec0a2bfc8157a28ad30378a08489746e3aa61ff2
- Sigstore transparency entry: 470313973
- Sigstore integration time:
-
Permalink:
biocommons/hgvs@5f270458f0858fa3d55da7a7e88d4efbd745072f
-
Branch / Tag:
refs/tags/1.5.6
- Owner: https://github.com/biocommons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-package.yml@5f270458f0858fa3d55da7a7e88d4efbd745072f
-
Trigger Event:
push
-
Statement type:
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7ca4f9fc7be3afca29f5caf1bc5256083fc581a59c6801b7e9654a15d8d2d376
|
|
MD5 |
0b5fb5ba5e86cf0639c14a7d724e9a70
|
|
BLAKE2b-256 |
ac6ea02c3683ffe6985977a13fc2148a855a0bfba6d2c1baa8e83ca3041890b6
|
Provenance
The following attestation bundles were made for hgvs-1.5.6-py3-none-any.whl
:
Publisher:
python-package.yml
on biocommons/hgvs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
hgvs-1.5.6-py3-none-any.whl
-
Subject digest:
7ca4f9fc7be3afca29f5caf1bc5256083fc581a59c6801b7e9654a15d8d2d376
- Sigstore transparency entry: 470313983
- Sigstore integration time:
-
Permalink:
biocommons/hgvs@5f270458f0858fa3d55da7a7e88d4efbd745072f
-
Branch / Tag:
refs/tags/1.5.6
- Owner: https://github.com/biocommons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-package.yml@5f270458f0858fa3d55da7a7e88d4efbd745072f
-
Trigger Event:
push
-
Statement type: