Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error seu@assays$RNA$counts : $ operator not defined for this S4 class. for doubletFinder( ) #207

Open
chingyaousf opened this issue May 24, 2024 · 4 comments

Comments

@chingyaousf
Copy link

Error seu@assays$RNA$counts : $ operator not defined for this S4 class.
If the issue of compatibility since I couldn't upgrade Seurat package to ‘5.1.0’ in the server which has no issue of running?

packageVersion("DoubletFinder")
[1] ‘2.0.4’
packageVersion("Seurat")
[1] ‘4.3.0.1’

Find doublets using DoubletFinder

suppressMessages(require(DoubletFinder))
nExp <- round(ncol(seurat_object) * 0.04) # expect 4% doublets
seurat_object <- doubletFinder(seurat_object, pN = 0.25, pK = 0.09, nExp = nExp, PCs = 1:10)
Error in seu@assays$RNA$counts : $ operator not defined for this S4 class

@Hui-XiangZhang
Copy link

I have the same question when using Seurat 4.3 .
Who can sovle this?

@chingyaousf
Copy link
Author

I attempted to solve this issue and it appears to have worked. For detailed instructions, please check the following link:
[Fix for DoubletFinder Error in seu@assays$RNA$counts Operator Not Defined for this S4 Class]
https://github.com/chingyaousf/fix--doubletFinder-Error-in-seu-assays-RNA-counts-operator-not-defined-for-this-S4-class

@ricardo-aaron
Copy link

Yes, changing seu@assays$RNA$counts to seu@assays$RNA@counts in doubletFinder.R AND paramSweep.R and reinstalling DoubletFinder works.

@02-i-need-healing
Copy link

Agreee with ricardo-aaron, it works!

I have modified the corresponding code and compressed it into a zip file. You can save it to your folder and use the following command to install and load it:

remotes::install_local("your path/DoubletFinder.zip")

DoubletFinder.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants