DOI: 10.18129/B9.bioc.stJoincount  

This package is for version 3.17 of Bioconductor; for the stable, up-to-date release version, see stJoincount.

stJoincount - Join count statistic for quantifying spatial correlation between clusters

Bioconductor version: 3.17

stJoincount facilitates the application of join count analysis to spatial transcriptomic data generated from the 10x Genomics Visium platform. This tool first converts a labeled spatial tissue map into a raster object, in which each spatial feature is represented by a pixel coded by label assignment. This process includes automatic calculation of optimal raster resolution and extent for the sample. A neighbors list is then created from the rasterized sample, in which adjacent and diagonal neighbors for each pixel are identified. After adding binary spatial weights to the neighbors list, a multi-categorical join count analysis is performed to tabulate "joins" between all possible combinations of label pairs. The function returns the observed join counts, the expected count under conditions of spatial randomness, and the variance calculated under non-free sampling. The z-score is then calculated as the difference between observed and expected counts, divided by the square root of the variance.

Author: Jiarong Song [cre, aut] , Rania Bassiouni [aut], David Craig [aut]

Maintainer: Jiarong Song <songjiar at>

Citation (from within R, enter citation("stJoincount")):


To install this package, start R (version "4.3") and enter:

if (!require("BiocManager", quietly = TRUE))


For older versions of R, please refer to the appropriate Bioconductor release.


To view documentation for the version of this package installed in your system, start R and enter:



HTML R Script Introduction to stJoincount
PDF   Reference Manual
Text   NEWS


biocViews BiocViews, Clustering, Software, Spatial, Transcriptomics
Version 1.2.0
In Bioconductor since BioC 3.16 (R-4.2) (1 year)
License MIT + file LICENSE
Depends R (>= 4.2.0)
Imports graphics, stats, dplyr, magrittr, sp, raster, spdep, ggplot2, pheatmap, grDevices, Seurat, SpatialExperiment, SummarizedExperiment
Suggests BiocStyle, knitr, rmarkdown, testthat (>= 3.0.0)
Depends On Me
Imports Me
Suggests Me
Links To Me
Build Report  

Package Archives

Follow Installation instructions to use this package in your R session.

Source Package stJoincount_1.2.0.tar.gz
Windows Binary
macOS Binary (x86_64) stJoincount_1.2.0.tgz
macOS Binary (arm64) stJoincount_1.2.0.tgz
Source Repository git clone
Source Repository (Developer Access) git clone
Bioc Package Browser
Package Short Url
Package Downloads Report Download Stats

Documentation »


R / CRAN packages and documentation

Support »

Please read the posting guide. Post questions about Bioconductor to one of the following locations: