Skip to content

Commit

Permalink
fix: add expressions to variation
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Sep 15, 2023
1 parent f8ed3b1 commit a635b1f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ga4gh/vrs/_internal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,13 @@ class ga4gh(_Ga4ghIdentifiableObject.ga4gh):
]


class Allele(_Ga4ghIdentifiableObject):
class _VariationBase(_Ga4ghIdentifiableObject):
"""Base class for variation"""

expressions: Optional[List[Expression]] = None


class Allele(_VariationBase):

type: Literal['Allele'] = Field('Allele', description='MUST be "Allele"')
location: Union[IRI, SequenceLocation] = Field(
Expand All @@ -311,7 +317,7 @@ class ga4gh(_Ga4ghIdentifiableObject.ga4gh):
]


class Haplotype(_Ga4ghIdentifiableObject):
class Haplotype(_VariationBase):
"""A set of non-overlapping Allele members that co-occur on the same molecule."""

type: Literal['Haplotype'] = Field('Haplotype', description='MUST be "Haplotype"')
Expand All @@ -330,7 +336,7 @@ class ga4gh(_Ga4ghIdentifiableObject.ga4gh):
]


class _CopyNumber(_Ga4ghIdentifiableObject):
class _CopyNumber(_VariationBase):
"""A measure of the copies of a `Location` within a system (e.g. genome, cell, etc.)"""

location: Union[IRI, SequenceLocation] = Field(
Expand Down Expand Up @@ -411,7 +417,7 @@ class MolecularVariation(RootModel):
)


class Genotype(_Ga4ghIdentifiableObject):
class Genotype(_VariationBase):
"""A quantified set of _in-trans_ `MolecularVariation` at a genomic locus."""

type: Literal['Genotype'] = Field(
Expand Down

0 comments on commit a635b1f

Please sign in to comment.