Simplified CytoMAP Workflow

8 minute read

Published:

How to phenotype cells and define regions using CytoMAP

After preparing tissues, imaging them, and segmenting those images; figuring out what cell types you can define and answering biological questions is the next step in the long journey of image analysis. The are many ways to do this and a plethora of software options out there. For many cases, if you have a few markers and a specific question about a specific population of cells, manually defining cells based on their mean fluorescent intensity (MFI) is the way to go. However, if you have a many channels, and are asking in depth questions about tissue microenvironments, clustering based analysis methods are very informative. In this workshop I am going to walk through how to do this in CytoMAP using a simplified example dataset derived from 5 steady state mouse lymph nodes stained with a myeloid cell focused antibody panel.

full dataset available here: https://gitlab.com/gernerlab/exampledata/-/tree/master/Steady%20State%20Murine%20Lymph%20Node%2020um%20Myeloid%20pannel/Cell%20position%20and%20MFI%20csv%20data

Step 0: Installing CytoMAP

Download the compiled executable instillation file for CytoMAP here: https://gitlab.com/gernerlab/cytomap/-/blob/master/StandaloneInstaller/CytoMAP_Installer_WindowsV1.4.20.exe

Read about other install options here: https://gitlab.com/gernerlab/cytomap/-/wikis/Installation-Guide

Step 1: Import your data into CytoMAP

This might might sound like a trivial step, but if your data isn’t cleaned and formatted correctly every step down stream from this will be much more difficult. To start, if you haven’t defined any cell types, you should have a .csv file for each sample and the name of the file should match the name of the sample like this:

LN1_auLN_All.csv

LN2_auLN_All.csv

LN3_bLN_All.csv

LN4_bLN_All.csv

Here we have four steady state mouse Lymph Nodes (LN) that are either auricular (auLN) or brachial (bLN). Inside the .csv files each row is a single cell and each column is a different channel:

CD64_PESIRPa_594CD207_488CD169_514Lyvev1_490LSCD11c_421CD31_480MHC2_395xlClec9a_633CD301b_660B220_700CD3_APC-F750XYZchIDSphericityVolume
1.354450.56272894.559118.926937.45490.6510353.166262.840445.7545717.31181.930571.30694382.9778.69.2304855940.887945241.933
7.2051428.954126.562314.063212.324820.161315.907819.688711.488228.552249.355919.0611739.4688.49.0674255950.648447334.402
16.727252.90963.5977313.204734.069833.880631.018529.14759.8675913.141236.662525.7789862.2715.810.5193555960.809646342.535
12.073744.44572.281775.6114222.257846.755120.423620.195215.611410.664836.053426.1142958.1777.311.3851555970.84242875.3365
26.461540.52753.4605525.3826186.98316.782620.34532.38629.052294.7018350.582617.4073979.8784.19.7282555980.607925148.746
19.432568.94272.731458.7799314.699821.748721.400920.82597.2997510.527444.879420.44141066.2685.210.1091555990.798238340.653
10.93462.87274.9002411.653633.168112.616730.611926.580514.252215.30465.198720.89241086.4733.410.7830556000.73209172.278
7.7383227.60592.431466.713412.255541.037426.082620.0816.4283514.286647.78516.73521095.9737.611.6616556010.68818684.8298
9.5277810.369330.781918.258210.10618.559716.661523.808615.9314.809746.940316.65431147.4780.811.0933556020.807941133.695

For best results, try not to use symbols, start a name with a number, or have spaces in the channel names. CytoMAP is fairly robust to these channel names, but sometimes this still causes errors. If you need to re-name the headers of a bunch of .csv files to make them consistent across samples, I have a MATLAB function to help here. If you name your positional columns X, Y, Z, CytoMAP will automatically recognize these as the spatial position channels. If CytoMAP can’t find position it will ask when loading data. Additionally, since everything in CytoMAP is set up to work with three-dimensional data, if your data just has X, and Y it will add a Z channel that is all zeros. Now that your data is formatted correctly simply run File > Import Multiple Samples

