寫在前面
Doublets :一個液滴或一個微孔中包含了2個或多個細胞。
對于高通量方法,在細胞捕獲效率和雙重比例之間存在折中,通常的做法是以1-5%的雙重線為目標(Ziegenhain et al。,2017)(http://refhub.elsevier.com / S0098-2997(17)30049-3 / sref115) 。
在以前分析單細胞數據的時候,我其實從來沒有注意過這樣一個問題,即使知道可能會出現雙峰,還是會天真地認為自己的專業知識是可以把這一部分避免掉,比如當同時在一類細胞中發現兩種不同的細胞標記(他們之間不可以相互轉化),我一般會果斷的定義為污染。可是隨著看的文獻越來越多,發現細胞之間的特異性標記物越來越模糊,一些不能進行相互轉化的細胞標記物可能存在于某一小類細胞中。
當然,這些?包并不一定能夠解決這些問題,多數的雙峰軟件對異質性較高的細胞之間的預測較好,但希望通過總結這類軟件,提醒大家在定義過渡態細胞時一定要反復去驗證,保證數據的真實性。
雙峰軟件包匯總
1.DoubletFinder
DoubletFinder是一種?包,可預測單細胞RNA 測序數據中的雙重峰。
實現DoubletFinder:Seurat> = 2.0(https://satijalab.org/seurat/)
DoubletFinder由Cell Systems
于2019年4月出版:HTTPS://www.cell.com/cell-systems/fulltext/S2405-4712(19)30073-0
安裝(在R / RStudio中)
devtools::install_github('chris-mcginnis-ucsf/DoubletFinder')
依賴包
修拉(> = 2.0)
矩陣(1.2.14)
領域(9.6)
KernSmooth(2.23-15)
模式(0.7.0)
ROCR(1.0-7)
DoubletFinder概述
DoubletFinder可以分為4個步驟:
(1)從現有的scRNA-seq數據中生成人工雙聯;
(2)預處理合并的真實人工數據;
(3)執行PCA并使用PC距離矩陣查找每個單元的artificial k
最近鄰居(pANN)的比例;
(4)根據預期的雙峰數量排序和計算閾值pANN值;
缺點:DoubletFinder對同種類型細胞間的雙重不敏感 - 即從轉錄相似的細胞狀態衍生的雙重。
例
## Pre-process Seurat object -------------------------------------------------------------------------------------------------
seu_kidney <- CreateSeuratObject(kidney.data)
seu_kidney <- NormalizeData(seu_kidney)
seu_kidney <- ScaleData(seu_kidney, vars.to.regress = "nUMI")
seu_kidney <- FindVariableGenes(seu_kidney, x.low.cutoff = 0.0125, y.cutoff = 0.25, do.plot=FALSE)
seu_kidney <- RunPCA(seu_kidney, pc.genes = seu_kidney@var.genes, pcs.print = 0)
seu_kidney <- RunTSNE(seu_kidney, dims.use = 1:10, verbose=TRUE)
## pK Identification ---------------------------------------------------------------------------------------------------------
sweep.res.list_kidney <- paramSweep(seu_kidney, PCs = 1:10)
sweep.stats_kidney <- summarizeSweep(sweep.res.list_kidney, GT = FALSE)
bcmvn_kidney <- find.pK(sweep.stats_kidney)
## Homotypic Doublet Proportion Estimate -------------------------------------------------------------------------------------
homotypic.prop <- modelHomotypic(annotations) ## ex: annotations <- seu_kidney@meta.data$ClusteringResults
nExp_poi <- round(0.075*length(seu_kidney@cell.names)) ## Assuming 7.5% doublet formation rate - tailor for your dataset
nExp_poi.adj <- round(nExp_poi*(1-homotypic.prop))
## Run DoubletFinder with varying classification stringencies ----------------------------------------------------------------
seu_kidney <- doubletFinder(seu_kidney, PCs = 1:10, pN = 0.25, pK = 0.09, nExp = nExp_poi, reuse.pANN = FALSE)
seu_kidney <- doubletFinder(seu_kidney, PCs = 1:10, pN = 0.25, pK = 0.09, nExp = nExp_poi.adj, reuse.pANN = "pANN_0.25_0.09_913")
## Plot results --------------------------------------------------------------------------------------------------------------
seu_kidney@meta.data[,"DF_hi.lo"] <- seu_kidney@meta.data$DF.classifications_0.25_0.09_913
seu_kidney@meta.data$DF_hi.lo[which(seu_kidney@meta.data$DF_hi.lo == "Doublet" & seu_kidney@meta.data$DF.classifications_0.25_0.09_473 == "Singlet")] <- "Doublet_lo"
seu_kidney@meta.data$DF_hi.lo[which(seu_kidney@meta.data$DF_hi.lo == "Doublet")] <- "Doublet_hi"
TSNEPlot(seu_kidney, group.by="DF_hi.lo", plot.order=c("Doublet_hi","Doublet_lo","Singlet"), colors.use=c("black","gold","red"))
詳情可以點擊DoubletFinder(https://github.com/ddiez/DoubletFinder)對自己的數據進行一下預測哦!
2. scrublet
小號 ingle- ?埃爾- [R做emover ublet小號
用于識別單細胞RNA-seq數據中doublets的Python代碼。可以參考Cell Systems(https://www.sciencedirect.com/science/article/pii/S2405471218304745)上的文章或者bioRxiv(https:// www。 biorxiv.org/content/early/2018/07/09/357368)。
快速開始:
給定原始(非標準化)UMI計算矩陣counts_matrix,其中細胞為行,基因為列,計算每個細胞的雙峰分數:
import scrublet as scr
scrub = scr.Scrublet(counts_matrix)
doublet_scores, predicted_doublets = scrub.scrub_doublets()
scr.scrub_doublets()模擬數據的doublets,并使用k-最近鄰分類器是每個轉錄組計算連續的doublet_score(在0和1之間)。分數是由自動設定的閾值生成
predict_doublets,一個布爾數組,預測是雙峰時為真,否則為假。
最佳做法:
1.處理來自多個樣品的數據時,分別對每個樣品運行Scrublet.Scrublet用于檢測由兩個細胞的隨機共包封形成的雙峰,所以它可能在合并數據集上表現不佳;
2.在2-D嵌入(例如,UMAP或t-SNE)中可視化doublets預測;
安裝:
要使用PyPI進行安裝:
pip install scrublet
要從源安裝:
git clone https://github.com/AllonKleinLab/scrublet.git
cd scrublet
pip install -r requirements.txt
pip install --upgrade .
詳情可以點擊scrublet(https://github.com/AllonKleinLab/scrublet)對自己的數據進行一下預測哦!
3.DoubletDecon
一種細胞狀態識別工具,用于從單細胞RNA-SEQ數據中去除雙峰。
具體步驟可以參見文章:
bioRxiv (https://www.biorxiv.org/content/early/2018/07/08/364810)
安裝
if(!require(devtools)){
install.packages("devtools") # If not already installed
}
devtools::install_github('EDePasquale/DoubletDecon')
依賴包
DeconRNASeq
gplots
dplyr
MCL
clusterProfiler
mygene
tidyr
R.utils
的foreach
doParallel
stringr
source("https://bioconductor.org/biocLite.R")
biocLite(c("DeconRNASeq", "clusterProfiler", "hopach", "mygene", "tidyr", "R.utils", "foreach", "doParallel", "stringr"))
install.packages("MCL")#進行安裝依賴包
例
以下數據的應用均來自于:
bioRxiv (https://www.biorxiv.org/content/early/2018/07/08/364810)
location="/Users/xxx/xxx/" #Update as needed
expressionFile=paste0(location, "counts.txt")
genesFile=paste0(location, "Top50Genes.txt")
clustersFile=paste0(location, "Cluster.txt")
newFiles=Seurat_Pre_Process(expressionFile, genesFile, clustersFile)
filename="PBMC_example"
write.table(newFiles$newExpressionFile, paste0(location, filename, "_expression"), sep="\t")
write.table(newFiles$newFullExpressionFile, paste0(location, filename, "_fullExpression"), sep="\t")
write.table(newFiles$newGroupsFile, paste0(location, filename , "_groups"), sep="\t", col.names = F)
results=Main_Doublet_Decon(rawDataFile=newFiles$newExpressionFile,
groupsFile=newFiles$newGroupsFile,
filename=filename,
location=location,
fullDataFile=NULL,
removeCC=FALSE,
species="hsa",
rhop=1.1,
write=TRUE,
PMF=TRUE,
useFull=FALSE,
heatmap=FALSE,
centroids=TRUE,
num_doubs=100,
only50=FALSE,
min_uniq=4)
詳情可以點擊:
**DoubletDecon **(https://github.com/EDePasquale/DoubletDecon)對自己的數據進行一下去除doublets哦!
4.DoubletDetection
DoubletDetection是一個Python3包,用于檢測單細胞RNA-SEQ計數矩陣中的雙峰(技術錯誤)。
安裝
git clone https://github.com/JonathanShor/DoubletDetection.git
cd DoubletDetection
pip3 install .
運行基本雙峰分類:
import doubletdetection
clf = doubletdetection.BoostClassifier()
# raw_counts is a cells by genes count matrix
labels = clf.fit(raw_counts).predict()
raw_counts是scRNA-seq計數矩陣(基因細胞),并且是陣列式的
標簽是一維numpy ndarray,值1表示檢測到的doublet,0表示單細胞,np.nan表示模糊的細胞。
分類器在以下情況運行最適合
數據中存在幾種細胞類型;
它在聚合計數矩陣中每次單獨運行;
參見jupyter notebook,鏈接為:
詳情可以點擊:
**DoubletDetection **(https://github.com/JonathanShor/DoubletDetection)對自己的數據進行一下預測吧!