torchcell.datamodels.schema.MetabolitePhenotype

class MetabolitePhenotype(*, provenance_gaps: list[~torchcell.verification.sourced.ProvenanceGap] = <factory>, graph_level: str = 'metabolism', label_name: str = 'metabolite_level', label_statistic_name: str | None = 'metabolite_level_se', metabolite_level: dict[str, float], metabolite_level_se: dict[str, float] | None = None, n_replicates: dict[str, int], measurement_type: str, target_metabolite_ids: dict[str, str] | None = None)[source]

Bases: Phenotype, ModelStrict

Quantitative metabolite/product level(s), keyed by metabolite id.

For assays that QUANTIFY one or more metabolite levels per strain – e.g. Cachera 2023 CRI-SPA (corrected colony HSV yellowness score as a proxy for the metabolite betaxanthin), or (later) mass-spec metabolite abundances (Zelezniak). Levels are keyed by metabolite id: a Yeast9 s_NNNN id where the metabolite is native, or a plain product name for heterologous products (carotenoids, betalains) not in Yeast9.

measurement_type records WHAT the number is (e.g. a normalized colony-color score, which can be negative, vs an absolute abundance), so heterogeneous assays stay interpretable and are never silently compared. target_metabolite_ids maps the keys to Yeast9 s_NNNN ids for constraint-based-model linkage where known (None until the mapping is decided – capture the data, defer the modeling).

validate_metabolite_level() → MetabolitePhenotype[source]

Require non-empty levels and consistent per-metabolite replicate keys.

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

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