celldisect.PerturbationEmbedding.add_perturbation

PerturbationEmbedding.add_perturbation(name: str, embedding: numpy.ndarray | None = None) int[source]

Register a new perturbation (possibly unseen during training).

Parameters:
  • name – Perturbation label. Can be combinatorial ("A+B").

  • embedding – Vector for an atomic perturbation that is not yet in the predefined dictionary. Ignored for names already known.

Return type:

Integer index of the (new or existing) perturbation.