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:
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:
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
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.
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.
Step 2: Phenotype Cells
To define cell types you can Manually gate on marker expression to define cell types
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
If you get stuck, or need some help post a topic on the image analysis forum with the cytomap tag: