AnyVar provides Python and REST interfaces to validate, normalize, generate identifiers, and register biological sequence variation according to the GA4GH Variation Representation standards.
Project description
AnyVar - lightweight and portable variation storage and retrieval
AnyVar enables registration, lookup, and search of genetic variants across a distributed genomic resource network. Its goals are to:
- Provide an open source, off-the-shelf solution that lowers the technical barriers for genomic data resources to comprehensively describe and search genomic variants
- Support a broad range of query modes, including VRS ID lookups, HGVS expressions, gene-based searches, and genomic ranges
- Translate community nomenclatures and conventions into a universal model for variant representation
- Provide a community-driven, extensible platform for shared conventions and policy to realize the above goals
Information
Latest Release
Development
Installation
Currently, AnyVar can be installed from GitHub:
pip install git+https://github.com/biocommons/anyvar
See the documentation for additional setup options and detailed instructions for initializing data dependencies.
Examples
Use the Python API to directly instantiate and query a local AnyVar instance:
>>> from anyvar.anyvar import AnyVar, create_storage, create_translator
>>> av = AnyVar(translator=create_translator(), object_store=create_storage())
>>> allele = Allele(**{"id": "ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU", "digest": "K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU", "location": {"id": "ga4gh:SL.aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8", "digest": "aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8", "end": 87894077, "start": 87894076, "sequenceReference": {"refgetAccession": "SQ.ss8r_wB0-b9r44TQTMmVTI92884QvBiB"}}, "state": {"sequence": "T", "type": "LiteralSequenceExpression"}})
>>> av.put_object(allele)
'ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU'
>>> av.get_object("ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU")
Allele(id='ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', type='Allele', name=None, description=None, aliases=None, extensions=None, digest='K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', expressions=None, location=SequenceLocation(id='ga4gh:SL.aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8', type='SequenceLocation', name=None, description=None, aliases=None, extensions=None, digest='aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8', sequenceReference=SequenceReference(id=None, type='SequenceReference', name=None, description=None, aliases=None, extensions=None, refgetAccession='SQ.ss8r_wB0-b9r44TQTMmVTI92884QvBiB', residueAlphabet=None, circular=None, sequence=None, moleculeType=None), start=87894076, end=87894077, sequence=None), state=LiteralSequenceExpression(id=None, type='LiteralSequenceExpression', name=None, description=None, aliases=None, extensions=None, sequence=sequenceString(root='T')))
Or issue a request against a live HTTP endpoint:
>>> import requests
>>> response = requests.put("http://localhost:8000/variation", json={"definition": "NC_000010.11:g.87894077C>T"})
>>> response.json()
{'messages': [], 'object': {'id': 'ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', 'type': 'Allele', 'digest': 'K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', 'location': {'id': 'ga4gh:SL.01EH5o6V6VEyNUq68gpeTwKE7xOo-WAy', 'type': 'SequenceLocation', 'digest': '01EH5o6V6VEyNUq68gpeTwKE7xOo-WAy', 'sequenceReference': {'type': 'SequenceReference', 'refgetAccession': 'SQ.ss8r_wB0-b9r44TQTMmVTI92884QvBiB'}, 'start': 87894076, 'end': 87894077}, 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'T'}}, 'object_id': 'ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU'}
>>> response = requests.get("http://localhost:8000/variation/ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU")
>>> response.json()
{'messages': [], 'data': {'id': 'ga4gh:VA.K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', 'type': 'Allele', 'digest': 'K7akyz9PHB0wg8wBNVlWAAdvMbJUJJfU', 'location': {'id': 'ga4gh:SL.aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8', 'type': 'SequenceLocation', 'digest': 'aCMcqLGKClwMWEDx3QWe4XSiGDlKXdB8', 'sequenceReference': {'type': 'SequenceReference', 'refgetAccession': 'SQ.ss8r_wB0-b9r44TQTMmVTI92884QvBiB'}, 'start': 87894076, 'end': 87894077}, 'state': {'type': 'LiteralSequenceExpression', 'sequence': 'T'}}}
Feedback and contributing
We welcome bug reports, feature requests, and code contributions from users and interested collaborators. The documentation contains guidance for submitting feedback and contributing new code.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file biocommons_anyvar-1.0.0rc3.tar.gz.
File metadata
- Download URL: biocommons_anyvar-1.0.0rc3.tar.gz
- Upload date:
- Size: 123.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71e72568c45c38d783a182cba054071ce19a1ae8837f34a6f745707093b4820d
|
|
| MD5 |
47980ffa9d103c862d4748973075f611
|
|
| BLAKE2b-256 |
2475b0d07bd250050801c8228f14377e54a08f6175342075a9c390c969cd0e35
|
Provenance
The following attestation bundles were made for biocommons_anyvar-1.0.0rc3.tar.gz:
Publisher:
release.yml on biocommons/anyvar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biocommons_anyvar-1.0.0rc3.tar.gz -
Subject digest:
71e72568c45c38d783a182cba054071ce19a1ae8837f34a6f745707093b4820d - Sigstore transparency entry: 823749238
- Sigstore integration time:
-
Permalink:
biocommons/anyvar@4cf740d35c1e6025732739871dd5de92867d7371 -
Branch / Tag:
refs/tags/1.0.0-rc3 - Owner: https://github.com/biocommons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4cf740d35c1e6025732739871dd5de92867d7371 -
Trigger Event:
release
-
Statement type:
File details
Details for the file biocommons_anyvar-1.0.0rc3-py3-none-any.whl.
File metadata
- Download URL: biocommons_anyvar-1.0.0rc3-py3-none-any.whl
- Upload date:
- Size: 71.0 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 |
dc8241e783c8783115c35e0f95221cff04b0957ada320d7924ac9abdd3bf85a8
|
|
| MD5 |
ad906b0afddd4c76b47ddacdcc18e277
|
|
| BLAKE2b-256 |
1d8611c9688e3e88123f8bc15a17714c3843e2ab7167ce5a4abad2605c896bb0
|
Provenance
The following attestation bundles were made for biocommons_anyvar-1.0.0rc3-py3-none-any.whl:
Publisher:
release.yml on biocommons/anyvar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biocommons_anyvar-1.0.0rc3-py3-none-any.whl -
Subject digest:
dc8241e783c8783115c35e0f95221cff04b0957ada320d7924ac9abdd3bf85a8 - Sigstore transparency entry: 823749292
- Sigstore integration time:
-
Permalink:
biocommons/anyvar@4cf740d35c1e6025732739871dd5de92867d7371 -
Branch / Tag:
refs/tags/1.0.0-rc3 - Owner: https://github.com/biocommons
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4cf740d35c1e6025732739871dd5de92867d7371 -
Trigger Event:
release
-
Statement type: