knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Performs robust PCA with modified PCs on Seurat objects for scRNA-Seq dimensionality reduction.
You can install scRobustPCA from github with:
# install.packages("devtools") devtools::install_github("gmstanle/scRobustPCA")
Intended only to demonstrate a functional workflow.
pbmc_small
is a subsetted dataset with 80 cells and 230 genes
included in the Seurat
package.
require(Seurat) require(scRobustPCA) pcs.use=1:5 pbmc_small <- FindVariableGenes(pbmc_small, do.plot = F) # optional pbmc_small <- RunRobPCA(pbmc_small, npcs=max(pcs.use), use.modified.pcscores = T)
pairs(GetCellEmbeddings(pbmc_small, reduction.type = 'rpca'))
pbmc_small <- RunTSNE(pbmc_small, reduction.use = 'rpca', dims.use = pcs.use,perplexity=10)
Note: need to set dims.use = pcs.use
parameter or FindClusters
seems to default to using 'pca'
dimensionality reduction.
pbmc_small <- FindClusters(pbmc_small, reduction.type = 'rpca', dims.use = pcs.use, print.output = F) TSNEPlot(pbmc_small)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.