Contents

1 Introduction

The ggspavis package contains a set of visualization functions for spatially resolved transcriptomics data, designed to work with the SpatialExperiment Bioconductor object class.

These plotting functions are used in our online book OSTA and other work.

2 Examples

Load some example datasets from the STexampleData package and create some example plots.

library(SpatialExperiment)
library(STexampleData)
library(ggspavis)

2.1 10x Genomics Visium: mouse coronal brain section

# load data in SpatialExperiment format
spe <- Visium_mouseCoronal()
# add some values in 'colData' to annotate spots
colData(spe)$sum <- colSums(counts(spe))

# example plots
plotSpots(spe, annotate = "sum")

plotVisium(spe, fill = "sum", trans = "log", highlight = "in_tissue")

2.2 10x Genomics Visium: human brain (DLPFC)

# load data in SpatialExperiment format
spe <- Visium_humanDLPFC()
# example plots
plotSpots(spe, annotate = "ground_truth", palette = "libd_layer_colors")

plotVisium(spe, fill = "ground_truth", highlight = "in_tissue")

2.3 seqFISH: mouse embryo

# load data in SpatialExperiment format
spe <- seqFISH_mouseEmbryo()
# example plots
plotMolecules(spe, molecule = "Sox2")