mantispy.pl.setting_agreement

mantispy.pl.setting_agreement#

mantispy.pl.setting_agreement(adata, key='transport', by=None, cluster=True, ax=None)#

Settings against settings: which plates, batches or laboratories agree with each other.

Uses the same effect vectors as transport(), compared between settings instead of between perturbations. Two settings agree when the perturbations they share moved the same way in both, weighted by effect size, so agreement on inactive compounds counts for little.

Parameters:
  • adata (AnnData) – Object transport() has run on.

  • key (str (default: 'transport')) – The key it was stored under.

  • by (str | None (default: None)) – obs column to annotate the settings with, e.g. "Metadata_Source" when the units are plates. Settings are ordered by it with a line at each boundary, so a laboratory whose plates disagree shows as a broken block.

  • cluster (bool (default: True)) – Order the settings by similarity instead. Ignored when by is given.

  • ax (Axes | None (default: None)) – Axes to draw into.

Return type:

Axes

Returns:

The axes drawn on, holding the settings-by-settings agreement matrix with a white line at each by boundary.

Raises:

KeyErroruns["mantispy"] holds no key + "_units" matrix, or by was given and no obs column names the settings it holds.