Abstract
Aims: Spatially resolved omics technologies enable investigation of cellular interactions within their local microenvironments (neighbourhoods) directly in situ. Although several computational methods have been developed for neighbourhood analysis, significant limitations remain in how neighbourhoods are defined and interrogated. Here, we present Kandinsky, a toolkit that provides a flexible and versatile framework for defining and analysing cell neighbourhoods.
Methods: We developed Kandinsky to improve flexibility in neighbourhood analysis and maximise compatibility with a wide range of spatial omics data. We therefore implemented multiple approaches for identifying cell- or spot-based neighbourhoods that serve as input for four analytical modules: differential gene or protein expression analysis, neighbourhood clustering, co-localisation/dispersion, and spatial hot and cold areas. In addition to its core functionality, Kandinsky enables the execution of external tools within the same analytical framework.
Results: We applied Kandinsky to real and simulated spatial datasets to benchmark its performance against existing methods and demonstrate its ability to uncover biologically meaningful spatial interactions. Kandinsky achieved competitive performance in terms of accuracy, memory usage, and runtime. In real datasets, it suggested transcriptional changes associated with acinar-to-beta cell reprogramming in the healthy pancreas; recapitulated stromal, immune, and tumour-associated clusters in pancreatic cancer; revealed the spatial co-localisation of myoepithelial cells with specific breast cancer subpopulations; and confirmed the association between regions of high CD74 expression and immune cell infiltration.
Conclusions: Kandinsky is a flexible and versatile toolkit for neighbourhood analysis that facilitates the exploration and interpretation of complex spatial omics data.
Keywords
References
-
1. Giesen C, Wang HAO, Schapiro D, Zivanovic N, Jacobs A, Hattendorf B, et al. Highly multiplexed imaging of tumor tissues with subcellular resolution by mass cytometry. Nat Methods. 2014;11(4):417-422.[DOI]
-
2. Goltsev Y, Samusik N, Kennedy-Darling J, Bhate S, Hale M, Vazquez G, et al. Deep profiling of mouse splenic architecture with CODEX multiplexed imaging. Cell. 2018;174(4):968-981.e15.[DOI]
-
3. Taube JM, Roman K, Engle EL, Wang C, Ballesteros-Merino C, Jensen SM, et al. Multi-institutional TSA-amplified multiplexed immunofluorescence reproducibility evaluation (MITRE) study. J Immunother Cancer. 2021;9(7):e002197.[DOI]
-
4. Moffitt JR, Bambah-Mukku D, Eichhorn SW, Vaughn E, Shekhar K, Perez JD, et al. Molecular, spatial, and functional single-cell profiling of the hypothalamic preoptic region. Science. 2018;362(6416):eaau5324.[DOI]
-
5. He S, Bhatt R, Brown C, Brown EA, Buhr DL, Chantranuvatana K, et al. High-plex imaging of RNA and proteins at subcellular resolution in fixed tissue by spatial molecular imaging. Nat Biotechnol. 2022;40(12):1794-1806.[DOI]
-
6. Janesick A, Shelansky R, Gottscho AD, Wagner F, Williams SR, Rouault M, et al. High resolution mapping of the tumor microenvironment using integrated single-cell, spatial and in situ analysis. Nat Commun. 2023;14:8353.[DOI]
-
7. Stickels RR, Murray E, Kumar P, Li J, Marshall JL, Di Bella DJ, et al. Highly sensitive spatial transcriptomics at near-cellular resolution with Slide-seqV2. Nat Biotechnol. 2021;39(3):313-319.[DOI]
-
8. Ståhl PL, Salmén F, Vickovic S, Lundmark A, Navarro JF, Magnusson J, et al. Visualization and analysis of gene expression in tissue sections by spatial transcriptomics. Science. 2016;353(6294):78-82.[DOI]
-
9. Oliveira MFD, Romero JP, Chung M, Williams SR, Gottscho AD, Gupta A, et al. High-definition spatial transcriptomic profiling of immune cell populations in colorectal cancer. Nat Genet. 2025;57(6):1512-1523.[DOI]
-
10. Rivest F, Eroglu D, Pelz B, Kowal J, Kehren A, Navikas V, et al. Fully automated sequential immunofluorescence (seqIF) for hyperplex spatial proteomics. Sci Rep. 2023;13:16994.[DOI]
-
11. Maurer K, Park CY, Mani S, Borji M, Raths F, Gouin III KH, et al. Coordinated immune networks in leukemia bone marrow microenvironments distinguish response to cellular therapy. Sci Immunol. 2025;10(103):eadr0782.[DOI]
-
12. Polański K, Bartolomé-Casado R, Sarropoulos I, Xu C, England N, Jahnsen FL, et al. Bin2cell reconstructs cells from high resolution Visium HD data. Bioinformatics. 2024;40(9):btae546.[DOI]
-
13. Jones DC, Elz AE, Hadadianpour A, Ryu H, Glass DR, Newell EW, et al. Cell simulation as cell segmentation. Nat Methods. 2025;22(6):1331-1342.[DOI]
-
14. Kleshchevnikov V, Shmatko A, Dann E, Aivazidis A, King HW, Li T, et al. Cell2location maps fine-grained cell types in spatial transcriptomics. Nat Biotechnol. 2022;40(5):661-671.[DOI]
-
15. Mages S, Moriel N, Avraham-Davidi I, Murray E, Watter J, Chen F, et al. TACCO unifies annotation transfer and decomposition of cell identities for single-cell and spatial omics. Nat Biotechnol. 2023;41(10):1465-1473.[DOI]
-
16. Danaher P, Zhao E, Yang Z, Ross D, Gregory M, Reitz Z, et al. Insitutype: Likelihood-based cell typing for single cell spatial transcriptomics. bioRxiv [Preprint]. 2022.[DOI]
-
17. Singhal V, Chou N, Lee J, Yue Y, Liu J, Chock WK, et al. BANKSY unifies cell typing and tissue domain segmentation for scalable spatial omics data analysis. Nat Genet. 2024;56(3):431-441.[DOI]
-
18. Lee Y, Chen ELY, Chan DCH, Dinesh A, Afiuni-Zadeh S, Klamann C, et al. Segmentation aware probabilistic phenotyping of single-cell spatial protein expression data. Nat Commun. 2025;16:389.[DOI]
-
19. Cang Z, Zhao Y, Almet AA, Stabell A, Ramos R, Plikus MV, et al. Screening cell-cell communication in spatial transcriptomics via collective optimal transport. Nat Methods. 2023;20(2):218-228.[DOI]
-
20. Armingol E, Baghdassarian HM, Lewis NE. The diversification of methods for studying cell-cell interactions and communication. Nat Rev Genet. 2024;25(6):381-400.[DOI]
-
21. Zhu J, Wang Y, Chang WY, Malewska A, Napolitano F, Gahan JC, et al. Mapping cellular interactions from spatially resolved transcriptomics data. Nat Methods. 2024;21(10):1830-1842.[DOI]
-
22. Agrawal A, Thomann S, Basu S, Grün D. NiCo identifies extrinsic drivers of cell state modulation by niche covariation analysis. Nat Commun. 2024;15:10628.[DOI]
-
23. Liu N, Martin J, Bhuva DD, Chen J, Li M, Lee SC, et al. hoodscanR: Profiling single-cell neighborhoods in spatial transcriptomics data. bioRxiv [Preprint]. 2024.[DOI]
-
24. Chen JG, Chávez-Fuentes JC, O’Brien M, Xu J, Ruiz EC, Wang W, et al. Giotto Suite: A multiscale and technology-agnostic spatial multiomics analysis ecosystem. Nat Methods. 2025;22(10):2052-2064.[DOI]
-
25. Varrone M, Tavernari D, Santamaria-Martínez A, Walsh LA, Ciriello G. CellCharter reveals spatial cell niches associated with tissue remodeling and cell plasticity. Nat Genet. 2024;56(1):74-84.[DOI]
-
26. Lafzi A, Borrelli C, Baghai Sain S, Bach K, Kretz JA, Handler K, et al. Identifying spatial co-occurrence in healthy and InflAmed tissues (ISCHIA). Mol Syst Biol. 2024;20(2):98-119.[DOI]
-
27. Palla G, Spitzer H, Klein M, Fischer D, Schaar AC, Kuemmerle LB, et al. Squidpy: A scalable framework for spatial omics analysis. Nat Methods. 2022;19(2):171-178.[DOI]
-
28. Kojima Y, Mii S, Hayashi S, Hirose H, Ishikawa M, Akiyama M, et al. Single-cell colocalization analysis using a deep generative model. Cell Syst. 2024;15(2):180-192.e7.[DOI]
-
29. Moses L, Einarsson PH, Jackson K, Luebbert L, Booeshaghi A.S, Antonsson S. et al. Voyager: Exploratory single-cell genomics data analysis with geospatial statistics. bioRxiv [Preprint]. 2023.[DOI]
-
30. Withnell E, Secrier M. SpottedPy quantifies relationships between spatial transcriptomic hotspots and uncovers environmental cues of epithelial-mesenchymal plasticity in breast cancer. Genome Biol. 2024;25(1):289.[DOI]
-
31. Feng Y, Yang T, Zhu J, Li M, Doyle M, Ozcoban V, et al. Spatial analysis with SPIAT and spaSim to characterize and simulate tissue microenvironments. Nat Commun. 2023;14:2697.[DOI]
-
32. Ding DY, Tang Z, Zhu B, Ren H, Shalek AK, Tibshirani R, et al. Quantitative characterization of tissue states using multiomics and ecological spatial analysis. Nat Genet. 2025;57(4):910-921.[DOI]
-
33. Mason K, Sathe A, Hess PR, Rong J, Wu CY, Furth E, et al. Niche-DE niche-differential gene expression analysis in spatial transcriptomics data identifies context-dependent cell-cell interactions. Genome Biol. 2024;25(1):14.[DOI]
-
34. Kim H, Kumar A, Lövkvist C, Palma AM, Martin P, Kim J, et al. CellNeighborEX: Deciphering neighbor‐dependent gene expression from spatial transcriptomics data. Mol Syst Biol. 2023;19(11):MSB202311670.[DOI]
-
35. Pebesma E. Simple features for R: Standardized support for spatial vector data. R J. 2018;10(1):439.[DOI]
-
36. Bivand RS, Wong DWS. Comparing implementations of global and local indicators of spatial association. Test. 2018;27(3):716-748.[DOI]
-
37. Gebhardt A, Renka R, Eglen S, Zuyev S, White D. tripack: Triangulation of irregularly spaced data. Version 1.3-9.4 [software]. 2026. Available from: https://www.rdocumentation.org/packages/tripack/versions/1.3-9.4
-
38. Hijmans, R. terra: Spatial Data Analysis. (2025).
-
39. Scrucca L, Fraley C, Murphy TB, Adrian E R. Model-based clustering, classification, and density estimation using mclust in R. 1st ed. Boca Raton: Chapman and Hall/CRC;2023:[DOI]
-
40. Müller-Bötticher N, Sahay S, Eils R, Ishaque N. SpatialLeiden: Spatially aware Leiden clustering. Genome Biol. 2025;26(1):24.[DOI]
-
41. Peng X, Smithy JW, Yosofvand M, Kostrzewa CE, Bleile M, Ehrich FD, et al. Scalable topic modelling decodes spatial tissue architecture for large-scale multiplexed imaging analysis. Nat Commun. 2025;16:6619.[DOI]
-
42. Sokal RR, Oden NL. Spatial autocorrelation in biology: 1. Methodology. Biol J Linn Soc. 1978;10(2):199-228.[DOI]
-
43. Ord JK, Getis A. Local spatial autocorrelation statistics: Distributional issues and an application. Geogr Anal. 1995;27(4):286-306.[DOI]
-
44. Ilich, A. GLCMTextures: GLCM Textures of Raster Layers. Version 0.6.3. 2025. Available from: https://cran.r-project.org/web/packages/GLCMTextures/GLCMTextures.pdf
-
45. Hahsler, M.P., Matthew. dbscan: Density-Based Spatial Clustering of Applications with Noise (DBSCAN) and Related Algorithms. (CRAN, 2026).
-
46. Gombin, J. concaveman: A very fast 2D concave hull algorithm. 1.2.0 edn (GitHub, 2025).
-
47. Biology BS. CosMx Human Pancreas FFPE Dataset [dataset]. 2024. Available from: https://brukerspatialbiology.com/products/cosmx-spatial-molecular-imager/ffpe-dataset/cosmx-smi-human-pancreas-ffpe-dataset/
-
48. Hao Y, Stuart T, Kowalski MH, Choudhary S, Hoffman P, Hartman A, et al. Dictionary learning for integrative, multimodal and scalable single-cell analysis. Nat Biotechnol. 2024;42(2):293-304.[DOI]
-
49. Quinn,T. peakRAM: Monitor the Total and Peak RAM Used by an Expression or Function. Version 1.03 [software]. GitHub. 2025. Available from: https://github.com/tpq/peakRAM
-
50. Yuan Z, Zhao F, Lin S, Zhao Y, Yao J, Cui Y, et al. Benchmarking spatial clustering methods with spatially resolved transcriptomics data. Nat Methods. 2024;21(4):712-722.[DOI]
-
51. Lopez R, Regier J, Cole MB, Jordan MI, Yosef N. Deep generative modeling for single-cell transcriptomics. Nat Methods. 2018;15(12):1053-1058.[DOI]
-
52. Sussman JH, Kim N, Kemp SB, Traum D, Katsuda T, Kahn BM, et al. Multiplexed imaging mass cytometry analysis characterizes the vascular niche in pancreatic cancer. Cancer Res. 2024;84(14):2364-2376.[DOI]
-
53. Schiller C, Ibarra-Arellano MA, Bestak K, Tanevski J, Schapiro D. Comparison and optimization of cellular neighbor preference methods for quantitative tissue analysis. Nat Commun. 2026;17:3514.[DOI]
-
54. Robin X, Turck N, Hainard A, Tiberti N, Lisacek F, Sanchez JC, et al. pROC: An open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinform. 2011;12(1):77.[DOI]
-
55. Genomics X. FFPE human breast cancer with 5K human pan tissue and pathways panel plus 100 custom genes [dataset]. 2024. Available from: https://www.10xgenomics.com/cn/datasets/xenium-prime-ffpe-human-breast-cancer
-
56. Sergushichev, A.A. An algorithm for fast preranked gene set enrichment analysis using cumulative statistic calculation. bioRxiv [Preprint]. 2016.[DOI]
-
57. Acha-Sagredo A, Andrei P, Clayton K, Taggart E, Antoniotti C, Woodman CA, et al. A constitutive interferon-high immunophenotype defines response to immunotherapy in colorectal cancer. Cancer Cell. 2025;43(2):292-307.e7.[DOI]
-
58. Andreatta M, Carmona SJ. UCell: Robust and scalable single-cell gene signature scoring. Comput Struct Biotechnol J. 2021;19:3796-3798.[DOI]
-
59. Egozi A, Bahar Halpern K, Farack L, Rotem H, Itzkovitz S. Zonation of pancreatic acinar cells in diabetic mice. Cell Rep. 2020;32(7):108043.[DOI]
-
60. Dahiya S, Saleh M, Rodriguez UA, Rajasundaram D, Arbujas JR, Hajihassani A, et al. Acinar to β-like cell conversion through inhibition of focal adhesion kinase. Nat Commun. 2024;15:3740.[DOI]
-
61. Runswick SK, O’Hare MJ, Jones L, Streuli CH, Garrod DR. Desmosomal adhesion regulates epithelial morphogenesis and cell positioning. Nat Cell Biol. 2001;3(9):823-830.[DOI]
-
62. Gudjonsson T, Adriance MC, Sternlicht MD, Petersen OW, Bissell MJ. Myoepithelial cells: Their origin and function in breast morphogenesis and neoplasia. J Mammary Gland Biol Neoplasia. 2005;10(3):261-272.[DOI]
-
63. Adriance MC, Inman JL, Petersen OW, Bissell MJ. Myoepithelial cells: Good fences make good neighbors. Breast Cancer Res. 2005;7(5):190.[DOI]
-
64. Russell TD, Jindal S, Agunbiade S, Gao D, Troxell M, Borges VF, et al. Myoepithelial cell differentiation markers in ductal carcinoma in situ progression. Am J Pathol. 2015;185(11):3076-3089.[DOI]
-
65. Risom T, Glass DR, Averbukh I, Liu CC, Baranski A, Kagel A, et al. Transition to invasive breast cancer is associated with progressive changes in the structure and composition of tumor stroma. Cell. 2022;185(2):299-310.e18.[DOI]
-
66. Hu M, Yao J, Carroll DK, Weremowicz S, Chen H, Carrasco D, et al. Regulation of in situ to invasive breast carcinoma transition. Cancer Cell. 2008;13(5):394-406.[DOI]
-
67. Liberzon A, Birger C, Thorvaldsdóttir H, Ghandi M, Mesirov JP, Tamayo P, et al. The molecular signatures database hallmark gene set collection. Cell Syst. 2015;1(6):417-425.[DOI]
-
68. Bortolomeazzi M, Keddar MR, Montorsi L, Acha-Sagredo A, Benedetti L, Temelkovski D, et al. Immunogenomics of colorectal cancer response to checkpoint blockade: Analysis of the KEYNOTE 177 trial and validation cohorts. Gastroenterology. 2021;161(4):1179-1193.[DOI]
-
69. Kim H, Kim KE, Madan E, Martin P, Gogna R, Rhee HW, et al. Unveiling contact-mediated cellular crosstalk. Trends Genet. 2024;40(10):868-879.[DOI]
-
70. Ospina OE, Soupir AC, Manjarres-Betancur R, Gonzalez-Calderon G, Yu X, Fridley BL, et al. Differential gene expression analysis of spatial transcriptomic experiments using spatial mixed models. Sci Rep. 2024;14:10967.[DOI]
-
71. Anderson SC, Ward EJ, English PA, Barnett LAK, Thorson JT sdmTMB: An R package for fast, flexible, and user-friendly generalized linear mixed effects models with spatial and spatiotemporal random fields. J Stat Softw. 2025;115:1-46.[DOI]
-
72. Gingerich IK, Goods BA, Frost HR. Benchmarking sketching methods on spatial transcriptomics data. Nucleic Acids Res. 2026;54(9):gkag434.[DOI]
Copyright
© The Author(s) 2026. This is an Open Access article licensed under a Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, sharing, adaptation, distribution and reproduction in any medium or format, for any purpose, even commercially, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Publisher’s Note
Share And Cite


