PRECAST: DLPFC Single Sample Analysis

Wei Liu


This vignette introduces the PRECAST workflow for the analysis of single spatial transcriptomics dataset. The workflow consists of three steps

We demonstrate the use of PRECAST to one human dorsolateral prefrontal cortex Visium data that are here, which can be downloaded to the current working path by the following command:

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

Then load to R


The package can be loaded with the command:


Compare PRECAST with DR-SC in analyzing one sample

First, we view the the spatial transcriptomics data with Visium platform.

dlpfc_151672  ## a list including two Seurat object

Prepare the PRECASTObject.

Create a PRECASTObj object to prepare for PRECAST models.

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\). Here, we use user-specified number of clusters.

Select a best model

Put the reults into a Seurat object seuInt.

Save the spatial and tSNE scatter plots for clusters from PRECAST

Fit DR-SC and Plot the spatial and tSNE scatter plots for clusters

Compare the clustering performance of PRECAST and DR-SC.

Compare the tSNE visualiztion performance of PRECAST and DR-SC.

Session information