---
title: Cytometry on the platform
description: >-
  FlowSOM clustering and imaging mass cytometry segmentation and spatial
  analysis for flow, mass, and imaging cytometry data.
tags:
  - cytometry
---

> **Retired tools**

> `flow_gate`, `flow_cluster` and `flow_differential` are retired and can no longer be run. For FCS clustering use `flowsom`, which runs real FlowSOM SOM + consensus metaclustering (the retired app labelled its output "flowsom" but ran k-means). There is no hosted tool for automated gating, PhenoGraph clustering or differential abundance; ask Ivy to run those in Python in the chat's [code workspace](/docs/sandbox), using `flowsom` for the cluster labels if you need them. Everything else on this page still works.

Turn single-cell cytometry data into discovered clusters and spatial biology — FlowSOM clustering of flow and mass cytometry data, and imaging mass cytometry segmentation and neighborhood analysis. Reach for these tools when you have flow, mass, or imaging cytometry data and want reproducible, data-driven analysis. They sit in the experimental, cell-scale analysis arc rather than the small-molecule chemistry pipeline. See the [Cell & Tissue overview](/docs/cell-tissue) for where this fits.

> **Documented parameters go beyond the implemented tools**

> `imc_segment` and `imc_spatial` currently accept only a file key and an optional panel CSV; the IMC parameter and output tables in this section and in [inputs](/docs/cytometry/inputs) describe the intended interface, not the currently implemented one. The `flowsom` tool wraps [FlowSOM_Python](https://github.com/saeyslab/FlowSOM_Python) with its own `xdim`/`ydim`/`n_clusters`/`seed` parameters.

## Cytometry overview

The Cytometry toolkit provides three tools: FlowSOM clustering for flow and mass cytometry data, and two imaging mass cytometry tools for cell segmentation and spatial biology. Each tool can be run independently or chained for end-to-end analysis.

## Architecture

```
User Data (FCS files, TIFF/MCD images, CSV exports)
  --> Intent Detection
       |- Population discovery --> flowsom
       |    (SOM + consensus metaclustering)
       |- Cell segmentation --> imc_segment
       |    (nuclear/membrane segmentation, cell mask generation)
       +- Spatial analysis --> imc_spatial
            (neighborhood analysis, interaction scores, spatial statistics)
  --> Serverless Compute
  --> Structured Results with Visualizations
```

## Tool inventory

### Flow and mass cytometry tools

| Tool | Name | Description | Input |
|------|------|-------------|-------|
| FlowSOM | `flowsom` | Self-organizing map training with consensus metaclustering | FCS |

### Imaging mass cytometry tools

| Tool | Name | Description | Input |
|------|------|-------------|-------|
| IMC Segmentation | `imc_segment` | Cell instance segmentation from multi-channel tissue images | Multi-channel TIFF or MCD |
| IMC Spatial | `imc_spatial` | Spatial analysis of cell neighborhoods and cell-cell interactions | Segmented cell data + coordinates |

## Capabilities

### FlowSOM clustering

The `flowsom` tool trains a self-organizing map over a flow or mass cytometry FCS file and consensus-clusters the SOM nodes into metaclusters. It returns per-event cluster labels, per-node and per-metacluster marker median intensities, metacluster summary statistics, and an optional star plot of the SOM grid. It is the only hosted FCS clustering tool: it does not run PhenoGraph, PARC or Leiden, and it does not gate or test differential abundance.

### IMC cell segmentation

The `imc_segment` tool performs cell instance segmentation on multi-channel imaging mass cytometry images. It uses deep learning models trained on nuclear markers (e.g., Ir191, Ir193, histone H3) and membrane markers (e.g., CD45, Na-K-ATPase) to identify individual cells. Output includes cell masks, per-cell marker intensities, and cell morphology features (area, eccentricity, solidity).

Segmentation methods:

| Method | Name | Description |
|--------|------|-------------|
| Cellpose | `cellpose` | Deep learning segmentation, best for diverse morphologies |
| DeepCell/Mesmer | `deepcell` | Nuclear + membrane segmentation optimized for tissue |
| Watershed | `watershed` | Classical marker-controlled watershed, fast but less accurate |

### IMC spatial analysis

The `imc_spatial` tool analyzes the spatial organization of cells in tissue sections. It requires segmented cell data with coordinates and cell type labels. Analyses include:

| Analysis | Description |
|----------|-------------|
| Neighborhood analysis | Identifies which cell types are enriched/depleted near each other |
| Interaction scores | Quantifies pairwise cell-cell interaction frequency vs. random expectation |
| Spatial statistics | Ripley's K/L functions, nearest-neighbor distances, spatial autocorrelation |
| Community detection | Identifies recurring multi-cell neighborhoods (tissue microenvironments) |

## When to use each tool

| I want to... | Use this tool |
|--------------|---------------|
| Discover cell populations without prior labels | `flowsom` |
| Segment cells in an IMC tissue image | `imc_segment` |
| Analyze spatial cell organization in tissue | `imc_spatial` |
| Run a complete IMC pipeline | Chain `imc_segment` -> `imc_spatial` |
| Gate flow cytometry data, or compare population frequencies between groups | Ask Ivy to do it in Python in the chat's [code workspace](/docs/sandbox); use `flowsom` first if you need cluster labels |

## When to use other tools instead

| I want to... | Use this instead |
|--------------|------------------|
| Analyze single-cell RNA-seq data | scRNA-seq tools |
| Predict protein structures for marker antibodies | AlphaFold / ESMFold |
| Search for cell marker genes | An NCBI Gene or Ensembl lookup ([Genomics](/docs/genomics)) |
| Look up antibody information | [UniProt](/docs/uniprot) |
| Find papers about a cell population | [PubMed](/docs/pubmed) |
| Analyze histology images (H&E) | Histopathology tools |

## Licensing

| Software/Model | License |
|----------------|---------|
| FlowSOM (FlowSOM_Python) | GPL-3.0 |
| Cellpose | BSD-3-Clause |
| DeepCell/Mesmer | Modified Apache 2.0 |

## Citations

> Van Gassen S, et al. FlowSOM: Using self-organizing maps for visualization and interpretation of cytometry data. *Cytometry A*. 2015;87(7):636-645. doi: [10.1002/cyto.a.22625](https://doi.org/10.1002/cyto.a.22625)

> Greenwald NF, et al. Whole-cell segmentation of tissue images with human-level performance using large-scale data annotation and deep learning. *Nat Biotechnol*. 2022;40(4):555-565. doi: [10.1038/s41587-021-01094-0](https://doi.org/10.1038/s41587-021-01094-0)

> Stringer C, et al. Cellpose: a generalist algorithm for cellular segmentation. *Nat Methods*. 2021;18(1):100-106. doi: [10.1038/s41592-020-01018-x](https://doi.org/10.1038/s41592-020-01018-x)

## Chat Usage

### Example Prompts

- "Cluster my flow cytometry panel with FlowSOM and summarize each metacluster"
- "Segment cells in my IMC image using Cellpose with nuclear marker Ir193"
- "Analyze spatial interactions between CD8 T cells and tumor cells in my tissue"
- "Run FlowSOM with 15 metaclusters on my mass cytometry data"

### Workflow Chaining

- **Feeds into**: Differential gene expression (cell markers), Literature search (population biology), Genomics tools (marker gene annotation), Target Passport (immune cell targets)
- **Accepts from**: Data upload (FCS files, TIFF/MCD images), Sample metadata (group labels, clinical data), Marker panels (antibody-channel mapping), Genomics results (marker gene selection)

## FAQ

### What cytometry platforms are supported?

  The toolkit supports conventional flow cytometry (FCS files), mass cytometry (CyTOF), and imaging mass cytometry (IMC). Flow and CyTOF data should be provided as FCS 3.0/3.1 files or CSV exports. IMC data should be provided as multi-channel TIFF images or MCD files.

### Do I need to compensate my flow cytometry data before analysis?

  For flow cytometry, compensation should be applied before upload. CyTOF data does not require compensation.

### Which clustering algorithms are available?

  Only FlowSOM (self-organizing maps with consensus clustering), through the `flowsom` tool. PhenoGraph and PARC are not available as hosted tools; Ivy can run them in Python in the chat's [code workspace](/docs/sandbox) if you need them.

### Can I analyze imaging mass cytometry data without cell segmentation first?

  The imc_spatial tool can perform pixel-level spatial analysis without prior segmentation. However, cell-level spatial analysis (neighborhood analysis, interaction scores) requires segmented cell masks from imc_segment. For most IMC workflows, run segmentation first, then spatial analysis.

## Read next
