Skip to main content

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

rtd changelog GitHub license DOI

Latest Release

GitHub tag pypi_rel

Development

action status issues GitHub Open Pull Requests GitHub Contributors GitHub stars GitHub forks

Installation

AnyVar can be installed from PyPI:

pip install 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 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


Download files

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

Source Distribution

anyvar-1.0.0.tar.gz (124.0 kB view details)

Uploaded Source

Built Distribution

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

anyvar-1.0.0-py3-none-any.whl (72.0 kB view details)

Uploaded Python 3

File details

Details for the file anyvar-1.0.0.tar.gz.

File metadata

  • Download URL: anyvar-1.0.0.tar.gz
  • Upload date:
  • Size: 124.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for anyvar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d8ae4ee759a3b259e879781b69359a348abf18f19a47c4c96cecbfb896295424
MD5 e2cc33151f4b1173de76a86e94c2577b
BLAKE2b-256 c97b106d9979c269e70db80b3318fb4ac53259169795c3f67288d00cb953d533

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyvar-1.0.0.tar.gz:

Publisher: release.yml on biocommons/anyvar

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

File details

Details for the file anyvar-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for anyvar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9189130aa93e59ba7f8e79dd44f5b50f9e6bc17fef08d2f092be851cb97639d3
MD5 d4ff9afc81e5f225abfe6401fcea0164
BLAKE2b-256 a7ac4da01c4c5ce5aee5e1832a10b570375a9f63940c1c159e32303392a6c7fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyvar-1.0.0-py3-none-any.whl:

Publisher: release.yml on biocommons/anyvar

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