torchcell.datamodels.schema.SegregantGenotype

class SegregantGenotype(*, cross: str, segregant_id: str, parent_1: SegregantParent, parent_2: SegregantParent, blocks: list[HaplotypeBlock], call_method: str, marker_matrix_sha256: str)[source]

Bases: ModelStrict

Strain-level haplotype mosaic of one haploid segregant from a two-parent cross.

blocks partition the called markers of every chromosome into runs of one parent and one posterior (see HaplotypeBlock); the per-marker call matrix is a derived view (re-expand each block at the cross’s marker positions). A hard-call release (posterior 1.0 everywhere) gives one block per parent run; a released posterior that changes along a run of one parent splits that run at each change. call_method records how the released calls were produced (quoted from the source’s code), and marker_matrix_sha256 pins the released matrix the blocks were encoded from.

property n_blocks: int

Number of haplotype blocks across all chromosomes.

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

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