{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example Workflow with spatialproteomics\n", "Welcome to spatialproteomics! In this notebook, we will go through an example workflow by looking at the following steps:\n", "\n", "1. Reading in a highly multiplexed image and creating a spatialproteomics object\n", "\n", "2. Performing basic image processing steps to boost the signal-to-noise ratio\n", "\n", "3. Performing cell segmentation using _cellpose_\n", "\n", "4. Quantifying protein expression per cell\n", "\n", "5. Predicting cell types with a simple argmax technique\n", "\n", "6. Plotting the results\n", "\n", "
\n",
" \n",
"
<xarray.Dataset>\n", "Dimensions: (channels: 5, y: 500, x: 500)\n", "Coordinates:\n", " * channels (channels) <U5 'DAPI' 'CD4' 'CD8' 'FOXP3' 'BCL6'\n", " * y (y) int64 0 1 2 3 4 5 6 7 8 ... 492 493 494 495 496 497 498 499\n", " * x (x) int64 0 1 2 3 4 5 6 7 8 ... 492 493 494 495 496 497 498 499\n", "Data variables:\n", " _image (channels, y, x) uint16 10816 12359 14504 10965 ... 147 129 149 59
<xarray.Dataset>\n", "Dimensions: (channels: 5, y: 500, x: 500, cells: 1335, features: 2)\n", "Coordinates:\n", " * channels (channels) <U5 'DAPI' 'CD4' 'CD8' 'FOXP3' 'BCL6'\n", " * y (y) int64 0 1 2 3 4 5 6 7 ... 492 493 494 495 496 497 498 499\n", " * x (x) int64 0 1 2 3 4 5 6 7 ... 492 493 494 495 496 497 498 499\n", " * cells (cells) int64 1 2 3 4 5 6 7 ... 1330 1331 1332 1333 1334 1335\n", " * features (features) <U10 'centroid-0' 'centroid-1'\n", "Data variables:\n", " _image (channels, y, x) uint16 0 9602 9690 5351 4892 ... 0 0 0 0 0\n", " _segmentation (y, x) uint16 0 0 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 1.538 40.88 1.474 ... 497.5 262.0
<xarray.Dataset>\n", "Dimensions: (channels: 5, y: 500, x: 500, cells: 1320, features: 2)\n", "Coordinates:\n", " * channels (channels) <U5 'DAPI' 'CD4' 'CD8' 'FOXP3' 'BCL6'\n", " * y (y) int64 0 1 2 3 4 5 6 7 ... 492 493 494 495 496 497 498 499\n", " * x (x) int64 0 1 2 3 4 5 6 7 ... 492 493 494 495 496 497 498 499\n", " * cells (cells) int64 1 2 3 4 5 6 7 ... 1315 1316 1317 1318 1319 1320\n", " * features (features) <U10 'centroid-0' 'centroid-1'\n", "Data variables:\n", " _image (channels, y, x) uint16 0 9602 9690 5351 4892 ... 0 0 0 0 0\n", " _segmentation (y, x) uint16 0 0 0 0 0 10 10 10 10 10 ... 0 0 0 0 0 0 0 0 0\n", " _obs (cells, features) float64 1.85 41.85 2.462 ... 496.1 422.9\n", " _intensity (cells, channels) float64 8.025 4.431 6.524 ... 0.9862 1.26
<xarray.Dataset>\n", "Dimensions: (labels: 4, la_props: 2, channels: 5, y: 500, x: 500,\n", " cells: 1320, features: 3)\n", "Coordinates:\n", " * labels (labels) int64 1 2 3 4\n", " * la_props (la_props) <U6 '_color' '_name'\n", " * channels (channels) <U5 'DAPI' 'CD4' 'CD8' 'FOXP3' 'BCL6'\n", " * y (y) int64 0 1 2 3 4 5 6 7 ... 493 494 495 496 497 498 499\n", " * x (x) int64 0 1 2 3 4 5 6 7 ... 493 494 495 496 497 498 499\n", " * cells (cells) int64 1 2 3 4 5 6 ... 1315 1316 1317 1318 1319 1320\n", " * features (features) <U10 '_labels' 'centroid-0' 'centroid-1'\n", "Data variables:\n", " _la_properties (labels, la_props) object '#C2FF99' 'T_fh' ... 'T_tox'\n", " _image (channels, y, x) uint16 0 9602 9690 5351 4892 ... 0 0 0 0 0\n", " _segmentation (y, x) uint16 0 0 0 0 0 10 10 10 10 10 ... 0 0 0 0 0 0 0 0 0\n", " _obs (cells, features) float64 4.0 1.85 41.85 ... 2.0 496.1 422.9\n", " _intensity (cells, channels) float64 8.025 4.431 6.524 ... 0.9862 1.26" ], "text/plain": [ "