{ "cells": [ { "cell_type": "markdown", "id": "3f1f3663", "metadata": {}, "source": [ "# One CellProfiler export\n", "\n", "{func}`~mantispy.ds.jump_export` is a single, unmodified `ExportToSpreadsheet` directory, one field of view of a DMSO well of `BR00121438` {cite:p}`Chandrasekaran_2023`. It is the example input for {func}`~mantispy.io.read_profiles`: the raw `Image.csv` plus the `Cells`, `Cytoplasm` and `Nuclei` tables, exactly as CellProfiler wrote them. The images this was measured from are in {func}`~mantispy.ds.jump_plate`, and the well-level profiles of the same plate in {func}`~mantispy.ds.jump_target2`.\n", "\n", "**Use it if** you have your own CellProfiler `ExportToSpreadsheet` output and want to read it into cells. [From a CellProfiler run](../tutorials/data/cellprofiler.ipynb) walks through that on this directory." ] }, { "cell_type": "code", "execution_count": 1, "id": "20cab890", "metadata": { "execution": { "iopub.execute_input": "2026-10-21T00:58:22.905248Z", "iopub.status.busy": "2026-10-21T00:58:22.904872Z", "iopub.status.idle": "2026-10-21T00:58:26.216381Z", "shell.execute_reply": "2026-10-21T00:58:26.214577Z" } }, "outputs": [], "source": [ "import mantispy as mt" ] }, { "cell_type": "code", "execution_count": 2, "id": "a19fb984", "metadata": { "execution": { "iopub.execute_input": "2026-10-21T00:58:26.220474Z", "iopub.status.busy": "2026-10-21T00:58:26.220219Z", "iopub.status.idle": "2026-10-21T00:58:26.862265Z", "shell.execute_reply": "2026-10-21T00:58:26.861111Z" } }, "outputs": [ { "data": { "text/plain": [ "['Cells.csv', 'Cytoplasm.csv', 'Experiment.csv', 'Image.csv', 'Nuclei.csv']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "directory = mt.ds.jump_export()\n", "sorted(p.name for p in directory.iterdir())" ] }, { "cell_type": "markdown", "id": "1b5e2505", "metadata": {}, "source": [ "## Reading it into cells\n", "\n", "`Cytoplasm` is the only object the JUMP pipeline gives a parent in both `Cells` and `Nuclei`, so it is the one that joins all three tables, and one cytoplasm is one cell." ] }, { "cell_type": "code", "execution_count": 3, "id": "65755bcc", "metadata": { "execution": { "iopub.execute_input": "2026-10-21T00:58:26.865622Z", "iopub.status.busy": "2026-10-21T00:58:26.865399Z", "iopub.status.idle": "2026-10-21T00:58:29.344904Z", "shell.execute_reply": "2026-10-21T00:58:29.343760Z" } }, "outputs": [ { "data": { "text/plain": [ "AnnData object with n_obs × n_vars = 239 × 5839\n", " obs: 'Metadata_ImageNumber', 'Metadata_ObjectNumber', 'Metadata_CellsObjectNumber', 'Metadata_NucleiObjectNumber', 'Metadata_AbsPositionZ', 'Metadata_AbsTime', 'Metadata_BinningX', 'Metadata_BinningY', 'Metadata_ChannelID', 'Metadata_ChannelName', 'Metadata_Col', 'Metadata_ExposureTime', 'Metadata_FieldID', 'Metadata_ImageResolutionX', 'Metadata_ImageResolutionY', 'Metadata_ImageSizeX', 'Metadata_ImageSizeY', 'Metadata_MainEmissionWavelength', 'Metadata_MainExcitationWavelength', 'Metadata_MaxIntensity', 'Metadata_ObjectiveMagnification', 'Metadata_ObjectiveNA', 'Metadata_PlaneID', 'Metadata_Plate', 'Metadata_PositionX', 'Metadata_PositionY', 'Metadata_PositionZ', 'Metadata_Row', 'Metadata_Site', 'Metadata_Well', 'Metadata_Center_X', 'Metadata_Center_Y', 'Metadata_ObjectType', 'Metadata_ImageID'\n", " var: 'object', 'feature_group', 'feature', 'channel', 'scale', 'angle', 'gray_levels', 'radial_bin', 'params', 'is_feature', 'feature_kind'\n", " uns: 'mantispy'\n", " layers: None (.X)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import warnings\n", "\n", "with warnings.catch_warnings():\n", " warnings.simplefilter(\"ignore\")\n", " cells = mt.io.read_profiles(directory, primary_object=\"Cytoplasm\", resolution=\"object\")\n", "cells" ] }, { "cell_type": "markdown", "id": "4d32f3c2", "metadata": {}, "source": [ "The metadata columns that came off the export name each cell by its plate, well, site and object number." ] }, { "cell_type": "code", "execution_count": 4, "id": "135ac6a8", "metadata": { "execution": { "iopub.execute_input": "2026-10-21T00:58:29.348336Z", "iopub.status.busy": "2026-10-21T00:58:29.348177Z", "iopub.status.idle": "2026-10-21T00:58:29.358288Z", "shell.execute_reply": "2026-10-21T00:58:29.356919Z" } }, "outputs": [ { "data": { "text/html": [ "
| \n", " | Metadata_Plate | \n", "Metadata_Well | \n", "Metadata_Site | \n", "Metadata_ObjectNumber | \n", "
|---|---|---|---|---|
| 0 | \n", "BR00121438 | \n", "J04 | \n", "1 | \n", "1 | \n", "
| 1 | \n", "BR00121438 | \n", "J04 | \n", "1 | \n", "2 | \n", "
| 2 | \n", "BR00121438 | \n", "J04 | \n", "1 | \n", "3 | \n", "
| 3 | \n", "BR00121438 | \n", "J04 | \n", "1 | \n", "4 | \n", "
| 4 | \n", "BR00121438 | \n", "J04 | \n", "1 | \n", "5 | \n", "