torchcell.datamodels.schema.StrainReferenceGenome
- class StrainReferenceGenome(*, provenance_gaps: list[~torchcell.verification.sourced.ProvenanceGap] = <factory>, species: str, strain: str, ploidy: ~typing.Literal['haploid', 'diploid'] = 'haploid', assembly_set: ~typing.Literal['ecoli_K12_MG1655_ASM584v2', 'ecoli_K12_BW25113_ASM75055v1', 'pputida_KT2440_ASM756v2', 'ecoli_B_REL606_ASM1798v1', 'ecoli_K12_W3110_ASM1024v1', 'sgd_S288C_R64-4-1_20230830', 'scerevisiae_CENPK113-7D_ASM257140v2'] | None, assembly_accession: str | None, background: ~torchcell.datamodels.schema.StrainBackground | ~torchcell.datamodels.schema.EukaryoticStrainBackground)[source]
Bases:
ReferenceGenomeA
ReferenceGenomethat states its typed strain background (#507).backgroundis REQUIRED and holds the content the strain carries beyond the pinned assembly: aStrainBackground(reference strain, assembly set, genotype statement, alleles) or itsEukaryoticStrainBackgroundsubclass, which adds the mating type, the ploidy and the integrated cassettes. Itsnameequalsstrainso the free string and the typed object cannot disagree, and it pins the SAMEassembly_setas this reference: since P5 that is one rule read on every family rather than a yeast branch pinning S288C by name and a bacterial branch comparing the two fields. AEukaryoticStrainBackgroundalso agrees onploidy, the one fact this class and the background both carry. The union is the typed home the retiredAssemblyReferenceGenome’s optionalbackgroundhad, with the requiredness this class has always had.An
ExperimentReferenceholds its reference asReferenceGenome | StrainReferenceGenome, so the background survives serialization in every experiment family without a narrowed clone of the pair: measured on pydantic 2.12.3, a subclass in a base-or-subclass union dumps its own fields and revalidates to the subclass, because the base forbids extras. The record stores it once per reference (the LMDB interns the whole reference; the graph writes it on thegenomeandexperiment referencenodes).- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].