{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Identification of High Curl, High Elongation, Low Elongation, High Linearity and Low Linearity cell types - DLPFC 151508" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "-DzZ7eYKWfr4", "outputId": "1562c047-712b-479c-b22c-e1173a4d79ba" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting cellcharter\n", " Downloading cellcharter-0.3.7-py3-none-any.whl.metadata (9.8 kB)\n", "Collecting anndata (from cellcharter)\n", " Downloading anndata-0.12.16-py3-none-any.whl.metadata (9.9 kB)\n", "Requirement already satisfied: rasterio in /usr/local/lib/python3.12/dist-packages (from cellcharter) (1.5.0)\n", "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.12/dist-packages (from cellcharter) (1.6.1)\n", "Collecting session-info (from cellcharter)\n", " Downloading session_info-1.0.1-py3-none-any.whl.metadata (5.1 kB)\n", "Collecting sknw (from cellcharter)\n", " Downloading sknw-0.15-py3-none-any.whl.metadata (367 bytes)\n", "Collecting spatialdata (from cellcharter)\n", " Downloading spatialdata-0.7.3-py3-none-any.whl.metadata (9.8 kB)\n", "Collecting spatialdata-plot (from cellcharter)\n", " Downloading spatialdata_plot-0.3.4-py3-none-any.whl.metadata (7.4 kB)\n", "Collecting squidpy>=1.6.3 (from cellcharter)\n", " Downloading squidpy-1.8.1-py3-none-any.whl.metadata (8.2 kB)\n", "Collecting torchgmm>=0.1.4 (from cellcharter)\n", " Downloading torchgmm-0.1.4-py3-none-any.whl.metadata (7.8 kB)\n", "Requirement already satisfied: aiohttp>=3.8.1 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (3.13.5)\n", "Requirement already satisfied: cycler>=0.11 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (0.12.1)\n", "Collecting dask-image>=0.5 (from squidpy>=1.6.3->cellcharter)\n", " Downloading dask_image-2025.11.0-py3-none-any.whl.metadata (2.8 kB)\n", "Requirement already satisfied: dask>=2021.2 in /usr/local/lib/python3.12/dist-packages (from dask[array]>=2021.2->squidpy>=1.6.3->cellcharter) (2026.3.0)\n", "Collecting docrep>=0.3.1 (from squidpy>=1.6.3->cellcharter)\n", " Downloading docrep-0.3.2.tar.gz (33 kB)\n", " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", "Collecting fast-array-utils (from squidpy>=1.6.3->cellcharter)\n", " Downloading fast_array_utils-1.4.1-py3-none-any.whl.metadata (2.7 kB)\n", "Requirement already satisfied: fsspec>=2021.11 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (2025.3.0)\n", "Collecting imagecodecs<2026,>=2025.8.2 (from squidpy>=1.6.3->cellcharter)\n", " Downloading imagecodecs-2025.11.11-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (20 kB)\n", "Collecting matplotlib-scalebar>=0.8 (from squidpy>=1.6.3->cellcharter)\n", " Downloading matplotlib_scalebar-0.9.0-py3-none-any.whl.metadata (18 kB)\n", "Requirement already satisfied: matplotlib>=3.3 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (3.10.0)\n", "Requirement already satisfied: networkx>=2.6 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (3.6.1)\n", "Requirement already satisfied: numba>=0.56.4 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (0.60.0)\n", "Requirement already satisfied: numpy>=1.23 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (2.0.2)\n", "Collecting omnipath>=1.0.7 (from squidpy>=1.6.3->cellcharter)\n", " Downloading omnipath-1.0.12-py3-none-any.whl.metadata (7.0 kB)\n", "Requirement already satisfied: pandas>=2.1 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (2.2.2)\n", "Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (11.3.0)\n", "Requirement already satisfied: pooch>=1.6 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (1.9.0)\n", "Requirement already satisfied: pyyaml>=6 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (6.0.3)\n", "Collecting scanpy>=1.9.3 (from squidpy>=1.6.3->cellcharter)\n", " Downloading scanpy-1.12.1-py3-none-any.whl.metadata (8.4 kB)\n", "Requirement already satisfied: scikit-image>=0.25 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (0.25.2)\n", "Requirement already satisfied: statsmodels>=0.12 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (0.14.6)\n", "Requirement already satisfied: tifffile!=2022.4.22 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (2026.4.11)\n", "Requirement already satisfied: tqdm>=4.50.2 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (4.67.3)\n", "Collecting validators>=0.18.2 (from squidpy>=1.6.3->cellcharter)\n", " Downloading validators-0.35.0-py3-none-any.whl.metadata (3.9 kB)\n", "Requirement already satisfied: xarray>=2024.10 in /usr/local/lib/python3.12/dist-packages (from squidpy>=1.6.3->cellcharter) (2025.12.0)\n", "Collecting zarr>=3 (from squidpy>=1.6.3->cellcharter)\n", " Downloading zarr-3.2.1-py3-none-any.whl.metadata (8.7 kB)\n", "Collecting array-api-compat>=1.7.1 (from anndata->cellcharter)\n", " Downloading array_api_compat-1.14.0-py3-none-any.whl.metadata (2.5 kB)\n", "Requirement already satisfied: h5py>=3.8 in /usr/local/lib/python3.12/dist-packages (from anndata->cellcharter) (3.16.0)\n", "Collecting legacy-api-wrap (from anndata->cellcharter)\n", " Downloading legacy_api_wrap-1.5-py3-none-any.whl.metadata (2.2 kB)\n", "Requirement already satisfied: natsort in /usr/local/lib/python3.12/dist-packages (from anndata->cellcharter) (8.4.0)\n", "Requirement already satisfied: packaging>=24.2 in /usr/local/lib/python3.12/dist-packages (from anndata->cellcharter) (26.1)\n", "Requirement already satisfied: scipy!=1.17.0,>=1.12 in /usr/local/lib/python3.12/dist-packages (from anndata->cellcharter) (1.16.3)\n", "Collecting scverse-misc>=0.0.3 (from anndata->cellcharter)\n", " Downloading scverse_misc-0.0.7-py3-none-any.whl.metadata (4.5 kB)\n", "Requirement already satisfied: joblib>=1.2.0 in /usr/local/lib/python3.12/dist-packages (from scikit-learn->cellcharter) (1.5.3)\n", "Requirement already satisfied: threadpoolctl>=3.1.0 in /usr/local/lib/python3.12/dist-packages (from scikit-learn->cellcharter) (3.6.0)\n", "Collecting annsel>=0.1.2 (from spatialdata->cellcharter)\n", " Downloading annsel-0.1.2-py3-none-any.whl.metadata (19 kB)\n", "Requirement already satisfied: click in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (8.3.3)\n", "Collecting dask>=2021.2 (from dask[array]>=2021.2->squidpy>=1.6.3->cellcharter)\n", " Downloading dask-2026.1.1-py3-none-any.whl.metadata (3.8 kB)\n", "Collecting datashader (from spatialdata->cellcharter)\n", " Downloading datashader-0.19.1-py3-none-any.whl.metadata (8.0 kB)\n", "Collecting distributed<2026.1.2 (from spatialdata->cellcharter)\n", " Downloading distributed-2026.1.1-py3-none-any.whl.metadata (3.4 kB)\n", "Requirement already satisfied: geopandas>=0.14 in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (1.1.3)\n", "Collecting multiscale-spatial-image==2.0.3 (from spatialdata->cellcharter)\n", " Downloading multiscale_spatial_image-2.0.3-py3-none-any.whl.metadata (25 kB)\n", "Collecting ome-zarr>=0.14.0 (from spatialdata->cellcharter)\n", " Downloading ome_zarr-0.16.0-py3-none-any.whl.metadata (2.9 kB)\n", "Requirement already satisfied: pyarrow in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (18.1.0)\n", "Requirement already satisfied: rich in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (13.9.4)\n", "Requirement already satisfied: setuptools in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (75.2.0)\n", "Requirement already satisfied: shapely>=2.0.1 in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (2.1.2)\n", "Collecting spatial-image>=1.2.3 (from spatialdata->cellcharter)\n", " Downloading spatial_image-1.2.3-py3-none-any.whl.metadata (7.0 kB)\n", "Requirement already satisfied: typing-extensions>=4.8.0 in /usr/local/lib/python3.12/dist-packages (from spatialdata->cellcharter) (4.15.0)\n", "Collecting universal-pathlib>=0.2.6 (from spatialdata->cellcharter)\n", " Downloading universal_pathlib-0.3.10-py3-none-any.whl.metadata (39 kB)\n", "Collecting xarray-spatial>=0.3.5 (from spatialdata->cellcharter)\n", " Downloading xarray_spatial-0.9.9-py3-none-any.whl.metadata (54 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.5/54.5 kB\u001b[0m \u001b[31m1.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: python-dateutil in /usr/local/lib/python3.12/dist-packages (from multiscale-spatial-image==2.0.3->spatialdata->cellcharter) (2.9.0.post0)\n", "Collecting xarray-dataclass>=3.0.0 (from multiscale-spatial-image==2.0.3->spatialdata->cellcharter)\n", " Downloading xarray_dataclass-3.0.0-py3-none-any.whl.metadata (14 kB)\n", "Collecting pytorch-lightning>=2.0.0 (from torchgmm>=0.1.4->cellcharter)\n", " Downloading pytorch_lightning-2.6.4-py3-none-any.whl.metadata (21 kB)\n", "Requirement already satisfied: torch>1.11.0 in /usr/local/lib/python3.12/dist-packages (from torchgmm>=0.1.4->cellcharter) (2.10.0+cpu)\n", "Collecting torchmetrics>=0.6 (from torchgmm>=0.1.4->cellcharter)\n", " Downloading torchmetrics-1.9.0-py3-none-any.whl.metadata (23 kB)\n", "Requirement already satisfied: affine in /usr/local/lib/python3.12/dist-packages (from rasterio->cellcharter) (2.4.0)\n", "Requirement already satisfied: attrs in /usr/local/lib/python3.12/dist-packages (from rasterio->cellcharter) (26.1.0)\n", "Requirement already satisfied: certifi in /usr/local/lib/python3.12/dist-packages (from rasterio->cellcharter) (2026.4.22)\n", "Requirement already satisfied: cligj>=0.5 in /usr/local/lib/python3.12/dist-packages (from rasterio->cellcharter) (0.7.2)\n", "Requirement already satisfied: pyparsing in /usr/local/lib/python3.12/dist-packages (from rasterio->cellcharter) (3.3.2)\n", "Collecting stdlib_list (from session-info->cellcharter)\n", " Downloading stdlib_list-0.12.0-py3-none-any.whl.metadata (3.3 kB)\n", "Requirement already satisfied: aiohappyeyeballs>=2.5.0 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (2.6.1)\n", "Requirement already satisfied: aiosignal>=1.4.0 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (1.4.0)\n", "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (1.8.0)\n", "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (6.7.1)\n", "Requirement already satisfied: propcache>=0.2.0 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (0.4.1)\n", "Requirement already satisfied: yarl<2.0,>=1.17.0 in /usr/local/lib/python3.12/dist-packages (from aiohttp>=3.8.1->squidpy>=1.6.3->cellcharter) (1.23.0)\n", "Requirement already satisfied: more-itertools>=10.7 in /usr/local/lib/python3.12/dist-packages (from annsel>=0.1.2->spatialdata->cellcharter) (10.8.0)\n", "Requirement already satisfied: narwhals>=2.14 in /usr/local/lib/python3.12/dist-packages (from narwhals[pandas]>=2.14->annsel>=0.1.2->spatialdata->cellcharter) (2.20.0)\n", "Collecting session-info2 (from annsel>=0.1.2->spatialdata->cellcharter)\n", " Downloading session_info2-0.4.1-py3-none-any.whl.metadata (2.5 kB)\n", "Requirement already satisfied: cloudpickle>=3.0.0 in /usr/local/lib/python3.12/dist-packages (from dask>=2021.2->dask[array]>=2021.2->squidpy>=1.6.3->cellcharter) (3.1.2)\n", "Requirement already satisfied: partd>=1.4.0 in /usr/local/lib/python3.12/dist-packages (from dask>=2021.2->dask[array]>=2021.2->squidpy>=1.6.3->cellcharter) (1.4.2)\n", "Requirement already satisfied: toolz>=0.12.0 in /usr/local/lib/python3.12/dist-packages (from dask>=2021.2->dask[array]>=2021.2->squidpy>=1.6.3->cellcharter) (0.12.1)\n", "Collecting pims>=0.4.1 (from dask-image>=0.5->squidpy>=1.6.3->cellcharter)\n", " Downloading pims-0.7.tar.gz (87 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m87.8/87.8 kB\u001b[0m \u001b[31m3.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", "INFO: pip is looking at multiple versions of dask[array] to determine which version is compatible with other requirements. This could take a while.\n", "Collecting dask[array]>=2021.2 (from squidpy>=1.6.3->cellcharter)\n", " Downloading dask-2026.1.2-py3-none-any.whl.metadata (3.8 kB)\n", "Requirement already satisfied: jinja2>=2.10.3 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (3.1.6)\n", "Requirement already satisfied: locket>=1.0.0 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (1.0.0)\n", "Requirement already satisfied: msgpack>=1.0.2 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (1.1.2)\n", "Requirement already satisfied: psutil>=5.8.0 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (5.9.5)\n", "Collecting sortedcontainers>=2.0.5 (from distributed<2026.1.2->spatialdata->cellcharter)\n", " Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl.metadata (10 kB)\n", "Collecting tblib!=3.2.0,!=3.2.1,>=1.6.0 (from distributed<2026.1.2->spatialdata->cellcharter)\n", " Downloading tblib-3.2.2-py3-none-any.whl.metadata (27 kB)\n", "Requirement already satisfied: tornado>=6.2.0 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (6.5.1)\n", "Requirement already satisfied: urllib3>=1.26.5 in /usr/local/lib/python3.12/dist-packages (from distributed<2026.1.2->spatialdata->cellcharter) (2.5.0)\n", "Collecting zict>=3.0.0 (from distributed<2026.1.2->spatialdata->cellcharter)\n", " Downloading zict-3.0.0-py2.py3-none-any.whl.metadata (899 bytes)\n", "Requirement already satisfied: six in /usr/local/lib/python3.12/dist-packages (from docrep>=0.3.1->squidpy>=1.6.3->cellcharter) (1.17.0)\n", "Requirement already satisfied: pyogrio>=0.7.2 in /usr/local/lib/python3.12/dist-packages (from geopandas>=0.14->spatialdata->cellcharter) (0.12.1)\n", "Requirement already satisfied: pyproj>=3.5.0 in /usr/local/lib/python3.12/dist-packages (from geopandas>=0.14->spatialdata->cellcharter) (3.7.2)\n", "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.12/dist-packages (from matplotlib>=3.3->squidpy>=1.6.3->cellcharter) (1.3.3)\n", "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.12/dist-packages (from matplotlib>=3.3->squidpy>=1.6.3->cellcharter) (4.62.1)\n", "Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.12/dist-packages (from matplotlib>=3.3->squidpy>=1.6.3->cellcharter) (1.5.0)\n", "Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in /usr/local/lib/python3.12/dist-packages (from numba>=0.56.4->squidpy>=1.6.3->cellcharter) (0.43.0)\n", "INFO: pip is looking at multiple versions of ome-zarr to determine which version is compatible with other requirements. This could take a while.\n", "Collecting ome-zarr>=0.14.0 (from spatialdata->cellcharter)\n", " Downloading ome_zarr-0.15.0-py3-none-any.whl.metadata (2.9 kB)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.12/dist-packages (from ome-zarr>=0.14.0->spatialdata->cellcharter) (2.32.4)\n", "Collecting rangehttpserver (from ome-zarr>=0.14.0->spatialdata->cellcharter)\n", " Downloading rangehttpserver-1.4.0-py2.py3-none-any.whl.metadata (769 bytes)\n", "Collecting Deprecated (from ome-zarr>=0.14.0->spatialdata->cellcharter)\n", " Downloading deprecated-1.3.1-py2.py3-none-any.whl.metadata (5.9 kB)\n", "Requirement already satisfied: inflect>=4.1.0 in /usr/local/lib/python3.12/dist-packages (from omnipath>=1.0.7->squidpy>=1.6.3->cellcharter) (7.5.0)\n", "Requirement already satisfied: wrapt>=1.12.0 in /usr/local/lib/python3.12/dist-packages (from omnipath>=1.0.7->squidpy>=1.6.3->cellcharter) (2.1.2)\n", "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.12/dist-packages (from pandas>=2.1->squidpy>=1.6.3->cellcharter) (2025.2)\n", "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.12/dist-packages (from pandas>=2.1->squidpy>=1.6.3->cellcharter) (2026.1)\n", "Requirement already satisfied: platformdirs>=2.5.0 in /usr/local/lib/python3.12/dist-packages (from pooch>=1.6->squidpy>=1.6.3->cellcharter) (4.9.6)\n", "Collecting lightning-utilities>=0.10.0 (from pytorch-lightning>=2.0.0->torchgmm>=0.1.4->cellcharter)\n", " Downloading lightning_utilities-0.15.3-py3-none-any.whl.metadata (5.5 kB)\n", "Collecting pandas>=2.1 (from squidpy>=1.6.3->cellcharter)\n", " Downloading pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (91 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m91.2/91.2 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: patsy in /usr/local/lib/python3.12/dist-packages (from scanpy>=1.9.3->squidpy>=1.6.3->cellcharter) (1.0.2)\n", "Requirement already satisfied: pynndescent>=0.5.13 in /usr/local/lib/python3.12/dist-packages (from scanpy>=1.9.3->squidpy>=1.6.3->cellcharter) (0.6.0)\n", "Requirement already satisfied: seaborn>=0.13.2 in /usr/local/lib/python3.12/dist-packages (from scanpy>=1.9.3->squidpy>=1.6.3->cellcharter) (0.13.2)\n", "Requirement already satisfied: umap-learn>=0.5.12 in /usr/local/lib/python3.12/dist-packages (from scanpy>=1.9.3->squidpy>=1.6.3->cellcharter) (0.5.12)\n", "Requirement already satisfied: imageio!=2.35.0,>=2.33 in /usr/local/lib/python3.12/dist-packages (from scikit-image>=0.25->squidpy>=1.6.3->cellcharter) (2.37.3)\n", "Requirement already satisfied: lazy-loader>=0.4 in /usr/local/lib/python3.12/dist-packages (from scikit-image>=0.25->squidpy>=1.6.3->cellcharter) (0.5)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.12/dist-packages (from torch>1.11.0->torchgmm>=0.1.4->cellcharter) (3.29.0)\n", "Requirement already satisfied: sympy>=1.13.3 in /usr/local/lib/python3.12/dist-packages (from torch>1.11.0->torchgmm>=0.1.4->cellcharter) (1.14.0)\n", "Collecting pathlib-abc<0.6.0,>=0.5.1 (from universal-pathlib>=0.2.6->spatialdata->cellcharter)\n", " Downloading pathlib_abc-0.5.2-py3-none-any.whl.metadata (4.6 kB)\n", "Requirement already satisfied: zstandard in /usr/local/lib/python3.12/dist-packages (from xarray-spatial>=0.3.5->spatialdata->cellcharter) (0.25.0)\n", "Collecting donfig>=0.8 (from zarr>=3->squidpy>=1.6.3->cellcharter)\n", " Downloading donfig-0.8.1.post1-py3-none-any.whl.metadata (5.0 kB)\n", "Requirement already satisfied: google-crc32c>=1.5 in /usr/local/lib/python3.12/dist-packages (from zarr>=3->squidpy>=1.6.3->cellcharter) (1.8.0)\n", "Collecting numcodecs>=0.14 (from zarr>=3->squidpy>=1.6.3->cellcharter)\n", " Downloading numcodecs-0.16.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (3.4 kB)\n", "Requirement already satisfied: colorcet in /usr/local/lib/python3.12/dist-packages (from datashader->spatialdata->cellcharter) (3.1.0)\n", "Requirement already satisfied: multipledispatch in /usr/local/lib/python3.12/dist-packages (from datashader->spatialdata->cellcharter) (1.0.0)\n", "Requirement already satisfied: param in /usr/local/lib/python3.12/dist-packages (from datashader->spatialdata->cellcharter) (2.3.3)\n", "Collecting pyct (from datashader->spatialdata->cellcharter)\n", " Downloading pyct-0.6.0-py3-none-any.whl.metadata (7.2 kB)\n", "Collecting s3fs (from fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading s3fs-2026.4.0-py3-none-any.whl.metadata (1.2 kB)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.12/dist-packages (from rich->spatialdata->cellcharter) (4.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.12/dist-packages (from rich->spatialdata->cellcharter) (2.20.0)\n", "Requirement already satisfied: typeguard>=4.0.1 in /usr/local/lib/python3.12/dist-packages (from inflect>=4.1.0->omnipath>=1.0.7->squidpy>=1.6.3->cellcharter) (4.5.1)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.12/dist-packages (from jinja2>=2.10.3->distributed<2026.1.2->spatialdata->cellcharter) (3.0.3)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.12/dist-packages (from markdown-it-py>=2.2.0->rich->spatialdata->cellcharter) (0.1.2)\n", "Collecting slicerator>=0.9.8 (from pims>=0.4.1->dask-image>=0.5->squidpy>=1.6.3->cellcharter)\n", " Downloading slicerator-1.1.0-py3-none-any.whl.metadata (1.9 kB)\n", "Requirement already satisfied: charset_normalizer<4,>=2 in /usr/local/lib/python3.12/dist-packages (from requests->ome-zarr>=0.14.0->spatialdata->cellcharter) (3.4.7)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.12/dist-packages (from requests->ome-zarr>=0.14.0->spatialdata->cellcharter) (3.13)\n", "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.12/dist-packages (from sympy>=1.13.3->torch>1.11.0->torchgmm>=0.1.4->cellcharter) (1.3.0)\n", "Collecting aiobotocore<4.0.0,>=2.19.0 (from s3fs->fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading aiobotocore-3.7.0-py3-none-any.whl.metadata (28 kB)\n", "INFO: pip is looking at multiple versions of s3fs to determine which version is compatible with other requirements. This could take a while.\n", "Collecting s3fs (from fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading s3fs-2026.3.0-py3-none-any.whl.metadata (1.2 kB)\n", " Downloading s3fs-2026.2.0-py3-none-any.whl.metadata (1.2 kB)\n", " Downloading s3fs-2026.1.0-py3-none-any.whl.metadata (1.2 kB)\n", " Downloading s3fs-2025.12.0-py3-none-any.whl.metadata (1.2 kB)\n", "Collecting aiobotocore<3.0.0,>=2.5.4 (from s3fs->fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading aiobotocore-2.26.0-py3-none-any.whl.metadata (25 kB)\n", "Collecting s3fs (from fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading s3fs-2025.10.0-py3-none-any.whl.metadata (1.4 kB)\n", " Downloading s3fs-2025.9.0-py3-none-any.whl.metadata (1.4 kB)\n", " Downloading s3fs-2025.7.0-py3-none-any.whl.metadata (1.4 kB)\n", "INFO: pip is still looking at multiple versions of s3fs to determine which version is compatible with other requirements. This could take a while.\n", " Downloading s3fs-2025.5.1-py3-none-any.whl.metadata (1.9 kB)\n", " Downloading s3fs-2025.5.0-py3-none-any.whl.metadata (1.9 kB)\n", " Downloading s3fs-2025.3.2-py3-none-any.whl.metadata (1.9 kB)\n", " Downloading s3fs-2025.3.1-py3-none-any.whl.metadata (1.9 kB)\n", " Downloading s3fs-2025.3.0-py3-none-any.whl.metadata (1.9 kB)\n", "Collecting aioitertools<1.0.0,>=0.5.1 (from aiobotocore<3.0.0,>=2.5.4->s3fs->fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading aioitertools-0.13.0-py3-none-any.whl.metadata (3.3 kB)\n", "Collecting botocore<1.41.6,>=1.41.0 (from aiobotocore<3.0.0,>=2.5.4->s3fs->fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading botocore-1.41.5-py3-none-any.whl.metadata (5.9 kB)\n", "Collecting jmespath<2.0.0,>=0.7.1 (from aiobotocore<3.0.0,>=2.5.4->s3fs->fsspec[http,s3]->spatialdata->cellcharter)\n", " Downloading jmespath-1.1.0-py3-none-any.whl.metadata (7.6 kB)\n", "Collecting wrapt>=1.12.0 (from omnipath>=1.0.7->squidpy>=1.6.3->cellcharter)\n", " Downloading wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.4 kB)\n", "Downloading cellcharter-0.3.7-py3-none-any.whl (51 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.3/51.3 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading squidpy-1.8.1-py3-none-any.whl (193 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m193.9/193.9 kB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading anndata-0.12.16-py3-none-any.whl (175 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m175.3/175.3 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading spatialdata-0.7.3-py3-none-any.whl (199 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m199.2/199.2 kB\u001b[0m \u001b[31m13.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading multiscale_spatial_image-2.0.3-py3-none-any.whl (29 kB)\n", "Downloading torchgmm-0.1.4-py3-none-any.whl (46 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.1/46.1 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading session_info-1.0.1-py3-none-any.whl (9.1 kB)\n", "Downloading sknw-0.15-py3-none-any.whl (4.6 kB)\n", "Downloading spatialdata_plot-0.3.4-py3-none-any.whl (93 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m93.3/93.3 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading annsel-0.1.2-py3-none-any.whl (19 kB)\n", "Downloading array_api_compat-1.14.0-py3-none-any.whl (60 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.1/60.1 kB\u001b[0m \u001b[31m2.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading dask-2026.1.1-py3-none-any.whl (1.5 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.5/1.5 MB\u001b[0m \u001b[31m44.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading dask_image-2025.11.0-py3-none-any.whl (61 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.9/61.9 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading distributed-2026.1.1-py3-none-any.whl (1.0 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m41.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading imagecodecs-2025.11.11-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.2 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m23.2/23.2 MB\u001b[0m \u001b[31m42.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading matplotlib_scalebar-0.9.0-py3-none-any.whl (16 kB)\n", "Downloading ome_zarr-0.15.0-py3-none-any.whl (45 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.2/45.2 kB\u001b[0m \u001b[31m2.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading omnipath-1.0.12-py3-none-any.whl (51 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.6/51.6 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading pytorch_lightning-2.6.4-py3-none-any.whl (852 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m852.2/852.2 kB\u001b[0m \u001b[31m37.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading scanpy-1.12.1-py3-none-any.whl (2.1 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m52.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading fast_array_utils-1.4.1-py3-none-any.whl (39 kB)\n", "Downloading legacy_api_wrap-1.5-py3-none-any.whl (10 kB)\n", "Downloading pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (12.4 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.4/12.4 MB\u001b[0m \u001b[31m57.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading scverse_misc-0.0.7-py3-none-any.whl (13 kB)\n", "Downloading spatial_image-1.2.3-py3-none-any.whl (8.7 kB)\n", "Downloading torchmetrics-1.9.0-py3-none-any.whl (983 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m983.4/983.4 kB\u001b[0m \u001b[31m34.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading universal_pathlib-0.3.10-py3-none-any.whl (83 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m83.5/83.5 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading validators-0.35.0-py3-none-any.whl (44 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.7/44.7 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading xarray_spatial-0.9.9-py3-none-any.whl (13.3 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.3/13.3 MB\u001b[0m \u001b[31m33.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading zarr-3.2.1-py3-none-any.whl (319 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m319.6/319.6 kB\u001b[0m \u001b[31m13.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading datashader-0.19.1-py3-none-any.whl (10.7 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m10.7/10.7 MB\u001b[0m \u001b[31m32.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading stdlib_list-0.12.0-py3-none-any.whl (87 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m87.6/87.6 kB\u001b[0m \u001b[31m5.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading donfig-0.8.1.post1-py3-none-any.whl (21 kB)\n", "Downloading lightning_utilities-0.15.3-py3-none-any.whl (31 kB)\n", "Downloading numcodecs-0.16.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.2 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.2/9.2 MB\u001b[0m \u001b[31m54.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading pathlib_abc-0.5.2-py3-none-any.whl (19 kB)\n", "Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)\n", "Downloading tblib-3.2.2-py3-none-any.whl (12 kB)\n", "Downloading xarray_dataclass-3.0.0-py3-none-any.whl (16 kB)\n", "Downloading zict-3.0.0-py2.py3-none-any.whl (43 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m43.3/43.3 kB\u001b[0m \u001b[31m1.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading deprecated-1.3.1-py2.py3-none-any.whl (11 kB)\n", "Downloading pyct-0.6.0-py3-none-any.whl (16 kB)\n", "Downloading rangehttpserver-1.4.0-py2.py3-none-any.whl (7.8 kB)\n", "Downloading s3fs-2025.3.0-py3-none-any.whl (30 kB)\n", "Downloading session_info2-0.4.1-py3-none-any.whl (17 kB)\n", "Downloading aiobotocore-2.26.0-py3-none-any.whl (87 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m87.3/87.3 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (88 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m88.0/88.0 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading slicerator-1.1.0-py3-none-any.whl (10 kB)\n", "Downloading aioitertools-0.13.0-py3-none-any.whl (24 kB)\n", "Downloading botocore-1.41.5-py3-none-any.whl (14.3 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m14.3/14.3 MB\u001b[0m \u001b[31m56.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hDownloading jmespath-1.1.0-py3-none-any.whl (20 kB)\n", "Building wheels for collected packages: docrep, pims\n", " Building wheel for docrep (setup.py) ... \u001b[?25l\u001b[?25hdone\n", " Created wheel for docrep: filename=docrep-0.3.2-py3-none-any.whl size=19876 sha256=ce85806312bcfa7ef7d2679d6a69238fb323ee512d88106fac566ea013da6f81\n", " Stored in directory: /root/.cache/pip/wheels/d6/19/ee/0a6a1793d91c449563b49ccab57ce52da3e6fab7614836bd8c\n", " Building wheel for pims (setup.py) ... \u001b[?25l\u001b[?25hdone\n", " Created wheel for pims: filename=PIMS-0.7-py3-none-any.whl size=84590 sha256=9845009da27c50089849569edf21c466c25c6f8334201f7e02d140e083350e10\n", " Stored in directory: /root/.cache/pip/wheels/be/9c/72/7cb84823aaa980c2e44064caae0ba869239270fac14f7129aa\n", "Successfully built docrep pims\n", "Installing collected packages: sortedcontainers, slicerator, rangehttpserver, zict, wrapt, validators, tblib, stdlib_list, session-info2, pyct, pathlib-abc, numcodecs, lightning-utilities, legacy-api-wrap, jmespath, imagecodecs, fast-array-utils, donfig, docrep, array-api-compat, aioitertools, zarr, universal-pathlib, sknw, session-info, scverse-misc, pims, pandas, Deprecated, dask, botocore, torchmetrics, omnipath, matplotlib-scalebar, distributed, anndata, aiobotocore, xarray-spatial, xarray-dataclass, s3fs, pytorch-lightning, datashader, annsel, torchgmm, spatial-image, scanpy, dask-image, ome-zarr, multiscale-spatial-image, spatialdata, spatialdata-plot, squidpy, cellcharter\n", " Attempting uninstall: wrapt\n", " Found existing installation: wrapt 2.1.2\n", " Uninstalling wrapt-2.1.2:\n", " Successfully uninstalled wrapt-2.1.2\n", " Attempting uninstall: pandas\n", " Found existing installation: pandas 2.2.2\n", " Uninstalling pandas-2.2.2:\n", " Successfully uninstalled pandas-2.2.2\n", " Attempting uninstall: dask\n", " Found existing installation: dask 2026.3.0\n", " Uninstalling dask-2026.3.0:\n", " Successfully uninstalled dask-2026.3.0\n", "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", "google-colab 1.0.0 requires pandas==2.2.2, but you have pandas 2.3.3 which is incompatible.\u001b[0m\u001b[31m\n", "\u001b[0mSuccessfully installed Deprecated-1.3.1 aiobotocore-2.26.0 aioitertools-0.13.0 anndata-0.12.16 annsel-0.1.2 array-api-compat-1.14.0 botocore-1.41.5 cellcharter-0.3.7 dask-2026.1.1 dask-image-2025.11.0 datashader-0.19.1 distributed-2026.1.1 docrep-0.3.2 donfig-0.8.1.post1 fast-array-utils-1.4.1 imagecodecs-2025.11.11 jmespath-1.1.0 legacy-api-wrap-1.5 lightning-utilities-0.15.3 matplotlib-scalebar-0.9.0 multiscale-spatial-image-2.0.3 numcodecs-0.16.5 ome-zarr-0.15.0 omnipath-1.0.12 pandas-2.3.3 pathlib-abc-0.5.2 pims-0.7 pyct-0.6.0 pytorch-lightning-2.6.4 rangehttpserver-1.4.0 s3fs-2025.3.0 scanpy-1.12.1 scverse-misc-0.0.7 session-info-1.0.1 session-info2-0.4.1 sknw-0.15 slicerator-1.1.0 sortedcontainers-2.4.0 spatial-image-1.2.3 spatialdata-0.7.3 spatialdata-plot-0.3.4 squidpy-1.8.1 stdlib_list-0.12.0 tblib-3.2.2 torchgmm-0.1.4 torchmetrics-1.9.0 universal-pathlib-0.3.10 validators-0.35.0 wrapt-1.17.3 xarray-dataclass-3.0.0 xarray-spatial-0.9.9 zarr-3.2.1 zict-3.0.0\n" ] } ], "source": [ "!pip install cellcharter\n", "!pip install squidpy\n", "!pip install scanpy" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "FZMdJrze1DrZ" }, "outputs": [], "source": [ "import squidpy as sq\n", "import cellcharter as cc\n", "import scanpy as sc\n", "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "\n", "flag = True\n", "df_val = pd.DataFrame()" ] }, { "cell_type": "markdown", "metadata": { "id": "9DOTptaLXs5Q" }, "source": [ "Mounting google drive to accessing input data" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "sszU7MS-XsCl", "outputId": "edff9364-240f-4365-dd7e-4c2dc3a158a1" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mounted at /content/drive\n" ] } ], "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ] }, { "cell_type": "markdown", "metadata": { "id": "WLAaLOfi5Xot" }, "source": [ "Shape Characterization" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "j_hk64PqYaze" }, "outputs": [], "source": [ "def cellcharter_metrics(data_name, category, data_path, ctp_path):\n", "\n", " global flag, df_val\n", "\n", " adata = sc.read_h5ad(data_path)\n", " ctp = pd.read_csv(ctp_path)\n", " print (\"ctp shape\", ctp.shape, \"and\", ctp.columns)\n", "\n", " if (adata.shape[0] != ctp.shape[0]):\n", " adata = adata[adata.obs_names.isin(ctp[ctp.columns[0]])]\n", "\n", " print (\"adata shape\", adata.shape)\n", "\n", " for c in ctp.columns[1:]:\n", " threshold = np.median(ctp[c].values)\n", " adata.obs[c + \"_spatial_cluster\"] = (ctp[c] > threshold).astype(int).values\n", "\n", " sq.gr.spatial_neighbors(adata, coord_type = 'generic', delaunay = True) # library_key='sample',\n", "\n", " for c in ctp.columns[1:]:\n", "\n", " cc.gr.connected_components(adata, cluster_key = c + '_spatial_cluster')\n", " cc.tl.boundaries(adata, min_hole_area_ratio = 0.1)\n", " cc.tl.linearity(adata)\n", " cc.tl.curl(adata)\n", " cc.tl.elongation(adata)\n", "\n", " adata.obs.rename(columns = {'component': c +'_component'}, inplace = True)\n", " #print (adata)\n", " mapping = pd.DataFrame({\"Act\" : adata.obs[c + \"_spatial_cluster\"].values, \"Pred\" : adata.obs[c + \"_component\"].values})\n", " mapping = mapping.drop_duplicates()\n", "\n", " #adata.uns[c + '_shape_component'] = adata.uns.pop('shape_component')\n", "\n", " t = mapping.drop_duplicates()\n", " t = t[t[\"Act\"] == 1]\n", " t.dropna(inplace = True)\n", "\n", " comp_itr = 1\n", " for comp in t[\"Pred\"].values:\n", "\n", " linearity = adata.uns[\"shape_component\"][\"linearity\"][comp]\n", " curl = adata.uns[\"shape_component\"][\"curl\"][comp]\n", " elongation = adata.uns[\"shape_component\"][\"elongation\"][comp]\n", "\n", " if (flag):\n", " df_val[\"Category\"] = [category]\n", " df_val[\"Dataset\"] = [data_name]\n", " df_val[\"cell_type\"] = [c + \"_\" + str(comp_itr)]\n", " df_val[\"linearity\"] = [linearity]\n", " df_val[\"curl\"] = [curl]\n", " df_val[\"elongation\"] = [elongation]\n", "\n", " #print (df_val)\n", " comp_itr += 1\n", " flag = False\n", " else:\n", " new_row = {\"Category\" : category, \"Dataset\" : data_name, \"cell_type\": c + \"_\" + str(comp_itr), \"linearity\" : linearity, \"curl\" : curl, \"elongation\" : elongation}\n", " comp_itr += 1\n", " #df_val = df_val.append(new_row, ignore_index = True)\n", " df_val = pd.concat([df_val, pd.DataFrame([new_row])], ignore_index=True)\n", " #print (df_val)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "NNA8JFAzXsJW", "outputId": "8628962e-61f9-474e-f767-c70d46636d6e" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ctp shape (4382, 18) and Index(['Unnamed: 0', 'AST_FB', 'AST_PP', 'Endothelial', 'IN_PV', 'IN_SST',\n", " 'IN_SV2C', 'IN_VIP', 'L2_3', 'L4', 'L5_6', 'L5_6_CC', 'Microglia',\n", " 'Neu_NRGN_I', 'Neu_NRGN_II', 'Neu_mat', 'OPC', 'Oligodendrocytes'],\n", " dtype='object')\n", "adata shape (4382, 11403)\n", "\u001b[34mINFO \u001b[0m Creating graph using `generic` coordinates and `\u001b[3;35mNone\u001b[0m` transform and `\u001b[1;36m1\u001b[0m` libraries. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n", "/tmp/ipykernel_3161/929752537.py:24: FutureWarning: linearity is deprecated and will be removed in the next release. Please use `linearity_metric` instead.\n", " cc.tl.linearity(adata)\n", "/tmp/ipykernel_3161/929752537.py:25: FutureWarning: curl is deprecated and will be removed in the next release. Please use `curl_metric` instead.\n", " cc.tl.curl(adata)\n", "/tmp/ipykernel_3161/929752537.py:26: FutureWarning: elongation is deprecated and will be removed in the next release. Please use `elongation_metric` instead.\n", " cc.tl.elongation(adata)\n" ] } ], "source": [ "lst = {\n", " \"Brain\" : [\"151508\"], # \"151673\", \"151508\", \"151509\", \"151669\", \"151670\"\n", " \"Cancer\": [],\n", " \"Development\" : []\n", " }\n", "\n", "path = \"/content/drive/MyDrive/Major_project/Benchmarking_Shared/spDDB_tutorials/\"\n", "\n", "for l in lst[\"Brain\"]:\n", "\n", " data_path = path + \"1_data/synthetic_spatial_gene_exp/simulated_spatial_gene_expression.h5ad\"\n", " ctp_path = path + \"4_data/Simulated_cell_type_proportion_DLPFC_151508.csv\"\n", "\n", " cellcharter_metrics(l, \"Brain\", data_path, ctp_path)" ] }, { "cell_type": "markdown", "metadata": { "id": "ifpHHj4M5sBt" }, "source": [ "Specify metrics" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "ggR2qJlBYr9q" }, "outputs": [], "source": [ "metric = \"linearity\" # \"elongation\" # \"curl\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "zv5MmCoXYucB" }, "outputs": [], "source": [ "def consider_all_comps(ct_lst):\n", "\n", " new_ct_lst = []\n", "\n", " for b in ct_lst:\n", " b_clip = b[:-1]\n", " new_ct_lst += [b]\n", "\n", " last_char = b[-1]\n", "\n", " new_ct_lst += [b_clip + str(d) for d in range(1, int(last_char))]\n", "\n", " return new_ct_lst\n", "\n", "def get_top_bottom_25(df_subset, per, m):\n", "\n", " df_subset = df_subset[[\"cell_type\", m]]\n", " df_subset = df_subset.groupby('cell_type')[m].median().reset_index()\n", "\n", " # Rename the columns for clarity (optional)\n", " df_subset.columns = ['cell_type', m]\n", "\n", " sorted_df = df_subset.sort_values(by = m).reset_index(drop = True)\n", " bottom_cts = sorted_df[: round(per*len(sorted_df))][[\"cell_type\", m]]\n", "\n", " per_neg = 1 - per\n", " top_cts = sorted_df[round(per_neg*len(sorted_df)) : ][[\"cell_type\", m]]\n", " #print (bottom_cts, top_cts)\n", "\n", " new_bottom_cts = consider_all_comps(bottom_cts[\"cell_type\"].values)\n", " new_top_cts = consider_all_comps(top_cts[\"cell_type\"].values)\n", " return new_bottom_cts, new_top_cts" ] }, { "cell_type": "markdown", "metadata": { "id": "woDgzjlN58lT" }, "source": [ "Top and Bottom cell types with chosen shape metrics for Brain datasets" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "03BqC2NWZEbc", "outputId": "0c98d87e-5093-474d-ccb9-bb8d35c6d201" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Category Dataset cell_type linearity curl elongation\n", "0 Brain 151508 AST_FB_1 0.763348 0.110810 0.110016\n", "1 Brain 151508 AST_FB_1 0.763348 0.110810 0.110016\n", "2 Brain 151508 AST_PP_1 1.000000 0.000000 0.345660\n", "3 Brain 151508 AST_PP_2 1.000000 0.101009 0.653668\n", "4 Brain 151508 Endothelial_1 0.941555 0.556208 0.052118\n", "5 Brain 151508 IN_PV_1 0.576744 0.343922 0.000154\n", "6 Brain 151508 IN_SST_1 0.726808 0.000000 0.052081\n", "7 Brain 151508 IN_SV2C_1 0.913603 0.000000 0.345682\n", "8 Brain 151508 IN_VIP_1 1.000000 0.000000 0.331758\n", "9 Brain 151508 L2_3_1 0.798326 0.032302 0.150539\n", "10 Brain 151508 L4_1 1.000000 0.000000 0.414979\n", "11 Brain 151508 L5_6_1 1.000000 0.000000 0.471710\n", "12 Brain 151508 L5_6_CC_1 1.000000 0.000000 0.492478\n", "13 Brain 151508 Microglia_1 0.795943 0.000000 0.396660\n", "14 Brain 151508 Microglia_2 0.927239 0.000000 0.658984\n", "15 Brain 151508 Neu_NRGN_I_1 0.816390 0.326698 0.052081\n", "16 Brain 151508 Neu_NRGN_II_1 1.000000 0.000000 0.462463\n", "17 Brain 151508 Neu_mat_1 0.747737 0.000000 0.144467\n", "18 Brain 151508 OPC_1 1.000000 0.170473 0.365133\n", "19 Brain 151508 OPC_2 0.875739 0.000000 0.655748\n", "20 Brain 151508 Oligodendrocytes_1 1.000000 0.006502 0.427947\n" ] } ], "source": [ "print (df_val)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "jvV8_06c54_C", "outputId": "a58693ed-f881-44ba-f393-d3493b1459c6" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Bottom ['IN_PV_1', 'IN_SST_1', 'Neu_mat_1', 'AST_FB_1', 'Microglia_1'] \n", " Top ['AST_PP_2', 'AST_PP_1', 'Neu_NRGN_II_1', 'L4_1', 'OPC_1', 'Oligodendrocytes_1'] \n", "\n", "\n", "\n" ] } ], "source": [ "### Linearity\n", "df_brain = df_val[df_val[\"Category\"] == \"Brain\"]\n", "dfs = []\n", "\n", "Organs = {\n", " \"DLPFC\" : ['151508'] # '151674', '151508', '151509', '151669', '151670'\n", " #\"Mouse_brain\" : ['Mouse_brain_ST48', 'Mouse_brain_ST52']\n", "}\n", "\n", "for key in Organs.keys():\n", "\n", " data = Organs[key]\n", " #print (data)\n", " df_subset = df_brain[df_brain[\"Dataset\"].isin(data)].reset_index(drop = True)\n", "\n", " #print (df_subset.shape)\n", " bottom_cts, top_cts = get_top_bottom_25(df_subset, 0.25, metric)\n", " print (\"Bottom\", bottom_cts, \"\\n Top\", top_cts, \"\\n\\n\\n\")\n", "\n", " df_bottom = df_subset[df_subset[\"cell_type\"].isin(bottom_cts)].reset_index(drop = True)\n", " df_bottom[\"type\"] = \"bottom\"\n", " dfs += [df_bottom]\n", "\n", " df_top = df_subset[df_subset[\"cell_type\"].isin(top_cts)].reset_index(drop = True)\n", " df_top[\"type\"] = \"top\"\n", " dfs += [df_top]\n", "\n", "df_shape_brain = pd.concat(dfs, axis = 0).reset_index(drop = True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "cfwD9xNqZWFg", "outputId": "41f516e7-e702-4253-bee3-c06b476be651" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Category Dataset cell_type linearity curl elongation \\\n", "0 Brain 151508 AST_FB_1 0.763348 0.110810 0.110016 \n", "1 Brain 151508 AST_FB_1 0.763348 0.110810 0.110016 \n", "2 Brain 151508 IN_PV_1 0.576744 0.343922 0.000154 \n", "3 Brain 151508 IN_SST_1 0.726808 0.000000 0.052081 \n", "4 Brain 151508 Microglia_1 0.795943 0.000000 0.396660 \n", "5 Brain 151508 Neu_mat_1 0.747737 0.000000 0.144467 \n", "6 Brain 151508 AST_PP_1 1.000000 0.000000 0.345660 \n", "7 Brain 151508 AST_PP_2 1.000000 0.101009 0.653668 \n", "8 Brain 151508 L4_1 1.000000 0.000000 0.414979 \n", "9 Brain 151508 Neu_NRGN_II_1 1.000000 0.000000 0.462463 \n", "10 Brain 151508 OPC_1 1.000000 0.170473 0.365133 \n", "11 Brain 151508 Oligodendrocytes_1 1.000000 0.006502 0.427947 \n", "\n", " type \n", "0 bottom \n", "1 bottom \n", "2 bottom \n", "3 bottom \n", "4 bottom \n", "5 bottom \n", "6 top \n", "7 top \n", "8 top \n", "9 top \n", "10 top \n", "11 top \n" ] } ], "source": [ "print (df_shape_brain)" ] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }