mantispy.pl.control_drift

Contents

mantispy.pl.control_drift#

mantispy.pl.control_drift(adata, groupby='Metadata_Plate', n_components=2, ax=None)#

Control wells projected onto principal components fitted on the controls alone.

Fitting on the controls alone shows how the reference moves between plates or batches, which is the drift normalization should remove.

Parameters:
  • adata (AnnData) – Object whose obs["Metadata_Control"] marks the wells to draw.

  • groupby (str (default: 'Metadata_Plate')) – obs column that colors the control wells, normally the plate or the batch.

  • n_components (int (default: 2)) – Components fitted on the controls. The first two are the ones drawn.

  • ax (Axes | None (default: None)) – Axes to draw on, or None for a new figure.

Return type:

Axes

Returns:

The axes drawn on, with one scatter per group of groupby in the space of the first two control components.

Raises:
  • KeyErrorobs has no Metadata_Control column to select the controls with, or no groupby column.

  • ValueError – There are n_components control rows or fewer, too few to fit that many components.