Article Text

Download PDFPDF

668 A toolkit for the quantitative analysis of the spatial distribution of cells of the tumor immune microenvironment
  1. Anna Trigos1,
  2. Tianpei Yang2,
  3. Yuzhou Feng1,
  4. Volkan Ozcoban2,
  5. Maria Doyle1,
  6. Anu Pasam1,
  7. Nikolce Kocovski1,
  8. Angela Pizzolla1,
  9. Yu-Kuan Huang1,
  10. Greg Bass3,
  11. Simon Keam1,
  12. Terrence Speed4,
  13. Paul Neeson1,
  14. Shahneen Sandhu1 and
  15. David Goode1
  1. 1Peter MacCallum Cancer Centre, Melbourne, Australia
  2. 2The University of Melbourne, Melbourne, Australia
  3. 3CSL, Melbourne, Australia
  4. 4Walter and Eliza Hall Institute, Melbourne, Australia


Background Spatial technologies that query the location of cells in tissues such as multiplex immunohistochemistry and spatial transcriptomics are gaining popularity and are likely to become commonplace. The resulting data often includes the X, Y coordinates of millions of cells, cell phenotypes and marker or gene expression levels. In cancer, the spatial location of lymphocytes has been linked to prognosis and response to immunotherapy. While these advances have been exciting for the field, the methods currently being used are still coarse, making us severely underpowered in our ability to extract quantifiable information. Appropriate quantitative tools are desperately needed to refine and uncover novel biologically and clinically meaningful insights from the spatial distribution of cells of the tumor immune microenvironment.

Methods We compiled over 60 prostate cancer and melanoma FFPE tumor sections and performed Opal multiplex immunohistochemistry for a diversity of T-cell and other immune markers, including CD3, CD4, CD8, FOXP3 and PDL1, as well as a prostate cancer (AMACR) or melanoma (SOX10) marker and DAPI. Following spectral imaging on the Vectra Polaris, we performed cell and tissue segmentation and phenotyping with the inForm or HALO image analysis software. The detected X, Y coordinates of cells and marker intensities were used for subsequent method development.

Results We developed SPIAT (Spatial Image Analysis of Tissues)1, an R package with a suite of data processing, quality control, visualization, data handling and data analysis tools for spatial data. SPIAT includes our novel algorithms for the identification of cell clusters, tumor margins and cell gradients, the calculation of neighborhood proportions and algorithms for the prediction of cell phenotypes. By interfacing with packages used in ecology, geographic data analysis and spatial statistics, we have begun to robustly address fundamental questions in the analysis of cell spatial data, such as metrics to measure mixing between cell types, the identification of tumor borders and statistical approaches to compare samples.

Conclusions SPIAT is compatible with multiplex immunohistochemistry, spatial transcriptomics and data generated from other spatial platforms, and continues to be actively developed. We expect SPIAT to become a user-friendly and speedy go-to package for the spatial analysis of cells in tissues, as well as promote the use of quantitative metrics in the spatial analysis of the tumor immune microenvironment.


  1. Tianpei Yang, Volkan Ozcoban, Anu Pasam, Nikolce Kocovski, Angela Pizzolla, Yu-Kuan Huang, Greg Bass, Simon P. Keam, Paul J. Neeson, Shahneen K. Sandhu, David L. Goode, Anna S. Trigos. SPIAT: An R package for the Spatial Image Analysis of Cells in Tissues. BioRxiv doi:

This is an open access article distributed in accordance with the Creative Commons Attribution 4.0 Unported (CC BY 4.0) license, which permits others to copy, redistribute, remix, transform and build upon this work for any purpose, provided the original work is properly cited, a link to the licence is given, and indication of whether changes were made. See:

Statistics from

Request Permissions

If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.