netPCF: Geometry-aware pair correlation functions for spatial biology
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Spatial organisation is a defining feature of biological systems, underpinning cellular interactions, tissue function, disease progression and therapeutic response. Identifying and quantifying spatial organisation may require methods that resolve relationships across spatial scales. The pair correlation function (PCF) quantifies spatial dependence between points across multiple length scales, but its standard Euclidean formulation is poorly suited to data defined on irregular, curved or otherwise structured domains, where tissue geometry may constrain biological organisation and distort Euclidean distances. Here, we introduce netPCF, a geometry-aware extension of the PCF for quantifying spatial organisation on complex biological domains. By representing tissue structures, anatomical surfaces and other constrained geometries as spatial networks, netPCF generalises the PCF beyond extrinsic Euclidean settings. The framework derives the expected behaviour of the statistic under complete spatial randomness using interpretable finite-support kernels, provides bootstrap-based uncertainty quantification, and includes practical criteria for assessing domain discretisation adequacy. We further extend netPCF to marked (labelled) biological data using feature kernels for categorical and continuous attributes, enabling unified analysis of cell identities, marker intensities, phenotypic states, gene expression and other quantitative features on structured domains in any spatial dimension. All methods are implemented in the open-source Python package spacenet .
Synthetic studies show that netPCF recovers classical Euclidean behaviour on sufficiently resolved networks and is robust to common imaging noise. We demonstrate its utility in two biological applications. In three-dimensional imaging mass cytometry data from HER2+ breast carcinoma, netPCF separates tissue architecture-driven proximity from biologically meaningful endothelial and immune cell organisation. In reconstructed surfaces of developing murine embryos, netPCF identifies a transition in the Wnt1 – Wnt6 relationship from short-range co-localisation at E9.5 to spatial exclusion at E11.5, a pattern of ectodermal boundary refinement not captured by prior voxel-wise co-expression analysis. Overall, netPCF provides a statistically grounded and practical framework for quantifying spatial organisation on complex biological domains.
Author summary
Spatial organisation is central to many biological processes, but it is often measured using distances that ignore the shape of the tissue or structure being studied. We introduce netPCF, a method for quantifying multiscale spatial correlation in data that lie on complex biological domains, including irregular, curved, or branching structures. netPCF reconstructs the domain as a distance-preserving spatial network and estimates pair correlation along this intrinsic geometry, allowing spatial associations to be interpreted relative to the structure in which they occur. The framework includes uncertainty estimates and extensions for categorical and continuous markers, supporting analysis of cell types, marker intensities, phenotypic states, and gene expression patterns. In synthetic data, netPCF recovers expected spatial behaviour on well-resolved networks. In biological imaging data, it distinguishes apparent cell proximity caused by breast carcinoma tissue architecture from biologically meaningful cell organisation, and reveals a developmental transition in Wnt gene organisation over the surface of a murine embryo that direct co-expression analysis does not capture. netPCF is available in the open-source Python package spacenet , supplemented with online tutorials supporting practical use across spatial biology applications.