torchcell.datamodels.schema.VisualScorePhenotype

class VisualScorePhenotype(*, provenance_gaps: list[~torchcell.verification.sourced.ProvenanceGap] = <factory>, graph_level: str = 'global', label_name: str = 'visual_score', label_statistic_name: str | None = None, visual_score: float, visual_score_min: float | None = None, n_replicates: int, score_scale_min: int, score_scale_max: int, score_semantics: str, target_product: str, target_metabolite_id: str | None = None, score_text: str | None = None, comment_annotations: dict[str, bool] | None = None)[source]

Bases: Phenotype, ModelStrict

Ordinal visual-inspection score as a proxy for a metabolite/product level.

For screens where a metabolite is read out by a qualitative visual signal rather than a quantitative assay. Ozaydin 2005/2013: colony COLOR on a -5..+5 scale is a visual proxy for carotenoid (beta-carotene) accumulation – more orange/red colony = more product. The score is a SUBJECTIVE ORDINAL, not a quantitative abundance; downstream models must treat it ordinally.

Metabolite linkage (Yeast9): target_product names the metabolite the score is a proxy for (e.g. “beta-carotene”). Heterologous products (carotenoids, betalains) are NOT native to Yeast9, so target_metabolite_id – an optional Yeast9 s_NNNN metabolite id for constraint-based-model linkage – is left None until the metabolic-model mapping is decided; the fields here capture the data a CBM would need, without committing to that mapping.

validate_visual_score() → VisualScorePhenotype[source]

Enforce a coherent ordinal scale and score/replicate bounds.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].