chris-mcginnis-ucsf / DoubletFinder

R package for detecting doublets in single-cell RNA sequencing data
400 stars 106 forks source link

The DoubletFinder bug #116

Closed hahahah-single closed 2 years ago

hahahah-single commented 3 years ago

Hi when I test the method following ,using the following code: seu_kidney <- CreateSeuratObject(pbmc_small@assays$RNA@counts) seu_kidney <- NormalizeData(seu_kidney) seu_kidney <- FindVariableFeatures(seu_kidney, selection.method = "vst", nfeatures = 2000) seu_kidney <- ScaleData(seu_kidney) seu_kidney <- RunPCA(seu_kidney) seu_kidney <- RunUMAP(seu_kidney, dims = 1:10) seu_kidney_2 <- doubletFinder_v3(seu_kidney, PCs = 1:10, pN = 0.25, pK = 0.09, nExp = 10, reuse.pANN = FALSE, sct = FALSE) seu_kidney_3 <- doubletFinder_v3(seu_kidney, PCs = 1:10, pN = 0.25, pK = 0.09, nExp = 20, reuse.pANN = FALSE, sct = FALSE) image

I found that the two result are different. Which one should I use as the correct one or both

chris-mcginnis-ucsf commented 2 years ago

Hi @hahahah-single -- the results are different because you are setting different nExp to different values. nExp tells DoubletFinder where to threshold pANN when making doublet classifications. So setting that value differently (even when other parameters are held constant) will necessarily cause differences in the results.

Chris

hahahah-single commented 2 years ago

Hi @chris-mcginnis-ucsf But setting different nExp will also cause the value of pANN (such as pANN_0.25_0.09_10 and pANN_0.25_0.09_20) to change? nExp tells DoubletFinder where to threshold pANN when making doublet classifications,but how does it affect the calculation of this pANN score?