DoubletFinder
DoubletFinder copied to clipboard
Seurat v3/v4 compatibility in new release
Hi,
is the current release (v2.0.4) not compatible with Seurat v4.4 objects?
doubletFinder(seu, PCs = 1:10, pN = 0.25, pK = 0.09, nExp = nExp_poi, reuse.pANN = FALSE, sct = FALSE)
gives
Error: $ operator not defined for this S4 class
while downgrading to v2.0.3 (1b1d4e2) and using doubletFinder_v3
works as expected.
thanks!
My package ‘Seurat’ version 5.0.1, and the version of 'DoubletFinder' is 2.0.4, it can work, maybe you can try this. Below is my code : pbmc <- doubletFinder(pbmc, PCs = 1:10, pN = 0.25, pK = 0.005, nExp = nExp_poi, reuse.pANN = FALSE, sct = FALSE)
I have had the same issue using Seurat_4.3.0 and DoubletFinder_2.0.4.
To resolve, I copied the doubletFinder
function from the GitHub page and replaced seu@assays$RNA$counts
by seu@assays$RNA@counts
and that seems to work ... same for the 'paramSweep' function ... hopefully just a syntax issue with Seurat 4?
please use this code to install 2.0.3:
remotes::install_github('https://github.com/ekernf01/DoubletFinder', force = T)
I have had the same issue using Seurat_4.3.0 with either DoubletFinder_2.0.4. or DoubletFinder_2.0.3.
I have had the same issue using Seurat_4.3.0 and DoubletFinder_2.0.4. To resolve, I copied the
doubletFinder
function from the GitHub page and replacedseu@assays$RNA$counts
byseu@assays$RNA@counts
and that seems to work ... same for the 'paramSweep' function ... hopefully just a syntax issue with Seurat 4?
do you mind share the exact part of codes are being replaced?
I have had the same issue using Seurat_4.3.0 and DoubletFinder_2.0.4. To resolve, I copied the
doubletFinder
function from the GitHub page and replacedseu@assays$RNA$counts
byseu@assays$RNA@counts
and that seems to work ... same for the 'paramSweep' function ... hopefully just a syntax issue with Seurat 4?
I follow this and then i get the following error,
"Error in nrow([email protected]) : no slot of name "meta.data" for this object of class "dgCMatrix"
Anyone have any ideas why this is happening and how to fix it? Thanks.
Sorry for this delayed response, I mistook this Email as a commercial. Here are my codes.
#DoubletFinder library(DoubletFinder)
DefaultAssay(Seurat_object) <- "SCT" sweep.res.list <- paramSweep_v3(Seurat_object, PCs = 1:30, sct = T, num.cores = 1) sweep.stats <- summarizeSweep(sweep.res.list, GT = F) bcmvn <- find.pK(sweep.stats) pK_bcmvn <- bcmvn$pK[which.max(bcmvn$BCmetric)] %>% as.character() %>% as.numeric()
pk_bcmvn = 0.24
annotations <- @.***$MainType homotypic.prop <- modelHomotypic(annotations) #DoubletRate = ncol(Seurat_object)7.61e-6 DoubletRate = 0.075 # ~
nExp_poi <- round(DoubletRatelength(Seurat_object$MainType)) #celltype nExp_poi.adj <- round(nExp_poi(1-homotypic.prop))
Seurat_object <- doubletFinder_v3(Seurat_object, PCs = 1:30, pN = 0.25, pK = pK_bcmvn, nExp = nExp_poi, reuse.pANN = FALSE, sct = T) Seurat_object <- doubletFinder_v3(Seurat_object, PCs = 1:30, pN = 0.25, pK = pK_bcmvn, nExp = nExp_poi.adj, reuse.pANN = 'pANN_0.25_0.03_12053', sct = T)
@.[,"DF_hi.lo"] <- @. $DF.classifications_0.25_0.03_8541 @.@.$DF_hi.lo == "Doublet" & @.$DF.classifications_0.25_0.03_8541 == "Singlet")] <- "Doublet-Low Confidience" @.@.$DF_hi.lo == "Doublet")] <- "Doublet-High Confidience" @.$DF_hi.lo) #Doublet-High Confidience Singlet #7929 136602 singlet <- subset(Seurat_object, subset = DF.classifications_0.25_0.03_8541 == "Singlet" | MainType == "Micro")
StumbleMQ @.***>于2023年12月18日 周一18:01写道:
I have had the same issue using Seurat_4.3.0 with either DoubletFinder_2.0.4. or DoubletFinder_2.0.3.
I have had the same issue using Seurat_4.3.0 and DoubletFinder_2.0.4. To resolve, I copied the doubletFinder function from the GitHub page and replaced @.$RNA$counts by @.@.*** and that seems to work ... same for the 'paramSweep' function ... hopefully just a syntax issue with Seurat 4?
do you mind share the code which exact part of codes are being replaced?
— Reply to this email directly, view it on GitHub https://github.com/chris-mcginnis-ucsf/DoubletFinder/issues/175#issuecomment-1859984640, or unsubscribe https://github.com/notifications/unsubscribe-auth/APGE5K4RWQFOX3SFTKCVCTTYKAH7PAVCNFSM6AAAAAA7XXGRK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZHE4DINRUGA . You are receiving this because you commented.Message ID: @.***>
dgCMatrix class object should be your counts, but it seemed that your function accessed meta.data. Please check if you have linked the correct assays.
1054574 @.***> 于2024年1月19日周五 01:23写道:
I have had the same issue using Seurat_4.3.0 and DoubletFinder_2.0.4. To resolve, I copied the doubletFinder function from the GitHub page and replaced @.$RNA$counts by @.@.*** and that seems to work ... same for the 'paramSweep' function ... hopefully just a syntax issue with Seurat 4?
I follow this and then i get the following error,
"Error in @.** @.**>) : no slot of name "meta.data" for this object of class "dgCMatrix"
Anyone have any ideas why this is happening and how to fix it? Thanks.
— Reply to this email directly, view it on GitHub https://github.com/chris-mcginnis-ucsf/DoubletFinder/issues/175#issuecomment-1898907376, or unsubscribe https://github.com/notifications/unsubscribe-auth/APGE5K7GC4XAOABJ6XFTFKTYPFLBJAVCNFSM6AAAAAA7XXGRK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYHEYDOMZXGY . You are receiving this because you commented.Message ID: @.***>