PRECAST: Human Breast Cancer Data Analysis

Wei Liu


This vignette introduces the PRECAST workflow for the analysis of integrating multiple spatial transcriptomics datasets. The workflow consists of three steps

We demonstrate the use of PRECAST to two sliced human breast cancer Visium data that are here, which can be downloaded to the current working path by the following command:

githubURL <- ""
download.file(githubURL, "bc2.rda", mode = "wb")

Then load to R


This data is also available at 10X genomics data website:

Users require the two folders for each dataset: spatial and filtered_feature_bc_matrix. Then the data can be read by the following commond.

# library(DR.SC) dir.file <- 'Section' ## the folders Section1 and Section2, and each includes
# two folders spatial and filtered_feature_bc_matrix seuList <- list() for (r in 1:2) {
# message('r = ', r) seuList[[r]] <- read10XVisium(paste0(dir.file, r)) } bc2 <- seuList

The package can be loaded with the command:


Fit PRECAST using this data

View human breast cancer Visium data from DataPRECAST

bc2  ## a list including two Seurat object

Check the content in bc2


Prepare the PRECASTObject.

Human breast cancer data have been pre-processed and saved as the PRECASTObj format.

Add the model setting


For function PRECAST, users can specify the number of clusters \(K\) or set K to be an integer vector by using modified BIC(MBIC) to determine \(K\). First, we try using user-specified number of clusters. For convenience, we give the selected number of clusters by MBIC (K=14).

Select a best model

Integrate the two samples by the function IntegrateSpaData.

Show the spatial scatter plot for clusters

Show the spatial UMAP/tNSE RGB plot to illustrate the performance in extracting features.

Show the tSNE plot based on the extracted features from PRECAST to check the performance of integration.

Combined differential expression analysis

Plot DE genes’ heatmap for each spatial domains identified by PRECAST.

Session information