torchcell.datamodels.schema.ReferenceGenome

class ReferenceGenome(*, 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)[source]

Bases: HashableProvenanceGapMixin

The deposited reference a record’s identifiers and background edits are written against.

species and strain name the host as the source writes it. ploidy is the genome-wide baseline copy number of the unperturbed strain ("haploid" = 1 autosomal copy, "diploid" = 2). It lives here, not on a perturbation, because it applies to the WHOLE genome (WT and every unperturbed gene alike); a per-locus EngineeredCopyNumberPerturbation.copy_number records the deviation from this baseline. Defaults to "haploid".

assembly_set is the deposited set in the genomes tier (sha256-pinned FASTA plus GFF) that the record’s gene identifiers and coordinates, and the background’s edits, are written against. It has ONE meaning, and that meaning is NOT “this strain’s own assembly”: a BY4741 or FY4 record pins sgd_S288C_R64-4-1_20230830 because its systematic names and its background alleles are edits against the S288C release, exactly as a BW25113 record pins the BW25113 set because its locus tags are that assembly’s. Since P5 that is literally one rule: a StrainBackground pins the set of its own reference_strain, and StrainReferenceGenome requires the reference and the background to pin the same one.

The pin is REQUIRED: a value, or a typed ProvenanceGap on assembly_set for a record whose reference is not deposited in the tier (an isolate’s own annotation, a BL21 ECBD_ tag space). Depositing the set is what closes such a gap, so its reason is deferred_pending_source_review with note naming the reference to deposit. A silent default to S288C would be a fallback; the field has no default, so every loader states its reference. assembly_accession is the NCBI accession of the pinned set (GenBank GCA_ or RefSeq GCF_, one of that set’s own in ASSEMBLY_SET_ACCESSIONS): required whenever a set is pinned and None exactly when the set is gapped.

This is the reference of a record whose strain IS the deposited reference. A typed strain background is carried by StrainReferenceGenome (#507), whose background is required. Hashable through the mixin (the canonical JSON), as it was before it carried a gap list.

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

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