Skip to contents

The function CreateiSCMEBObject is used to create the iSC.MEB object with preprocessing step.

Usage

CreateiSCMEBObject(
  seuList,
  project = "iSC.MEB",
  gene.number = 2000,
  selectGenesMethod = c("SPARK-X", "HVGs"),
  numCores_sparkx = 1,
  customGenelist = NULL,
  premin.spots = 20,
  premin.features = 20,
  postmin.spots = 15,
  postmin.features = 15,
  rawData.preserve = FALSE,
  verbose = TRUE
)

Arguments

seuList

A list consisting of Seurat objects, where each object is a SRT data batch. The default assay of each Seurat object will be used for data preprocessing and followed model fitting. The specified format about seuList argument can be referred to the details and example.

project

An optional string, name of the project, default as "iSC.MEB".

gene.number

An optional integer, the number of top spatially variable genes (SVGs) or highly variable genes (HVGs) to be chosen.

selectGenesMethod

An optional integer, the method to select genes for each sample. It supports 'SPARK-X' and 'HVGs' to select genes now. Users can provide self-selected genes using customGenelist argument.

numCores_sparkx

An optional integer, specify the number of CPU cores in SPARK package to use when selecting spatial genes.

customGenelist

An optional string vector, the list of user specified genes to be used for PRECAST model fitting. If this argument is given, SVGs/HVGs will not be selected.

premin.spots

An optional integer, the features (genes) are retained in raw data filtering step with at least premin.spots number of spots, default is 20.

premin.features

An optional integer, the locations are retained in raw data filtering step with at least premin.features number of nonzero-count features (genes), default is 20.

postmin.spots

An optional integer, the features (genes) are retained in filtering step after common genes selected among all data batches with at least premin.spots number of spots, default is 15.

postmin.features

An optional integer, the locations are retained in filtering step after common genes selected among all data batches with at least premin.features number of nonzero-count features (genes), default is 15.

rawData.preserve

An optional logical value, whether preserve the raw seuList data.

verbose

An indictor of whether display the message in the creating process.

Value

Returns iSC.MEB object prepared for iSC.MEB model fitting.

Details

seuList is a list with Seurat object as component, and each Seurat object includes the raw expression count matrix, spatial coordinates and meta data for each data batch, where the spatial coordinates information must be saved in the metadata of Seurat, named "row" and "col" for each data batch.

See also

Examples

data(iSCMEBObj_toy)
#> Warning: data set 'iSCMEBObj_toy' not found
library(Seurat)
seuList <- iSCMEBObj_toy@seulist
## Check the input of seuList for create iSC.MEB object.
## Check the default assay for each data batch
sapply(seuList, DefaultAssay)
#> [1] "RNA" "RNA"
## Check the spatial coordinates in the meta data named "row" and "col".
colnames(seuList[[1]]@meta.data)
#> [1] "orig.ident"            "nCount_RNA"            "nFeature_RNA"         
#> [4] "layer_guess_reordered" "row"                   "col"                  
## Then create iSC.MEB object using this seuList. 
## For convenience, we show the  user-specified genes' list for creating iSC.MEB object. 
## Users can use SVGs from SPARK-X or HVGs.
Genelist <- row.names(seuList[[1]])
iSCMEBObj_toy2 <- CreateiSCMEBObject(seuList, customGenelist=Genelist, verbose=FALSE)