mantispy.pp.annotate_controls

mantispy.pp.annotate_controls#

mantispy.pp.annotate_controls(adata, negcon=('DMSO',), poscon=None, perturbation_key=None, copy=False)#

Mark negative (and optionally positive) controls.

Parameters:
  • adata (AnnData) – Object to annotate.

  • negcon (Sequence[str] (default: ('DMSO',))) – Perturbation values that are negative controls.

  • poscon (Sequence[str] | None (default: None)) – Perturbation values that are positive controls, if any.

  • perturbation_key (str | None (default: None)) – Column holding the perturbation, auto-detected from PERTURBATION_KEYS when omitted.

  • copy (bool (default: False)) – Return a modified copy instead of mutating in place.

Return type:

AnnData | None

Returns:

None, or the modified copy when copy=True. Writes obs["Metadata_Control"] and, when poscon is given, obs["Metadata_Control_Type"].