torchcell.data.MeanExperimentDeduplicator

class MeanExperimentDeduplicator(root: str)[source]

Bases: Deduplicator

Deduplicate experiments by averaging duplicates of the same genotype.

duplicate_check(data: list[dict[str, Any]]) → dict[str, list[int]][source]

Group data indices by hash of experiment type and perturbed genes.

duplicate_key(record: dict[str, Any]) → str[source]

Return the duplicate-group hash for one raw record dict.

Identical key construction to duplicate_check() – experiment type plus the sorted perturbed gene names – read straight off the stored JSON so the streaming process never builds pydantic objects to group.

create_deduplicate_entry(duplicate_experiments: list[dict[str, Any]]) → dict[str, Any][source]

Return a single mean entry for a group of duplicate experiments.