单细胞测序攻略:二聚体过滤——DoubletDecon包攻略
DoubletDecon介绍
提醒:
1.一直到2020年7月一直在更新,直接对接seurat比较好用
2.需要单个样本全部seurat流程走一遍,导出所需文件后进行去除二聚体过程
3.去除二聚体以后用subset取去除二聚体后文件的细胞名称,即可得到取出后的交集
4.整个包的使用流程参考链接里的protocol文章,本篇只是对代码进行入门介绍
注意:不要用Improved_Seurat_Pre_Process,会报错
代码来源:
https://github.com/JonathanShor/DoubletDetection
https://github.com/EDePasquale/DoubletDecon/blob/master/seurat-3.0.R
参考文献:
https://www.cell.com/cell-reports/fulltext/S2211-1247(19)31286-0
https://www.biorxiv.org/content/10.1101/2020.04.23.058156v1.full
第一步 安装包
if(!require(devtools)){
install.packages("devtools") # If not already installed
}
devtools::install_github('EDePasquale/DoubletDecon')
第二步 加载包
library(plyr)
library(dplyr)
library(Matrix)
library(ggplot2)
library(cowplot)
library(Seurat)
library(harmony)
library(DoubletDecon)
library(clusterProfiler)
第三步 读取数据
sce.10x <- Read10X(data.dir = 'D:/HSW/HD/scRNA-seq/')
testdata_1 <- CreateSeuratObject(counts = sce.10x,
project = "testdata_1",
min.cells=3, min.features=500)
testdata_1
第四步 质量控制
testdata_1[["percent.mt"]] <- PercentageFeatureSet(testdata_1, pattern = "^MT-")
testdata_1[["percent.HB"]]<-PercentageFeatureSet(testdata_1,features="HBB")
VlnPlot(testdata_1, features = c("nFeature_RNA", "nCount_RNA", "percent.mt","percent.HB"), ncol = 2)
plot1 <- FeatureScatter(testdata_1, feature1 = "nCount_RNA", feature2 = "percent.mt")
plot2 <- FeatureScatter(testdata_1, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")
CombinePlots(plots = list(plot1, plot2))
testdata_1 <- subset(testdata_1,
subset = nFeature_RNA > 200 & nFeature_RNA < 4000 & percent.mt < 10 & percent.HB < 7)
dim(testdata_1)
testdata_1
第五步 标准流程 Pipeline
testdata_1 <- NormalizeData(testdata_1)
testdata_1 <- FindVariableFeatures(testdata_1, selection.method = "vst", nfeatures = 3000, verbose = FALSE)
testdata_1 <- ScaleData(testdata_1, verbose = FALSE)
testdata_1<- RunPCA(testdata_1, features = VariableFeatures(object =testdata_1))
testdata_1 <- JackStraw(testdata_1 , num.replicate = 100,dims = 50)
testdata_1 <- ScoreJackStraw(testdata_1, dims = 1:20)
JackStrawPlot(testdata_1, dims =1:20)
ElbowPlot(testdata_1,ndims=50)
testdata_1<- FindNeighbors(testdata_1, dims = 1:10)
testdata_1