{ "cells": [ { "cell_type": "markdown", "id": "28684bdc-b401-4963-924c-edab42596b37", "metadata": {}, "source": [ "# Customizability\n", "\n", "`Spatialproteomics` provides wrappers around a variety of external tools, such as `cellpose` or `astir`. However, as technology progresses, new tools emerge. To accomodate for this, `spatialproteomics` is fully customizable, meaning that you can for example load your own segmentation masks into the object, load custom cell type annotations, etc.\n", "\n", "If you want to follow along with this tutorial, you can download the data [here](https://oc.embl.de/index.php/s/XzEa9po1tjiDzzJ)." ] }, { "cell_type": "code", "execution_count": 1, "id": "e2baf15a-1149-4c1a-b00f-02c7ec3281c2", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 504MB\n", "Dimensions: (channels: 56, y: 3000, x: 3000)\n", "Coordinates:\n", " * channels (channels) <U11 2kB 'DAPI' 'Helios' 'CD10' ... 'CD79a' 'Ki-67'\n", " * x (x) int64 24kB 0 1 2 3 4 5 6 ... 2994 2995 2996 2997 2998 2999\n", " * y (y) int64 24kB 0 1 2 3 4 5 6 ... 2994 2995 2996 2997 2998 2999\n", "Data variables:\n", " _image (channels, y, x) uint8 504MB dask.array<chunksize=(7, 375, 750), meta=np.ndarray>
<xarray.Dataset> Size: 576MB\n", "Dimensions: (channels: 56, y: 3000, x: 3000, cells: 1, features: 2)\n", "Coordinates:\n", " * channels (channels) <U11 2kB 'DAPI' 'Helios' ... 'CD79a' 'Ki-67'\n", " * x (x) int64 24kB 0 1 2 3 4 5 ... 2994 2995 2996 2997 2998 2999\n", " * y (y) int64 24kB 0 1 2 3 4 5 ... 2994 2995 2996 2997 2998 2999\n", " * cells (cells) int64 8B 1\n", " * features (features) <U10 80B 'centroid-0' 'centroid-1'\n", "Data variables:\n", " _image (channels, y, x) uint8 504MB dask.array<chunksize=(7, 375, 750), meta=np.ndarray>\n", " _segmentation (y, x) int64 72MB 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0\n", " _obs (cells, features) float64 16B 999.5 999.5
<xarray.Dataset> Size: 6MB\n", "Dimensions: (channels: 56, y: 301, x: 301, cells: 416, features: 2)\n", "Coordinates:\n", " * cells (cells) int64 3kB 4304 4311 4312 4318 ... 7269 7270 7271 7306\n", " * channels (channels) <U11 2kB 'DAPI' 'Helios' ... 'CD79a' 'Ki-67'\n", " * features (features) <U10 80B 'centroid-0' 'centroid-1'\n", " * x (x) int64 2kB 1000 1001 1002 1003 ... 1297 1298 1299 1300\n", " * y (y) int64 2kB 1000 1001 1002 1003 ... 1297 1298 1299 1300\n", "Data variables:\n", " _image (channels, y, x) uint8 5MB dask.array<chunksize=(7, 125, 301), meta=np.ndarray>\n", " _obs (cells, features) float64 7kB dask.array<chunksize=(416, 2), meta=np.ndarray>\n", " _segmentation (y, x) int64 725kB 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0\n", " _intensity (cells, channels) float64 186kB 265.9 0.0 ... 7.35 0.2526
\n", " | cell | \n", "label | \n", "
---|---|---|
0 | \n", "4304 | \n", "B cell | \n", "
1 | \n", "4311 | \n", "T cell | \n", "
2 | \n", "4312 | \n", "Macrophage | \n", "
3 | \n", "4318 | \n", "T cell | \n", "
4 | \n", "4327 | \n", "B cell | \n", "
\n", " | Embedding1 | \n", "Embedding2 | \n", "Embedding3 | \n", "
---|---|---|---|
0 | \n", "0.984677 | \n", "-1.441266 | \n", "-0.835590 | \n", "
1 | \n", "0.592195 | \n", "0.605522 | \n", "-0.905125 | \n", "
2 | \n", "1.222537 | \n", "-0.532184 | \n", "1.136689 | \n", "
3 | \n", "0.346578 | \n", "0.777263 | \n", "-1.388144 | \n", "
4 | \n", "-0.333111 | \n", "-0.701431 | \n", "0.204281 | \n", "