As including a more detailed vignette inside the package makes the package exceed the tarball size, more detailed vignettes are hosted on an external website. This is a simplified vignette.

1 Installation

This package can be installed from Bioconductor:

if (!requireNamespace("BiocManager")) install.packages("BiocManager")
BiocManager::install("Voyager")
# Devel version
# install.packages("remotes")
remotes::install_github("pachterlab/Voyager")

2 Introduction

In non-spatial scRNA-seq, the SingleCellExperiment (SCE) package implements a data structure and other packages such as scater implement methods for quality control (QC), basic exploratory data analysis (EDA), and plotting functions, using SCE to organize the data and results. Voyager to SpatialFeatureExperiment (SFE) aims to be analogous scater to SFE, implementing basic exploratory spatial data analysis (ESDA) and plotting. SFE inherits from SCE and SpatialExperiment (SPE), so all methods written for SCE and SPE can be used for SFE as well.

In this first version, ESDA is based on the classic geospatial package spdep, but future versions will incorporate methods from GWmodel, adespatial, and etc.

These are the main functionalities of the Voyager at present:

  • Univariate global spatial statistics, such as Moran’s I, Geary’s C, permutation testing of I and C, correlograms, global G, and semivariogram.
  • Univariate local spatial statistics, such as local Moran’s I, local Geary’s C, Getis-Ord Gi*, Moran scatter plot, and local spatial heteroscedasticity (LOSH).
  • Multivariate spatial statistics, such as MULTISPATI PCA and a multivariate generalization of local Geary’s C.
  • Bivariate spatial statistics, such as Lee’s L (global and local) and cross variograms.
  • Plotting gene expression and colData along with annotation geometries, with colorblind friendly default palettes. The actual geometries are plotted, not just centroids as in Seurat. The tissue image can be plotted behind the geometries.
  • Plotting permutation testing results and correlograms, multiple genes in the same plot, can color by gene, sample, or any other attribute.
  • Clustering correlograms and Moran’s scatter plots
  • Plotting local spatial statistics in space
  • Plotting dimension reduction in space
  • Plotting spatial neighborhood graphs
  • Plotting variograms and variogram maps

Future versions may add user friendly wrappers of some successful spatial transcriptomics data analysis packages for spatially variable genes, cell type deconvolution, and spatial regions on CRAN, Bioconductor, pip, and conda, to provide a uniform syntax and avoid object conversion, as is done in Seurat for some non-spatial scRNA-seq methods.

3 Dataset

Here we use a mouse skeletal muscle Visium dataset from Large-scale integration of single-cell transcriptomic data captures transitional progenitor states in mouse skeletal muscle regeneration. It’s in the SFEData package, as an SFE object, which contains Visium spot polygons, myofiber and nuclei segmentations, and myofiber and nuclei morphological metrics.

library(SFEData)
library(SpatialFeatureExperiment)
library(SpatialExperiment)
library(ggplot2)
library(Voyager)
library(scater)
library(scran)
library(pheatmap)

This is the H&E image:

if (!file.exists("tissue_lowres_5a.jpeg")) {
    download.file("https://raw.githubusercontent.com/pachterlab/voyager/main/vignettes/tissue_lowres_5a.jpeg",
                  destfile = "tissue_lowres_5a.jpeg")
}
knitr::include_graphics("tissue_lowres_5a.jpeg")