Application of this protocol to a public human lung spatial transcriptomics dataset (GEO series GSE250346) yields reproducible and interpretable outputs across all stages of the workflow. Successful protocol execution is confirmed by an ε-neighborhood radius sweep that produces an interpretable spatial graph at the selected radius (Figure 6); node-aligned assay embeddings and spatial projections that separate architectural and signaling-defined tissue states (Figure 8); and differential LR mechanisms that distinguish fibrotic focus inferred signaling from surrounding tissue context within fibrosis cores (Figure 11).
Across the evaluated radii, mean neighbor counts increased from 2.2 at 10 µm to 13.5 at 25 µm, 25.0 at 35 µm, and 66.4 at 60 µm. At 35 µm, the ε-graph exhibited coherent local connectivity while preserving boundaries between distinct microenvironments, indicating successful neighborhood definition. In contrast, suboptimal radius selection produced characteristic failure modes. Radii below 25 µm yielded fragmented ε-graphs with sparse connectivity, limiting the capture of local tissue structure, whereas radii at or above 60 µm generated dense graphs in which boundaries between microenvironments are harder to resolve visually, although the differential ranking is unchanged at that radius. These outcomes define a practical range of neighborhood resolutions and provide a visual diagnostic for protocol success or failure.
To determine whether these results depend on the 35 µm neighborhood radius, the differential analysis was repeated with the spatial graph rebuilt at 25 µm and at 60 µm, holding the focus region fixed as the identical set of 1,104 cells identified at 35 µm so that only the neighborhood definition varied. Rebuilding the graph changed its size substantially, from 161,232 directed edges in the fibrotic core at 25 µm to 751,226 at 60 µm, yet the five mechanisms reported below remained the top five in the same order at every radius, and the rank correlation across all 47 mechanisms was 0.998 between 25 and 35 µm, 0.996 between 35 and 60 µm, and 0.993 between 25 and 60 µm (Table 2).
Execution of NICHES at the selected radius generated node-aligned and edge-aligned assays representing cell-cell inferred LR signaling at pairwise resolution. The two-core subset (27,250 cells total; 11,140 fibrotic and 16,110 control) yielded 47 LR mechanisms across C2N and N2C assays and 540,534 directed edges in the C2C object. These outputs enabled downstream embedding, clustering, and differential analysis of signaling programs. Inferred LR signaling is intrinsically sparse due to expression-level sparsity, multiplicative LR scoring, and constraints imposed by the gene panel and LR database. This sparsity is expected in biologically meaningful analyses. In contrast, sparsity caused by insufficient neighborhood connectivity reflects suboptimal execution, yielding reduced edge counts and poorly structured embeddings.
Neighborhood Composition analysis appended two node-aligned architectural assays to the node-level object: a raw neighbor-count assay and a neighbor-fraction assay. In this dataset, neighborhood composition was represented by 45 features corresponding to the unique cell-type labels present across the two tissue samples. Successful construction yielded structured neighborhood profiles that varied across tissue regions, whereas suboptimal runs would produce near-uniform compositions reflecting inadequate spatial resolution or over-smoothing.
Dimensionality reduction and clustering produced assay-specific embeddings and cluster assignments for Neighborhood Composition, C2N, and N2C, with corresponding spatial projections onto tissue coordinates (Figure 8). In the representative analysis, Neighborhood Composition clustering yielded 17 clusters, C2N yielded 19 clusters, and N2C yielded 11 clusters, showing distinct architectural and signaling states across assays. Suboptimal clustering outcomes were characterized by either excessive fragmentation into small, spatially incoherent clusters or collapse into a small number of broad clusters lacking spatial specificity.
Inflammatory fibroblasts are the strongest marker of Neighborhood Composition cluster 5 by a wide margin, present in the neighborhoods of 99% of cluster 5 cells versus 4% of cells outside the cluster, followed by CD8 T cells, mast cells, and venous endothelium (Figure 8C). Within the fibrotic core, 1,104 cells belong to this cluster, and these are the cells taken as the focus region. An inflammatory fibroblast-rich neighborhood is the architecture in which matrix deposition and adhesion signaling would be expected to dominate.
Differential LR analysis compared edge weights between two within-sample edge classes in the fibrosis core: Focus-Focus edges, in which both sender and receiver belonged to the selected Neighborhood Composition cluster(s), and NonFocus-NonFocus edges, in which both endpoints lay outside the focus. Results are summarized in results/diffcomm/permutation_results.csv, which ranks LR mechanisms by effect size and statistical significance using a cell-label permutation test (500 permutations).
Several LR pairs were significantly enriched within Focus-Focus edges, including VIM–CD44 (Δmean ≈ 3.46), FN1–ITGB1 (Δmean ≈ 1.97), FN1–CD44 (Δmean ≈ 1.70), COL1A2–ITGB1 (Δmean ≈ 1.23), and COL1A2–CD44 (Δmean ≈ 1.08) (Figure 12). These co-expression pairs reflect extracellular matrix (ECM)-integrin adhesion and matrix remodeling programs consistent with fibrotic microenvironments10. In contrast, MMP7–CD44 was lower within fibrotic foci (Δmean ≈ −0.52), below the effect-size threshold applied in Figure 11.
Differential results are visualized using a volcano plot (Figure 11), in which each point represents an LR mechanism. The x-axis indicates the difference in mean edge weight between Focus-Focus and NonFocus-NonFocus edge classes, and the y-axis shows −log10(FDR). Vertical dashed lines denote a practical significance threshold of approximately one standard deviation from zero. Suboptimal differential analyses were characterized by unstable effect size estimates and uniformly low statistical significance, producing volcano plots with broad dispersion near zero and no significant LR mechanisms after correction. These patterns indicate insufficient edge density or spatial signal, contrasting with the stable enrichment observed in successful protocol execution.
All analysis scripts, configuration files, and helper functions used to generate these results are publicly available at https://github.com/RaredonLab/JoVE2026.

Figure 1: Cell-type-centric analysis of the gene expression assay. (A) Spatial cell-type map of a representative fibrotic tissue core (TILD049MA), with individual cells colored by assigned cell type and a reference cell indicated by a white circle. (B) Zoomed view of the circled region showing cell segmentations colored by cell type. (C) Uniform manifold approximation and projection (UMAP) embedding of all cells from both tissue cores, colored by cell type, with the reference cell indicated by a white circle. (D) Bar plot showing top marker genes for the reference cell's cell type (Inflammatory Fibroblasts), with bars indicating average log2 fold change from differential expression analysis (FindMarkers); labels show fold change and percent expression in cluster vs. other cells. (E) Color key legend for all annotated cell types. Please click here to view a larger version of this figure.

Figure 2: Construction of radial spatial neighborhoods and the resulting ε-neighborhood graph. (A) Full tissue view (left) with a reference cell marked by a red circle; zoomed inset (right) showing the local neighborhood around the reference cell (radius = 35 µm). (B) Top row: circular neighborhood overlays at increasing radii (r = 10, 35, 60 µm), done with a subset of cells to reduce visual overwhelm. Bottom row: corresponding ε-neighborhood graphs at each radius. Please click here to view a larger version of this figure.

Figure 3: Ligand-receptor (LR) scoring and construction of the edge-level cell-to-cell (C2C) matrix. (A) Example of LR scoring in tissue context for the FN1–ITGB1 mechanism. A central cell (blue) sends to a neighboring cell (green) within the radial neighborhood; yellow cells are other neighbors. The LR score is computed as the product of ligand transcript count in the sender (13) and receptor transcript count in the receiver (5), yielding a score of 65. (B) Schematic illustration of directed cell-to-cell LR inference: a central cell sends an LR signal to one of its 21 radial neighbors. (C) Schematic of the C2C matrix structure. Columns represent directed cell-cell edges across all radial neighborhoods (including sending, receiving, and autocrine edges); rows represent LR modalities from NICHES inference. Please click here to view a larger version of this figure.

Figure 4: Schematic overview of the five primary data matrices. (A) Gene expression matrix: rows are genes, columns are cells, values are transcript counts. (B) C2N (Cell-to-Neighborhood) matrix: rows are LR modalities, columns are cells, values are average outgoing LR scores (node-aligned). (C) N2C (Neighborhood-to-Cell) matrix: rows are LR modalities, columns are cells, values are average incoming LR scores (node-aligned). (D) Neighborhood Composition matrix: rows are cell types, columns are cells, values are neighbor counts per cell type (node-aligned). (E) C2C (Cell-to-Cell) matrix: rows are LR modalities, columns are directed edges, values are individual L × R scores (edge-aligned). LR: Ligand-receptor. Please click here to view a larger version of this figure.

Figure 5: Three user-specifiable parameters of the connectomics inference workflow. Options for neighborhood definition, ligand-receptor database, and scoring function. Parameters used in this pipeline are highlighted in blue. Please click here to view a larger version of this figure.

Figure 6: Paired visualization of circular neighborhood extent (left column) and corresponding ε-neighborhood graphs (right column) across four radius values. (A) r = 10 µm: neighborhoods are small, and the resulting graph is sparse with many isolated cells. (B) r = 25 µm: neighborhoods expand and graph connectivity increases. (C) r = 35 µm: neighborhoods capture local tissue structure with interpretable graph connectivity. (D) r = 60 µm: neighborhoods are large and the graph becomes overly dense, reducing interpretability. Please click here to view a larger version of this figure.

Figure 7: Annotated RunNICHES() function call. Key decision points are indicated by numbered circles. (1) Expression assay: which Seurat assay to use for LR quantification. (2) Cell type annotation: metadata column specifying cell identity for labeling LR vectors. (3) LR database: choice of curated LR interaction database. (4) Neighborhood definition: spatial neighborhoods defined by a fixed radius (rad.set) or k-nearest neighbors (k); setting one to NULL activates the other if defined. (5) Aggregation method: how neighbor signals are combined for node-level assays ("mean" or "sum"). (6) Output assays representations to compute: edge-level (CellToCellSpatial), outgoing node-level (CellToNeighborhood), and incoming node-level (NeighborhoodToCell). LR: Ligand-receptor. Please click here to view a larger version of this figure.

Figure 8: Clustering results for each node-aligned assay. (A) C2N (outgoing signaling): tissue view, zoomed region with reference cell highlighted, UMAP embedding, and spectral plot showing C2N Cluster 0 top markers. (B) N2C (incoming signaling): same layout with N2C Cluster 1 markers (FN1–ITGA3; the sparse spectrum reflects a generalized incoming signal profile and low feature space). (C) Neighborhood Composition (local architecture): same layout, with Neighborhood Composition Cluster 5 markers, where features are cell types rather than LR modalities. C2N: Cell-to-Neighborhood; N2C: Neighborhood-to-Cell; UMAP: Uniform Manifold Approximation and Projection. Please click here to view a larger version of this figure.

Figure 9: Visualization of outgoing C2N signaling from a single reference cell (white dot) to its 21 radial neighbors. The top-left panel (boxed) shows all outgoing edges as white arrows. The remaining panels show the same neighborhood decomposed by a selection of top LR mechanisms defining C2N Cluster 0. Arrows are colored by LR score (blue = low, red = high). C2N: Cell-to-Neighborhood; LR: Ligand-receptor. Please click here to view a larger version of this figure.

Figure 10: Definition of Focus-Focus and NonFocus-NonFocus edge classes. Left: Full tissue view with Neighborhood Composition Cluster 5 (fibrotic focus) shown in green and all other clusters in grey; a white circle marks the reference cell. Right: Zoomed view of the reference cell neighborhood with C2C edges overlaid. Green edges connect cells within Cluster 5 (Focus-Focus, intra-cluster); grey edges connect cells outside Cluster 5 (NonFocus-NonFocus, extra-cluster). C2C: Cell-to-Cell. Please click here to view a larger version of this figure.

Figure 11: Differential ligand-receptor analysis between Focus-Focus and NonFocus-NonFocus edges. Volcano plot summarizing permutation-based differential LR analysis comparing Focus-Focus edges (both cells in Neighborhood Composition Cluster 5) against NonFocus-NonFocus edges. X-axis: difference in mean LR score (Cluster 5 edges - other edges). Y-axis: -log10 of the false discovery rate (FDR). Red dashed horizontal line: FDR = 0.05 significance threshold. Vertical dashed lines: effect size threshold (|Δ| > 0.66, approximately one standard deviation). Light red shaded region: enriched in fibrotic focus; light blue shaded region: depleted. Red points indicate LRs passing both thresholds (5 up, 0 down). Point size reflects effect magnitude. The footer describes the Y-axis calculation. LR: Ligand-receptor. Please click here to view a larger version of this figure.

Figure 12: Spatial distribution of the five enriched ligand-receptor mechanisms. (A–E) Each row shows one mechanism, in descending order of effect size. Left panels: tissue-wide view with edges colored by LR score (blue = low, red = high); grey base shows inactive edges. Right panels: zoomed view centered on reference cell (white circle with center dot) showing local wiring architecture. LR score color scales are mechanism-specific. LR: Ligand-receptor. Please click here to view a larger version of this figure.
Table 1: Analysis parameters. Every parameter the workflow depends on, the value used in this implementation, where it is set in the configuration file or scripts, and whether the value is specific to this dataset. Please click here to download this file.
Table 2: Radius sensitivity. Edge counts and differential results with the spatial graph rebuilt at 25, 35, and 60 µm, holding the focus cell set fixed at the 1,104 cells identified at 35 µm. Effect sizes are the difference in mean LR score between Focus-Focus and NonFocus-NonFocus edges, with the rank of each mechanism in parentheses. Ligand-receptor. Spearman ρ between effect-size rankings across all 47 mechanisms: 0.998 (25 vs 35 µm), 0.996 (35 vs 60 µm), 0.993 (25 vs 60 µm). Please click here to download this file.
Supplementary File 1: Analysis code and configuration files. Please click here to download this file.