Load Multiple Samples

After selecting the samples you want to load a window will pop up where you can rename any samples or channels. These can also be changed later in CytoMAP so for now we are going to just click Load.

Load Multiple Samples

The last step is to make sure everything worked. To do this make a New Figure, plot some of your samples, and color code them by a few different channel markers. Below are the LNs I loaded in color coded by Lyve1. All of the channel intensities look similar to the original images.

Load Multiple Samples

Load Multiple Samples

Step 2: Phenotype Cells

To define cell types you can Manually gate on marker expression to define cell types

Load Multiple Samples

and/or Cluster cells into different phenotypes. For this walkthrough we will cluster cells. To do this click the Cluster Cells button in the main CytoMAP window. This will bring up a new window with a lot of options. For this example, we want to use all of our fluorescent channels expressed by myeloid cells and not the position of the cells. In the bottom left of this window we selected standardized cellular MFI and we did this calculation on a sample by sample basis and not for the whole pooled dataset. We manually selected 5 clusters.

Load Multiple Samples

After running the clustering algorithm we can now color-code our cells by which cluster number they belong to. This highlights the distinct spatial regions the individual cell types live in.

Load Multiple Samples

After checking the spatial distribution of the clusters we can use the Region Statistics interface to look at the average channel intensity in the cells that belong to each of the clusters we defined.

Load Multiple Samples

Load Multiple Samples

We could also run dimensionality reduction and color code the resulting plots by cluster and MFI of the cells to visualize how the clusters are defined.

Load Multiple Samples

Step 3: Annotate the cell clusters

The final step in defining cells with CytoMAP is to annotate the different clusters of cells with names and convert them from clusters to cell phenotypes. To do this use plots of the spatial distribution of your cells and plots of the channel MFI per cluster. Next use the annotate cells function to name your populations.

Load Multiple Samples

By clicking on plots of cells color-coded by cluster number, you can explore the clusters. In the example below we see that cells from cluster number 5 has high CD64, and CD169 expression and is located peripherally in the lymph node. In the Annotate Cells window we can name this cluster macrophages.

Load Multiple Samples

We are now ready to use these cell types for downstream analysis such as cell-cell correlation, cell distance relationships, or neighborhood based region analysis.

Step 4: Define Neighborhoods

Now that we have cell types we can calculate the number of cells per neighborhood using the Define Neighborhoods interface. For this example we are defining 50 um Raster Scanned Neighborhoods. This option will even distribute the neighborhoods throughout the sample space and calculate the number of cells of each type within 50 um of each neighborhood’s position.

Load Multiple Samples

Step 5: Cluster Neighborhoods into Regions

Next we can use the same clustering algorithms we used to define cells to cluster neighborhoods into regions in the tissue. When clustering regions we want to use the cell types we defined above, as well as any MFI that are not represented in our cell types. We don’t include the position of the neighborhoods meaning the clustering algorithm will group similar neighborhoods together regardless of where they are in the tissue.

Load Multiple Samples

Load Multiple Samples

It is important to note at this point that the more detail you feed into CytoMAP the more informative the regions will be. For example; In Stoltzfus et. al. 2020 we defined more Myeloid cell subtypes and included B cell and T cell objects from these lymph nodes. This resulted in more informative definitions of the regions.

Load Multiple Samples

Step 6: Region Statistics

Now that we have defined regions we can explore how the regions are defined, what regions are present in the samples and how these regions change across tissue groups. We can use the Region Statistics interface to plot the Fold Change in the number of cells per region as well as the percentage of neighborhoods of each region type.

Load Multiple Samples

Load Multiple Samples

This is one of many possible workflows using CytoMAP. For more information on the functions you can use to explore your data see the CytoMAP Wiki page:

https://gitlab.com/gernerlab/cytomap/-/wikis/home

If you get stuck, or need some help post a topic on the image analysis forum with the cytomap tag:

https://forum.image.sc