mantispy.ds.jump_cells

Contents

mantispy.ds.jump_cells#

mantispy.ds.jump_cells(annotate=True, selected=False, cache_dir=None, *, aggregated=False)[source]#

Single cells from one JUMP plate, as CellProfiler measured them.

Twenty-four wells of BR00121438 at four fields of view each: eight DMSO wells, four compounds with both of their replicate wells, and eight more compounds at one well. The strongest movers on this plate are cytotoxic, so ranking wells by distance alone selects for empty wells; every well here holds more than 120 cells in its first field.

The same plate’s well-level profiles are jump_target2(), so a profile aggregated from these cells can be compared with the one the consortium published.

The annotated cells, their feature-selected block and their well-level aggregate are pre-built by scripts/build_staged_datasets.py from the 480 raw CellProfiler tables and rehosted on scverse-exampledata, so the loader fetches a single h5ad rather than reassembling the object on every call. Passing annotate=False still assembles the raw, un-annotated cells locally, downloading about 1.5 GB of CellProfiler output and caching the assembled object.

Parameters:
  • annotate (bool (default: True)) – Fetch the annotated cells, which carry Metadata_Perturbation and Metadata_Control. False assembles the raw cells locally, without the annotation join. Needed for selected and aggregated.

  • selected (bool (default: False)) – Return only the features var["selected"] marks, as mantispy.pp.subset_features() would (87 MB instead of 308 MB).

  • cache_dir (str | Path | None (default: None)) – Where to keep the download. Defaults to mantispy.settings.cache_dir.

  • aggregated (bool (default: False)) – Return one median profile per well (Metadata_Plate, Metadata_Well) instead of the cells, with Metadata_CellCount and Metadata_SiteCount, so it lines up with the well-level jump_target2().

Raises:
  • KeyError – selected or aggregated was asked for without annotate, so there is no annotation to select or group against.

  • ValueError – selected and aggregated were both asked for; there is no aggregated feature-selected variant.

Return type:

AnnData

Returns:

Cells by features at cell resolution (one median per well when aggregated), read with mantispy.io.read(), carrying Metadata_Source, Metadata_Plate, Metadata_Well, Metadata_Site and, when annotated, Metadata_JCP2022, Metadata_Perturbation, Metadata_Perturbation_Type ("compound"), Metadata_InChIKey and Metadata_Control. When annotated, var["selected"] marks the features feature selection keeps, so the object can be reduced with adata[:, adata.var["selected"]] the way scanpy’s highly_variable is used. The aggregated well profiles carry Metadata_CellCount over the four fields read and a Metadata_SiteCount of four, so a well counts about four ninths of the cells jump_target2() gives it over all nine.

References

Chandrasekaran et al. [2023].