From 5899e165c3bf632fb3e89972935d82e036dd4f8e Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Wed, 10 Jun 2026 21:14:36 -0400 Subject: [PATCH 1/3] fix: add clin sig prop as valid statement proposition --- src/ga4gh/va_spec/base/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ga4gh/va_spec/base/core.py b/src/ga4gh/va_spec/base/core.py index ebf39c6..fdf32fc 100644 --- a/src/ga4gh/va_spec/base/core.py +++ b/src/ga4gh/va_spec/base/core.py @@ -695,6 +695,7 @@ class Statement(InformationEntity, BaseModelForbidExtra): | VariantPathogenicityProposition | VariantPrognosticProposition | VariantTherapeuticResponseProposition + | VariantClinicalSignificanceProposition ) = Field( ..., description="A possible fact, the validity of which is assessed and reported by the Statement. A Statement can put forth the proposition as being true, false, or uncertain, and may provide an assessment of the level of confidence/evidence supporting this claim.", From 296df4f7cf98acfc71f6284ca852f7e919ebc53e Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Thu, 11 Jun 2026 10:20:21 -0400 Subject: [PATCH 2/3] refactor into shared type alias --- src/ga4gh/va_spec/base/core.py | 54 +++++++++++++--------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/src/ga4gh/va_spec/base/core.py b/src/ga4gh/va_spec/base/core.py index fdf32fc..9202404 100644 --- a/src/ga4gh/va_spec/base/core.py +++ b/src/ga4gh/va_spec/base/core.py @@ -5,7 +5,7 @@ from abc import ABC from datetime import date, datetime from enum import Enum -from typing import Annotated, Literal +from typing import Annotated, Literal, TypeAlias from pydantic import ( ConfigDict, @@ -363,20 +363,6 @@ class Proposition(Entity): ) -class SubjectVariantProposition(RootModel): - """A `Proposition` that has a variant as the subject.""" - - root: ( - ExperimentalVariantFunctionalImpactProposition - | VariantPathogenicityProposition - | VariantDiagnosticProposition - | VariantPrognosticProposition - | VariantOncogenicityProposition - | VariantTherapeuticResponseProposition - | VariantClinicalSignificanceProposition - ) = Field(discriminator="type") - - class _SubjectVariantPropositionBase(Entity, ABC): subjectVariant: MolecularVariation | CategoricalVariant | iriReference = Field( ..., description="A variant that is the subject of the Proposition." @@ -548,6 +534,23 @@ class VariantTherapeuticResponseProposition( ) +_SubjectVariantPropositionType: TypeAlias = ( + ExperimentalVariantFunctionalImpactProposition + | VariantPathogenicityProposition + | VariantDiagnosticProposition + | VariantPrognosticProposition + | VariantOncogenicityProposition + | VariantTherapeuticResponseProposition + | VariantClinicalSignificanceProposition +) + + +class SubjectVariantProposition(RootModel): + """A `Proposition` that has a variant as the subject.""" + + root: _SubjectVariantPropositionType = Field(discriminator="type") + + class Direction(str, Enum): """A term indicating whether the Statement supports, disputes, or remains neutral w.r.t. the validity of the Proposition it evaluates. @@ -571,16 +574,7 @@ class EvidenceLine(InformationEntity, BaseModelForbidExtra): default=CoreType.EVIDENCE_LINE.value, description=f"MUST be '{CoreType.EVIDENCE_LINE.value}'.", ) - targetProposition: ( - ExperimentalVariantFunctionalImpactProposition - | VariantPathogenicityProposition - | VariantDiagnosticProposition - | VariantPrognosticProposition - | VariantOncogenicityProposition - | VariantTherapeuticResponseProposition - | VariantClinicalSignificanceProposition - | None - ) = Field( + targetProposition: _SubjectVariantPropositionType | None = Field( default=None, description="The possible fact against which evidence items contained in an Evidence Line were collectively evaluated, in determining the overall strength and direction of support they provide. For example, in an ACMG Guideline-based assessment of variant pathogenicity, the support provided by distinct lines of evidence are assessed against a target proposition that the variant is pathogenic for a specific disease.", ) @@ -688,15 +682,7 @@ class Statement(InformationEntity, BaseModelForbidExtra): default=CoreType.STATEMENT.value, description=f"MUST be '{CoreType.STATEMENT.value}'.", ) - proposition: ( - ExperimentalVariantFunctionalImpactProposition - | VariantDiagnosticProposition - | VariantOncogenicityProposition - | VariantPathogenicityProposition - | VariantPrognosticProposition - | VariantTherapeuticResponseProposition - | VariantClinicalSignificanceProposition - ) = Field( + proposition: _SubjectVariantPropositionType = Field( ..., description="A possible fact, the validity of which is assessed and reported by the Statement. A Statement can put forth the proposition as being true, false, or uncertain, and may provide an assessment of the level of confidence/evidence supporting this claim.", discriminator="type", From 455cba18fc6bebfa949bd98c1a68e011b4112c9f Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Thu, 11 Jun 2026 10:21:02 -0400 Subject: [PATCH 3/3] add note --- src/ga4gh/va_spec/base/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ga4gh/va_spec/base/core.py b/src/ga4gh/va_spec/base/core.py index 9202404..fdf3afb 100644 --- a/src/ga4gh/va_spec/base/core.py +++ b/src/ga4gh/va_spec/base/core.py @@ -534,6 +534,8 @@ class VariantTherapeuticResponseProposition( ) +# Any new proposition type should be added to this union, and ONLY this union +# should be used when annotating a proposition property _SubjectVariantPropositionType: TypeAlias = ( ExperimentalVariantFunctionalImpactProposition | VariantPathogenicityProposition