{"id":27780,"library":"ga4gh-cat-vrs","title":"GA4GH Cat-VRS","description":"GA4GH Categorical Variation Representation (Cat-VRS) reference implementation. Current version 0.7.2 (stable), with 0.8.0-alpha1 available. The library provides Python models and utilities for representing categorical (e.g., clinical significance) variants aligned with VRS. Release cadence is irregular, with several milestone releases in 2025-2026.","status":"active","version":"0.7.2","language":"python","source_language":"en","source_url":"https://github.com/ga4gh/cat-vrs-python","tags":["ga4gh","vrs","categorical-variant","genomics","clinical"],"install":[{"cmd":"pip install ga4gh-cat-vrs","lang":"bash","label":"Stable"},{"cmd":"pip install ga4gh-cat-vrs==0.8.0a1","lang":"bash","label":"Pre-release"}],"dependencies":[{"reason":"Core dependency for VRS data types and Allele definitions","package":"ga4gh.vrs","optional":false},{"reason":"Data validation and settings management using Pydantic models","package":"pydantic","optional":false}],"imports":[{"note":"Package name uses underscores and 'ga4gh' prefix","wrong":"from cat_vrs.models import CategoricalVariant","symbol":"CategoricalVariant","correct":"from ga4gh.cat_vrs.models import CategoricalVariant"},{"note":"Some recipes classes do not inherit from CategoricalVariant in v0.5.0+","symbol":"ClinicalInterpretation","correct":"from ga4gh.cat_vrs.models import ClinicalInterpretation"}],"quickstart":{"code":"from ga4gh.cat_vrs.models import CategoricalVariant, ClinicalInterpretation\nfrom ga4gh.vrs.models import Allele\n\n# Create a categorical variant with a simple allele\nallele = Allele(\n    location=\"ga4gh:VSLoc:someLocation\",\n    state=\"ga4gh:VSEXP:someExpression\"\n)\ncv = CategoricalVariant(\n    allele=allele,\n    context=\"ga4gh:VS:someContext\",\n    type=\"CategoricalVariant\",\n    member=[ClinicalInterpretation(label=\"pathogenic\", id=\"clinvar:12345\")]\n)\nprint(cv.model_dump())","lang":"python","description":"Instantiate a CategoricalVariant with an Allele and a ClinicalInterpretation member."},"warnings":[{"fix":"Update to v0.6.0+ where the inheritance was restored, or adjust code to not use recipe classes as CategoricalVariant subclasses.","message":"In v0.5.0, recipe classes no longer inherit from CategoricalVariant. Code that relied on inheritance may break when upgrading from v0.4.x.","severity":"breaking","affected_versions":">=0.5.0,<0.6.0"},{"fix":"Ensure your code uses Pydantic V2 patterns. Use model_copy() instead of copy() and model_dump() instead of dict().","message":"v0.7.0 updated to Cat-VRS models 1.0.0 with breaking changes to model structure. Pydantic V2 is required.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Pin to stable 0.7.x if you need production stability. Test your code against the alpha before upgrading.","message":"v0.8.0-alpha moves to Cat-VRS 1.1.0-snapshot and may change model fields. The pre-release uses ga4gh.vrs ~=2.4.0a1.","severity":"breaking","affected_versions":"0.8.0a0, 0.8.0a1"},{"fix":"Replace instance.copy() with instance.model_copy() and supply arguments as keyword args.","message":"The 'copy' method from Pydantic V1 is deprecated in favor of 'model_copy' in v0.6.0+.","severity":"deprecated","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from ga4gh.cat_vrs.models import CategoricalVariant","cause":"Incorrect import path: the package is ga4gh.cat_vrs, not cat_vrs.","error":"ImportError: cannot import name 'CategoricalVariant' from 'cat_vrs'"},{"fix":"Explicitly set type='CategoricalVariant' when constructing CategoricalVariant.","cause":"The 'type' field must be exactly 'CategoricalVariant' (string). The default might be missing in older versions.","error":"pydantic_core._pydantic_core.ValidationError: 1 validation error for CategoricalVariant\ntype\n  unexpected value; permitted: 'CategoricalVariant'"},{"fix":"Replace .copy() with .model_copy() (Pydantic V2 pattern).","cause":"Pydantic V2 removed the copy() method. In ga4gh-cat-vrs >=0.6.0, use model_copy().","error":"AttributeError: 'CategoricalVariant' object has no attribute 'copy'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}