torchcell.datamodels.identity.strain_background_identity

strain_background_identity(background: StrainBackground) → dict[str, Any][source]

Project a strain background onto its genome content, dropping who stated it.

Two datasets that both state BY4741 (one quoting its paper, one carrying a pending-review gap) produce different model_dump``s and so different ``genome node ids; this projection is the join key that says they state the same strain: name, reference strain, assembly set and the sorted allele set, plus mating type, ploidy and the sorted set of integrated cassettes for a EukaryoticStrainBackground. parents, construction, the verbatim genotype statement, provenance and gaps are dropped. Integrations are IN, because a cassette at a named site is genome content exactly as an allele is: bAID and bAID-X3::SIZ1i carry the same alleles and are not the same strain.

One projection per concrete class, because the three eukaryote fields exist on one of them: before P5 they were read unconditionally, so a background without them could not be projected at all, and projecting a subclass as its base would drop them and merge two strains onto one key. An unknown subclass therefore raises rather than falling through to the base’s fields. Not used for node ids (the genome node id is unchanged); it is the cross-dataset comparison key.