mantispy.tl.cytotoxicity

Contents

mantispy.tl.cytotoxicity#

mantispy.tl.cytotoxicity(adata, groupby='Metadata_Perturbation', reference='negcon', count_key='Metadata_CellCount', distance_key='hits_distance', min_viability=0.7, key_added='cytotoxicity', copy=False)[source]#

Flag perturbations that both lost cells and moved away from the controls.

Parameters:
  • adata (AnnData) – Profiles carrying a per-well cell count and a per-row distance from the controls.

  • groupby (str (default: 'Metadata_Perturbation')) – The column defining a perturbation.

  • reference (str | None (default: 'negcon')) – Rows whose median cell count defines a viability of 1.0.

  • count_key (str (default: 'Metadata_CellCount')) – obs column holding the cell count.

  • distance_key (str (default: 'hits_distance')) – obs column holding the distance from the controls, as written by hit_calling().

  • min_viability (float (default: 0.7)) – Fraction of the control cell count below which a group counts as having lost cells.

  • key_added (str (default: 'cytotoxicity')) – Name for the outputs.

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

Return type:

AnnData | None

Returns:

None, or the modified copy. Writes uns["mantispy"][key_added] with group, viability, distance, n_obs and suspect, and broadcasts obs[key_added + "_suspect"].

Notes

A group is suspect when its viability is below min_viability and its median distance is above that of the controls. Cell loss alone is a phenotype, and a large distance alone is a hit. Together they are suspect because a well with a fifth of its cells has a noisier median and drifts from the controls regardless of the biology. On a synthetic plate with one purely cytotoxic perturbation and its morphology effect removed, that perturbation’s distance was 21.1 against 7.0 for the controls.

The flag is a diagnostic and does not correct the distances. How much cytotoxicity confounds a screen varies. Over the pki dose series, the rank correlation between phenotype distance and cell loss is +0.79 (p < 1e-8) and the four strongest hits have viabilities of 0.27 to 0.68. Over rohban2017’s ORF overexpression the same correlation is +0.00 (p = 0.95). Measure it on your own screen.