knitr::opts_chunk$set( collapse = TRUE, eval=TRUE, comment = "#>" )
Each dataset represents one batch and must be a SingleCellExperiment
object. The objects are are merged by passing a list in the next step.
library(dropClust) load(url("https://raw.githubusercontent.com/LuyiTian/CellBench_data/master/data/sincell_with_class.RData")) objects = list() objects[[1]] = sce_sc_10x_qc objects[[2]] = sce_sc_CELseq2_qc objects[[3]] = sce_sc_Dropseq_qc
Datasets can be merged in two ways: using a set of DE genes from each batch or, using the union of the sets of highly variable genes from each batch.
all.objects = objects merged_data<-Merge(all.objects)
set.seed(1) dc.corr <- Correction(merged_data, method="default", close_th = 0.1, cells_th = 0.1, components = 10, n_neighbors = 30, min_dist = 1)
dc.corr = Cluster(dc.corr,method = "hclust")
Compute 2D embeddings for samples followed by post-hoc clustering.
ScatterPlot(dc.corr, title = "Clusters")
Users can use fastmnn
method for batch correction. Specific arguments of fastmnn can also be passed through the Correction
module.
merged_data.fastmnn<-Merge(all.objects,use.de.genes = FALSE) set.seed(1) mnn.corr <- Correction(merged_data.fastmnn, method="fastmnn", d = 10) mnn.corr = Cluster(mnn.corr,method = "kmeans",centers = 3) ScatterPlot(mnn.corr, title = "Clusters")
de<-FindMarkers(dc.corr,q_th = 0.001, lfc_th = 1.2,nDE = 10) de$genes.df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.