knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This vignette performs dnCIDER on a cross-species pancreas dataset.
In addition to CIDER, we will load the following packages:
library(CIDER) library(Seurat) library(parallel) library(cowplot)
The example data can be downloaded from https://figshare.com/s/d5474749ca8c711cc205.
Pancreatic cell data$^1$ contain cells from human (8241 cells) and mouse (1886 cells).
load("../data/pancreas_counts.RData") # count matrix load("../data/pancreas_meta.RData") # meta data/cell information seu <- CreateSeuratObject(counts = pancreas_counts, meta.data = pancreas_meta) table(seu$Batch)
DnCIDER contains three steps
seu <- initialClustering(seu, additional.vars.to.regress = "Sample", dims = 1:15) ider <- getIDEr(seu, downsampling.size = 35, use.parallel = FALSE, verbose = FALSE) seu <- finalClustering(seu, ider, cutree.h = 0.35) # final clustering
We use the Seurat pipeline to perform normalisation (NormalizeData
), preprocessing (FindVariableFeatures
and ScaleData
) and dimension reduction (RunPCA
and RunTSNE
).
seu <- NormalizeData(seu, verbose = FALSE) seu <- FindVariableFeatures(seu, selection.method = "vst", nfeatures = 2000, verbose = FALSE) seu <- ScaleData(seu, verbose = FALSE) seu <- RunPCA(seu, npcs = 20, verbose = FALSE) seu <- RunTSNE(seu, reduction = "pca", dims = 1:12)
We can see
scatterPlot(seu, "tsne", colour.by = "CIDER_cluster", title = "asCIDER clustering results")
By comparing the dnCIDER results to the cell annotation from the publication$^1$, we observe that dnCIDER correctly identify the majority of populations across two species.
scatterPlot(seu, "tsne", colour.by = "Group", title = "Ground truth of cell populations")
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.