{ "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", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Metadata_PlateMetadata_WellMetadata_SiteMetadata_ObjectNumber
0BR00121438J0411
1BR00121438J0412
2BR00121438J0413
3BR00121438J0414
4BR00121438J0415
\n", "
" ], "text/plain": [ " Metadata_Plate Metadata_Well Metadata_Site Metadata_ObjectNumber\n", "0 BR00121438 J04 1 1\n", "1 BR00121438 J04 1 2\n", "2 BR00121438 J04 1 3\n", "3 BR00121438 J04 1 4\n", "4 BR00121438 J04 1 5" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cells.obs[[\"Metadata_Plate\", \"Metadata_Well\", \"Metadata_Site\", \"Metadata_ObjectNumber\"]].head()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.15" } }, "nbformat": 4, "nbformat_minor": 5 }