{"id":27784,"library":"ga4gh-vrs","title":"GA4GH Variation Representation Specification (VRS) Python","description":"GA4GH Variation Representation Specification (VRS) reference implementation in Python. Provides data models, validation, and conversion tools for representing genetic variation in a standardized manner. Current stable version is 2.3.1 (Python >=3.10). Pre-releases track VRS 2.1.0 snapshots. Released semi-regularly with bug fixes and feature updates.","status":"active","version":"2.3.1","language":"python","source_language":"en","source_url":"https://github.com/ga4gh/vrs-python","tags":["ga4gh","vrs","variation","genomics","bioinformatics","pydantic"],"install":[{"cmd":"pip install ga4gh-vrs","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"VRSATILE standard dependencies for VRS models","package":"ga4gh.vrsatile","optional":true},{"reason":"HGVS parsing and conversion (>=1.5.5,<2.0)","package":"hgvs","optional":false}],"imports":[{"note":"Primary model class for representing an allele.","symbol":"Allele","correct":"from ga4gh.vrs.models import Allele"},{"note":"Base class for all VRS objects.","symbol":"VrsObject","correct":"from ga4gh.vrs.models import VrsObject"},{"note":"Utility function to copy VRS objects to top-level.","symbol":"copy_to_toplevel","correct":"from ga4gh.vrs.extras import copy_to_toplevel"},{"note":"Use create_dataproxy factory function instead of importing DataProxy directly.","wrong":"from ga4gh.vrs.dataproxy import DataProxy","symbol":"DataProxy","correct":"from ga4gh.vrs.dataproxy import create_dataproxy"}],"quickstart":{"code":"from ga4gh.vrs.models import Allele\nfrom ga4gh.vrs.dataproxy import create_dataproxy\n\n# Create a data proxy with optional health check (set disable_healthcheck=True to skip)\ndp = create_dataproxy('seqrepo', disable_healthcheck=True)\n\n# Build an Allele object\nallele = Allele(\n    location={\n        \"type\": \"SequenceLocation\",\n        \"sequence_id\": \"ga4gh:SQ.IIB53T8CNeJJdUqGN9Kj2b\",\n        \"interval\": {\"type\": \"SimpleInterval\", \"start\": 0, \"end\": 10}\n    },\n    state={\n        \"type\": \"LiteralSequenceExpression\",\n        \"sequence\": \"ACGTGCATGT\"\n    }\n)\nprint(allele.model_dump_json(indent=2))","lang":"python","description":"Build a simple VRS Allele using SequenceLocation and LiteralSequenceExpression, using a SeqRepo data proxy."},"warnings":[{"fix":"Update imports and migrate to pydantic v2 model_dump()/model_dump_json() instead of dict()/json().","message":"Version 2.0 introduced new models (pydantic v2). Existing code using v1.x models will break. Allele, Variation, etc. must be imported from ga4gh.vrs.models.","severity":"breaking","affected_versions":"<2.0"},{"fix":"Avoid using beacon-related translation utilities; use direct VRS models instead.","message":"Beacon translation function is deprecated since v2.2.0 and may be removed.","severity":"deprecated","affected_versions":">=2.2.0"},{"fix":"Pass disable_healthcheck=True to create_dataproxy if you don't need health checks.","message":"In v2.3.0, the health check is removed from VCF annotator and create_dataproxy now has a disable_healthcheck keyword argument. Calling create_dataproxy without it may raise errors if the underlying service is unavailable.","severity":"breaking","affected_versions":">=2.3.0"},{"fix":"Use 'pip install ga4gh-vrs' which automatically resolves the correct HGVS version.","message":"The HGVS dependency changed from <1.5 to >=1.5.5,<2.0 in v2.3.0. Pinning to older hgvs breaks installation. Ensure you install with compatible version.","severity":"gotcha","affected_versions":">=2.3.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install ga4gh-vrs' and ensure you have Python >=3.10.","cause":"Package not installed or installed with wrong name (e.g., 'vrs' instead of 'ga4gh-vrs').","error":"ModuleNotFoundError: No module named 'ga4gh.vrs'"},{"fix":"Use 'from ga4gh.vrs.models import Allele'.","cause":"The Allele class is no longer directly in ga4gh.vrs; it moved to ga4gh.vrs.models.","error":"ImportError: cannot import name 'Allele' from 'ga4gh.vrs'"},{"fix":"Use .model_dump() instead of .dict(), and .model_dump_json() instead of .json().","cause":"Using pydantic v2 model methods incorrectly. The .dict() method is deprecated.","error":"AttributeError: 'Allele' object has no attribute 'to_dict'"},{"fix":"Set disable_healthcheck=True in create_dataproxy() to skip the connection test.","cause":"The data proxy health check failed because SeqRepo service is not running or unreachable.","error":"ga4gh.vrs.dataproxy.DataProxyException: Could not connect to SeqRepo"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}