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 whoseobs["Metadata_Control"]marks the wells to draw.groupby (
str(default:'Metadata_Plate')) –obscolumn 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, orNonefor a new figure.
- Return type:
- Returns:
The axes drawn on, with one scatter per group of
groupbyin the space of the first two control components.- Raises:
KeyError –
obshas noMetadata_Controlcolumn to select the controls with, or nogroupbycolumn.ValueError – There are
n_componentscontrol rows or fewer, too few to fit that many components.