The CellFunTopic package provides a convenient workflow for data pre-processing (quality control, normalization, dimension reduction, clustering, differential expression analysis, etc.) by integrating methods of Seurat package.

Load in the data

CellFunTopic allows various types of input, including CellRanger outputs, raw gene expression matrix, and popular R/python objects used for single cell analysis such as SingleCellExperiment, Seurat, CellDataSet, AnnData. CellFunTopic will transform different input data into a Seurat object.

Let us use pbmc3k.final as a toy example.

data('pbmc3k.final', package = "pbmc3k.SeuratData")
dim(pbmc3k.final)

SeuratObj <- readData(data = pbmc3k.final, type = 'Seurat', species = "Homo sapiens")
rm(pbmc3k.final); gc()

Standard pre-processing workflow

Then we can perform pre-processing conveniently. If users provide a pre-processed data, this step can be skipped.

SeuratObj <- CalMTpercent(SeuratObj, by = "use_internal_data")
SeuratObj <- QCfun(SeuratObj, plot = F) # set plot = T if you want to get the QC reports.
SeuratObj <- RunSeurat(SeuratObj, nPCs = 10, resolution = 1, plot = FALSE)
unique(Seurat::Idents(SeuratObj)) # see how many clusters we got.

Gene Set Enrichment Analysis (GSEA)

Then we perform Gene Set Enrichment Analysis (GSEA) on the Seurat object. CellFunTopic provides a encapsulated function for GSEA with different databases such as GO (Gene Ontology), KEGG, Reactome, MSigDb, WikiPathways, DO, NCG, DGN.

SeuratObj <- RunGSEA(SeuratObj, by = 'GO')

# save object for later use.
save(SeuratObj, file = "SeuratObj.RData")