10X genomicsseurat

DoubletFinder 去除双细胞

2020-05-31  本文已影响0人  大吉岭猹

1. 参考资料

2. DoubletFinder 概述

3. 代码

## 因为几乎全都是中间变量,就没好好命名
# 找最佳 PK
sweep.res.list_kidney <- paramSweep_v3(seurat, PCs = 1:40, sct = T)
sweep.stats_kidney <- summarizeSweep(sweep.res.list_kidney, GT = FALSE)
bcmvn_kidney <- find.pK(sweep.stats_kidney)
mpK<-as.numeric(as.vector(bcmvn_kidney$pK[which.max(bcmvn_kidney$BCmetric)]))

# 找最佳 nExp
annotations <- seurat@meta.data$seurat_clusters
homotypic.prop <- modelHomotypic(annotations)
nExp_poi <- round(0.075*ncol(seurat@assays$integrated@data))
nExp_poi.adj <- round(nExp_poi*(1-homotypic.prop))

# 找 Doublet
seurat_filterDouble <- doubletFinder_v3(seurat, PCs = 1:40, pN = 0.25, pK = mpK, nExp = nExp_poi, reuse.pANN = FALSE, sct = T)

4. 结果

> table(seurat_integrated_filterDouble$DF.classifications_0.25_0.28_1042)

Doublet Singlet
   1042   12849
image

友情宣传

上一篇 下一篇

猜你喜欢

热点阅读