torchcell.datamodels.identity.environment_perturbation_identity

environment_perturbation_identity(perturbation: Any) → dict[str, Any][source]

Project an environment perturbation onto its typed slots.

The discriminator plus the slots of the concrete leaf: compound key, dose and vehicle for a small molecule; factor, magnitude and realizing agent for a physical factor; agent class, name, accession, sequence and dose for a biologic; phage name, taxon, genome accession and the multiplicity of infection for a phage; factor, the three dose fields and the stated apparatus for a physical exposure. description is dropped (it is a per-dataset restatement of the leaf’s own default). The dose IS part of identity on every dosed leaf: two doses of one compound are two different edits to the environment.