Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CategoricalVariant
✓ from ga4gh.cat_vrs.models import CategoricalVariant
✗ from cat_vrs.models import CategoricalVariant
Package name uses underscores and 'ga4gh' prefix
ClinicalInterpretation
✓ from ga4gh.cat_vrs.models import ClinicalInterpretation
Some recipes classes do not inherit from CategoricalVariant in v0.5.0+
Instantiate a CategoricalVariant with an Allele and a ClinicalInterpretation member.
from ga4gh.cat_vrs.models import CategoricalVariant, ClinicalInterpretation
from ga4gh.vrs.models import Allele
# Create a categorical variant with a simple allele
allele = Allele(
location="ga4gh:VSLoc:someLocation",
state="ga4gh:VSEXP:someExpression"
)
cv = CategoricalVariant(
allele=allele,
context="ga4gh:VS:someContext",
type="CategoricalVariant",
member=[ClinicalInterpretation(label="pathogenic", id="clinvar:12345")]
)
print(cv.model_dump())
Debug
Known issues
breakingIn v0.5.0, recipe classes no longer inherit from CategoricalVariant. Code that relied on inheritance may break when upgrading from v0.4.x.fixUpdate to v0.6.0+ where the inheritance was restored, or adjust code to not use recipe classes as CategoricalVariant subclasses.
affects: >=0.5.0,<0.6.0
breakingv0.7.0 updated to Cat-VRS models 1.0.0 with breaking changes to model structure. Pydantic V2 is required.fixEnsure your code uses Pydantic V2 patterns. Use model_copy() instead of copy() and model_dump() instead of dict().
affects: >=0.7.0
breakingv0.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.fixPin to stable 0.7.x if you need production stability. Test your code against the alpha before upgrading.
affects: 0.8.0a0, 0.8.0a1
deprecatedThe 'copy' method from Pydantic V1 is deprecated in favor of 'model_copy' in v0.6.0+.fixReplace instance.copy() with instance.model_copy() and supply arguments as keyword args.
affects: >=0.6.0
Errors
Common errors & fixes
ImportError: cannot import name 'CategoricalVariant' from 'cat_vrs'
Incorrect import path: the package is ga4gh.cat_vrs, not cat_vrs.
fixUse: from ga4gh.cat_vrs.models import CategoricalVariant
pydantic_core._pydantic_core.ValidationError: 1 validation error for CategoricalVariant
type
unexpected value; permitted: 'CategoricalVariant'
The 'type' field must be exactly 'CategoricalVariant' (string). The default might be missing in older versions.
fixExplicitly set type='CategoricalVariant' when constructing CategoricalVariant.
AttributeError: 'CategoricalVariant' object has no attribute 'copy'
Pydantic V2 removed the copy() method. In ga4gh-cat-vrs >=0.6.0, use model_copy().
fixReplace .copy() with .model_copy() (Pydantic V2 pattern).
Upgrade
Version history
0.7.2latest on PyPI · released Nov 28, 2025
Audit
Dependencies
ga4gh.vrsrequiredCore dependency for VRS data types and Allele definitions
pydanticrequiredData validation and settings management using Pydantic models