A research team led by Mengyi Yan, Xiaoxiu Tan, Lanming Chen, and Lu Xie has developed Sphinx, an open-source R package for end-to-end computational modeling of spatial proteomics. Described in PLOS Computational Biology, the software establishes an integrated workflow encompassing preprocessing, cell annotation, adaptive spatial neighborhood modeling, and functional pathway characterization. Tissue architecture governs cellular behavior and disease progression, yet analytical tools have historically lagged behind the expansion of multiplexed imaging platforms. While conventional spatial algorithms were originally optimized for transcriptomics, Sphinx directly addresses the distinct properties of protein measurements, such as broader dynamic signal ranges, heterogeneous cellular distributions, and irregular tissue spacing. Evaluating datasets across lung adenocarcinoma, colorectal cancer, and mouse spleen tissue, the investigators demonstrated that Sphinx reliably reconstructs spatial functional units, distinguishes prognostic subtypes of tertiary lymphoid structures, and extends to paired spatial transcriptomics without architectural modifications.
The emergence of spatial proteomics represents a significant departure from bulk tissue analysis, which blends cellular contents and destroys microarchitectural context. Advanced multiplexed imaging and mass spectrometry platforms, including Co-Detection by Indexing, Imaging Mass Cytometry, cyclic immunofluorescence, PhenoCycler, and multiplexed ion beam imaging by time of flight, routinely resolve forty to one hundred protein markers across intact single cells. This capability prompted Nature Methods to name spatial proteomics the Method of the Year for 2024. In oncology, resolving spatial coordinates allows researchers to characterize invasive margins, reconstruct immune infiltration networks, and identify prognostic biomarkers within tumor microenvironments. However, existing computational workflows, such as Squidpy, Giotto, SCIMAP, and SOAPy, frequently rely on static neighborhood parameters like fixed search radii or non-adaptive nearest-neighbor counts. These rigid constraints often fail when confronted with density variations or localized tissue noise, underscoring the necessity for a platform that dynamically adjusts spatial network construction to underlying tissue geometries.
Sphinx addresses the initial stages of analysis through a standardized preprocessing module built upon the Seurat package in R. The primary interface function, load_spatial_data, accepts diverse file inputs, including Seurat RDS files, raw count matrices with coordinate tables in comma-separated values format, and native output files from Akoya imaging systems. Data ingestion feeds into a two-step quality control pipeline designed to filter low-quality cells. First, cells exhibiting aberrant total protein counts are removed using a median absolute deviation threshold, discarding cells situated beyond three deviations from the median by default. Second, a quantile-based cutoff removes cells exhibiting deficient feature detection counts, with the baseline threshold set at the fifth percentile. Surviving single-cell protein expression values undergo centered log-ratio transformation to standardize dynamic ranges across channels. Following normalization, the pipeline designates all detected proteins as variable features, scales expression values, extracts principal components, and constructs a nearest-neighbor graph to generate cell clusters via the Leiden algorithm at a default resolution of 0.5.
Following data normalization and unsupervised clustering, Sphinx facilitates cell identity assignment through a dedicated cell annotation module linking cluster profiles to established biological markers. The function find_top_markers executes differential expression testing using Seurat’s FindAllMarkers algorithm, restricting consideration to positive markers exhibiting a minimum detection fraction of 0.25 and a log2 fold change threshold of at least 0.25. For every cluster, the top five candidate marker proteins sorted by average log2 fold change are exported into tabular files for curation. To assist manual verification, the platform incorporates visualization functions such as plot_marker_violin, which generates grouped violin plots depicting marker intensity distributions, and plot_marker_heatmap, which displays average marker expression per cluster normalized by row-wise Z-scores. User-defined biological annotations are subsequently assigned through annotate_celltypes, which writes curated cell identities directly into the Seurat metadata slot. These annotations are concurrently validated through uniform manifold approximation and projection coordinates alongside spatial scatter plots projected onto histological tissue coordinates.
The central computational innovation of Sphinx resides in its adaptive spatial neighborhood module, which implements four distinct graph construction strategies: fixed-radius searching, mutual k-nearest neighbors, Delaunay triangulation, and overlapping sliding windows. The fixed-radius approach connects all cells within a specified radius, calibrated to approximately three times the median first-nearest-neighbor distance. The k-nearest neighbor method connects the ten closest cells using mutual nearest neighbors by default, while Delaunay triangulation establishes geometric edges with optional length thresholding to eliminate anomalous long-distance connections. The window-based method deploys overlapping square tiles with side length s and stride s divided by two, constructing local ten-neighbor graphs within each tile before merging them. Rather than requiring users to guess parameters, Sphinx deploys an empirical decision tree evaluating categorical Moran’s I for cell-type autocorrelation, nearest-neighbor coefficient of variation for spacing heterogeneity, and Clark–Evans R for aggregation. Radius modeling is selected when Moran’s I reaches 0.4 or higher with low spatial heterogeneity, whereas Delaunay triangulation is triggered for large or density-heterogeneous layouts.
Once Sphinx constructs the foundational spatial network, it extracts multidimensional structural features for every individual cell within the tissue. The algorithm calculates the proportional composition of adjacent cell types within the neighborhood, the geometric centroid coordinates of the neighborhood, and the relative displacement vector extending from the index cell to that centroid. These values are compiled into a feature matrix, which undergoes zero-variance feature elimination, column-mean missing value imputation, and Z-score standardization. Dimensionality reduction via principal component analysis is optionally applied to capture at least ninety percent of total variance. The cluster_neighborhoods function subsequently identifies recurrent microenvironmental niches using k-means, HDBSCAN, or Louvain clustering algorithms. To quantify spatial organization, calculate_neighborhood_purity computes the proportion of the dominant cell type within local windows, differentiating homogeneous cores from heterogeneous interfaces. Concurrently, analyze_spatial_interactions constructs an abundance-adjusted contact matrix by comparing observed edge frequencies between cell pairs against expected frequencies generated through random label permutations across the invariant graph, enabling rigorous evaluation of cell-cell preferences.
To connect structural microenvironments with biological mechanisms, Sphinx incorporates a functional analysis module executing differential protein expression and pathway enrichment. The function perform_differential_expression compares cells within a target neighborhood cluster against all remaining tissue cells. To mitigate technical clustering artifacts, centered log-ratio expression values are aggregated into spatial blocks of approximately forty cells for single tissue sections or replicate-level means across multiple sections. Statistical differences are calculated using Welch’s two-sample t-test, with resulting p-values corrected using the Benjamini–Hochberg procedure. Proteins exhibiting adjusted p-values below 0.05 and absolute mean differences exceeding 0.25 in centered log-ratio space are deemed significantly altered. These differential signatures are visualized using faceted volcano plots through plot_volcano_all_clusters. Significant protein sets are translated into gene symbols and submitted to perform_cluster_enrichment, which queries the EnrichR interface across GO, KEGG, CORUM, and Reactome databases against a customized background gene set, retaining only enriched functional terms with adjusted p-values under 0.05.
The investigators demonstrated the biological fidelity and algorithmic robustness of Sphinx across several multiplexed cancer datasets, beginning with colorectal cancer specimens profiled via the CODEX platform. Endothelial cells and fibroblasts exhibited the closest spatial proximity at 22 micrometers, reflecting coordinated stromal architecture. Comparing construction strategies demonstrated that while radius, Delaunay, and window approaches yielded concordant neighborhood definitions, the standard k-nearest neighbor method generated fragmented clusters. Spatial purity measurements confirmed higher cellular homogeneity within epithelial zones compared to immune-infiltrated stroma. Contact enrichment analysis revealed preferential spatial associations between epithelial cells and fibroblasts, as well as fibroblasts and endothelial cells, consistent with pro-angiogenic activity. Cross-validation against paired high-resolution spatial transcriptomics data from Xenium and Visium HD platforms demonstrated cross-modality versatility, recovering matched epithelial-fibroblast cellular neighborhood compositions with high concordance, achieving a Pearson correlation of 0.998 and a Spearman correlation of 0.966.
Applying Sphinx to PhenoCycler-Fusion data from lung adenocarcinoma precursor lesions revealed nuanced prognostic insights that conventional classification schemes overlook. Analysis of 35 antibody markers across eleven cell types identified thirty distinct spatial neighborhoods, including three distinct cellular niches resembling tertiary lymphoid structures. Cellular neighborhood six contained 73 percent germinal center B cells and 12 percent CD4-positive T cells; cellular neighborhood twenty-seven consisted of 24 percent B cells, 17 percent CD4-positive T cells, and 12 percent endothelial cells; and cellular neighborhood ten comprised 37 percent B cells, 22 percent CD4-positive T cells, and 15 percent cancer-associated fibroblasts. Functional pathway enrichment linked neighborhoods ten and twenty-seven to the CD19-VAV-PI3K and LIFR-LIF-GP130 signaling pathways. Conversely, neighborhood six exhibited enrichment in RUNX1 and FOXP3 regulatory development alongside unique CD28 family co-stimulation. Projecting these signatures into the TCGA lung adenocarcinoma cohort revealed divergent clinical associations: high scores for neighborhoods ten and twenty-seven correlated with improved overall survival, whereas high expression of neighborhood six correlated with significantly poorer survival, demonstrating that regulatory T cell dominance can render certain mature lymphoid structures immunosuppressive.
Systematic benchmarking on the CODEX mouse spleen dataset containing approximately 82,000 cells compared Sphinx against Squidpy, Giotto, SOAPy, and SCIMAP across accuracy, parameter stability, and scalability. Sphinx demonstrated superior neighborhood identification accuracy, attaining the highest adjusted mutual information and adjusted Rand index scores against reference tissue compartments. In robustness evaluations across varying neighborhood sizes ranging from k equals 5 to 30, the package maintained stable performance with peak metrics observed near k equals 10. Computational scaling across 10 to 100 percent of the spleen dataset showed competitive memory consumption, although Squidpy exhibited faster overall runtimes. The authors noted that Sphinx retains limitations, including reliance on user-curated marker lists for annotation, cross-platform variations in signal dynamic ranges, and the need for broader multi-cancer validation of tertiary lymphoid structure subtypes. Future iterations aim to integrate machine learning frameworks such as SpaMask, SpaDAMA, and SpaCross to expand multi-omics profiling, establishing Sphinx as an adaptable, interpretable computational framework for spatial biology.
Subject of Research: Adaptive spatial neighborhood modeling and functional analysis in spatial proteomics
Article Title: Sphinx: An R package for adaptive spatial neighborhood modeling and functional analysis in spatial omics
Article References: Yan, M., Tan, X., Liu, Z., Zhang, S., Du, Y., Li, H., Chen, L., & Xie, L. (2026). Sphinx: An R package for adaptive spatial neighborhood modeling and functional analysis in spatial omics. PLOS Computational Biology, 22(11), e1014954. https://doi.org/10.1371/journal.pcbi.1014954
Image Credits: AI Generated
DOI: 10.1371/journal.pcbi.1014954
Keywords: Sphinx, spatial proteomics, R package, adaptive neighborhood modeling, tumor microenvironment, Delaunay triangulation, k-nearest neighbors, tertiary lymphoid structures, lung adenocarcinoma, colorectal cancer, CODEX, PhenoCycler, spatial transcriptomics, EnrichR, differential expression, spatial statistics, Leiden clustering, cellular organization
News Source: Kenneth Gardner. (November 11, 2026). New R Package Sphinx Adaptively Models Tissue Neighborhoods in Spatial Proteomics. Scienmag.



