knitr::opts_chunk$set(echo = TRUE)

Introduction

The STexampleData package contains a collection of spatial transcriptomics datasets, which have been formatted into the SpatialExperiment Bioconductor class, for use in examples, demonstrations, and tutorials. The datasets are from several different technological platforms and have been sourced from various publicly available sources. Some of the datasets include images and/or reference annotation labels.

Installation

The STexampleData package can be installed from Bioconductor:

install.packages("BiocManager")
BiocManager::install("STexampleData")

Datasets

The package contains the following datasets:

Load data

The following examples show how to load the example datasets as SpatialExperiment objects in an R session.

There are two options for loading the datasets: either using named accessor functions or by querying the ExperimentHub database.

Load using named accessors

library(SpatialExperiment)
library(STexampleData)

Visium_humanDLPFC

# load object
spe <- Visium_humanDLPFC()

# check object
spe
dim(spe)
assayNames(spe)
rowData(spe)
colData(spe)
head(spatialCoords(spe))
imgData(spe)

Visium_mouseCoronal

# load object
spe <- Visium_mouseCoronal()
# check object
spe

seqFISH_mouseEmbryo

# load object
spe <- seqFISH_mouseEmbryo()
# check object
spe

ST_mouseOB

# load object
spe <- ST_mouseOB()
# check object
spe

SlideSeqV2_mouseHPC

# load object
spe <- SlideSeqV2_mouseHPC()
# check object
spe

Janesick_breastCancer_Chromium

# load object
# note: this dataset is in SingleCellExperiment format
sce <- Janesick_breastCancer_Chromium()
# check object
sce

Janesick_breastCancer_Visium

# load object
spe <- Janesick_breastCancer_Visium()
# check object
spe

Janesick_breastCancer_Xenium_rep1

# load object
spe <- Janesick_breastCancer_Xenium_rep1()
# check object
spe

Janesick_breastCancer_Xenium_rep2

# load object
spe <- Janesick_breastCancer_Xenium_rep2()
# check object
spe

CosMx_lungCancer

# load object
spe <- CosMx_lungCancer()
# check object
spe

MERSCOPE_ovarianCancer

# load object
spe <- MERSCOPE_ovarianCancer()
# check object
spe

STARmapPLUS_mouseBrain

# load object
spe <- STARmapPLUS_mouseBrain()
# check object
spe

Load by querying ExperimentHub database

library(ExperimentHub)
# create ExperimentHub instance
eh <- ExperimentHub()

# query STexampleData datasets
myfiles <- query(eh, "STexampleData")
myfiles

# metadata
md <- as.data.frame(mcols(myfiles))
# load 'Visium_humanDLPFC' dataset using ExperimentHub query
spe <- myfiles[[1]]
spe
# load 'Visium_humanDLPFC' dataset using ExperimentHub ID
spe <- myfiles[["EH9516"]]
spe

Generating objects from raw data files

For reference, we include code scripts to generate the SpatialExperiment objects from the raw data files.

These scripts are saved in /inst/scripts/ in the source code of the STexampleData package. The scripts include references and links to the data files from the original sources for each dataset.

Session information

sessionInfo()


lmweber/STdata documentation built on May 19, 2024, 6:39 p.m.