mantispy.pp.annotate_controls#
- mantispy.pp.annotate_controls(adata, negcon=('DMSO',), poscon=None, perturbation_key=None, copy=False)[source]#
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 fromPERTURBATION_KEYSwhen omitted.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy whencopy=True. Writesobs["Metadata_Control_Type"]and the booleanobs["Metadata_Control"]it implies (Truefor any control). Steps defaulting toreference="negcon"read the type column, so the negcon rows are selected by it alone.
Notes
The classes named here are authoritative: rows matching
negconbecome"negcon"and earlier"negcon"rows that no longer match become treatments, and likewise forposconwhen it is given. Every other class an upstream annotation set, such as"poscon"or"empty"wells from a plate map orannotate_jump(), is kept.