|
| 1 | +"""VA Spec Assay Variant Effect statement and study result Profiles""" |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +from enum import Enum |
| 6 | +from typing import Literal |
| 7 | + |
| 8 | +from ga4gh.cat_vrs.core_models import CategoricalVariant |
| 9 | +from ga4gh.core.entity_models import ( |
| 10 | + IRI, |
| 11 | + Coding, |
| 12 | + DataSet, |
| 13 | + Method, |
| 14 | + StatementBase, |
| 15 | + StudyGroup, |
| 16 | + StudyResult, |
| 17 | + StudyResultBase, |
| 18 | +) |
| 19 | +from ga4gh.vrs.models import MolecularVariation |
| 20 | +from pydantic import ConfigDict, Field |
| 21 | + |
| 22 | + |
| 23 | +class AveFunctionalClassification(str, Enum): |
| 24 | + """The functional classification of the variant effect in the assay.""" |
| 25 | + |
| 26 | + NORMAL = "normal" |
| 27 | + INDETERMINATE = "indeterminate" |
| 28 | + ABNORMAL = "abnormal" |
| 29 | + |
| 30 | + |
| 31 | +class AveClinicalClassification(str, Enum): |
| 32 | + """The clinical strength of evidence of the variant effect in the assay.""" |
| 33 | + |
| 34 | + PS3_STRONG = "PS3_Strong" |
| 35 | + PS3_MODERATE = "PS3_Moderate" |
| 36 | + PS3_SUPPORTING = "PS3_Supporting" |
| 37 | + BS3_STRONG = "BS3_Strong" |
| 38 | + BS3_MODERATE = "BS3_Moderate" |
| 39 | + BS3_SUPPORTING = "BS3_Supporting" |
| 40 | + |
| 41 | + |
| 42 | +class AssayVariantEffectFunctionalClassificationStatement(StatementBase): |
| 43 | + """A statement that assigns a functional classification to a variant effect from a functional assay.""" |
| 44 | + |
| 45 | + model_config = ConfigDict(use_enum_values=True) |
| 46 | + |
| 47 | + type: Literal["AssayVariantEffectFunctionalClassificationStatement"] = Field( |
| 48 | + "AssayVariantEffectFunctionalClassificationStatement", |
| 49 | + description="MUST be 'AssayVariantEffectFunctionalClassificationStatement'.", |
| 50 | + ) |
| 51 | + subjectVariant: MolecularVariation | CategoricalVariant | IRI = Field( |
| 52 | + ..., |
| 53 | + description="A protein or genomic contextual or canonical molecular variant.", |
| 54 | + ) |
| 55 | + predicate: Literal["hasAssayVariantEffectFor"] = Field( |
| 56 | + "hasAssayVariantEffectFor", |
| 57 | + description="The relationship declared to hold between the subject and the object of the Statement.", |
| 58 | + ) |
| 59 | + objectAssay: IRI | Coding = Field( |
| 60 | + ..., |
| 61 | + description="The assay that is evaluated for the variant effect. (e.g growth in haploid cell culture protein stability in fluorescence assay)", |
| 62 | + ) |
| 63 | + classification: AveFunctionalClassification = Field( |
| 64 | + ..., |
| 65 | + description="The functional classification of the variant effect in the assay.", |
| 66 | + ) |
| 67 | + specifiedBy: Method | IRI | None = Field( |
| 68 | + None, |
| 69 | + description="The method that specifies the functional classification of the variant effect in the assay.", |
| 70 | + ) |
| 71 | + |
| 72 | + |
| 73 | +class AssayVariantEffectClinicalClassificationStatement(StatementBase): |
| 74 | + """A statement that assigns a clinical strength of evidence to a variant effect from a functional assay.""" |
| 75 | + |
| 76 | + model_config = ConfigDict(use_enum_values=True) |
| 77 | + |
| 78 | + type: Literal["AssayVariantEffectClinicalClassificationStatement"] = Field( |
| 79 | + "AssayVariantEffectClinicalClassificationStatement", |
| 80 | + description="MUST be 'AssayVariantEffectClinicalClassificationStatement'.", |
| 81 | + ) |
| 82 | + subjectVariant: MolecularVariation | CategoricalVariant | IRI = Field( |
| 83 | + ..., |
| 84 | + description="A protein or genomic contextual or canonical molecular variant.", |
| 85 | + ) |
| 86 | + predicate: Literal["hasAssayVariantEffectFor"] = Field( |
| 87 | + "hasAssayVariantEffectFor", |
| 88 | + description="The relationship declared to hold between the subject and the object of the Statement.", |
| 89 | + ) |
| 90 | + objectAssay: IRI | Coding = Field( |
| 91 | + ..., |
| 92 | + description="The assay that is evaluated for the variant effect. (e.g growth in haploid cell culture protein stability in fluorescence assay)", |
| 93 | + ) |
| 94 | + classification: AveClinicalClassification = Field( |
| 95 | + ..., |
| 96 | + description="The clinical strength of evidence of the variant effect in the assay.", |
| 97 | + ) |
| 98 | + specifiedBy: Method | IRI | None = Field( |
| 99 | + None, |
| 100 | + description="The method that specifies the clinical strength of evidence of the variant effect in the assay.", |
| 101 | + ) |
| 102 | + |
| 103 | + |
| 104 | +class AssayVariantEffectMeasurementStudyResult(StudyResultBase): |
| 105 | + """A StudyResult that reports a variant effect score from a functional assay.""" |
| 106 | + |
| 107 | + model_config = ConfigDict(use_enum_values=True) |
| 108 | + |
| 109 | + type: Literal["AssayVariantEffectMeasurementStudyResult"] = Field( |
| 110 | + "AssayVariantEffectMeasurementStudyResult", |
| 111 | + description="MUST be 'AssayVariantEffectMeasurementStudyResult'.", |
| 112 | + ) |
| 113 | + componentResult: list[StudyResult] | None = Field( |
| 114 | + None, |
| 115 | + description="Another StudyResult comprised of data items about the same focus as its parent Result, but based on a more narrowly scoped analysis of the foundational data (e.g. an analysis based on data about a subset of the parent Results full study population) .", |
| 116 | + ) |
| 117 | + studyGroup: StudyGroup | None = Field( |
| 118 | + None, |
| 119 | + description="A description of a specific group or population of subjects interrogated in the ResearchStudy that produced the data captured in the StudyResult.", |
| 120 | + ) |
| 121 | + focusVariant: MolecularVariation | IRI | None = Field( |
| 122 | + None, |
| 123 | + description="The human mapped representation of the variant that is the subject of the Statement.", |
| 124 | + ) |
| 125 | + score: float | None = Field( |
| 126 | + None, description="The score of the variant effect in the assay." |
| 127 | + ) |
| 128 | + specifiedBy: Method | IRI | None = Field( |
| 129 | + None, |
| 130 | + description="The assay that was used to measure the variant effect with all the various properties", |
| 131 | + ) |
| 132 | + sourceDataSet: list[DataSet] | None = Field( |
| 133 | + None, description="The full data set that this measurement is a part of" |
| 134 | + ) |
0 commit comments