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 in Reductions(obj) : could not find function "Reductions" #112

Open
bbimber opened this issue Mar 1, 2022 · 5 comments
Open

Error in Reductions(obj) : could not find function "Reductions" #112

bbimber opened this issue Mar 1, 2022 · 5 comments

Comments

@bbimber
Copy link
Contributor

bbimber commented Mar 1, 2022

We're calling Vision() from within an R package to load a seurat object. When we call our package's method from R (which in turn calls Vision), the output is this:

Importing counts from obj[["RNA"]]@counts ...
Normalizing to counts per 10,000...
Importing Meta Data from [email protected] ...
Error in Reductions(obj) : could not find function "Reductions"

I believe you should either quality the Seurat methods, or @import Seurat here:

setMethod("Vision", signature(data = "Seurat"),

Is that something you'd consider adding? I'm happy to draft a PR. If I manually run "library(Seurat)" to load seurat, this works, but that's a sub-optimal solution.

@mattjones315
Copy link
Collaborator

Hey @bbimber ,

Sorry you're running into this problem! I'll be happy to make this change in a PR soon.

Thanks for suggesting this and I'll circle back when it's solved.

Best,
Matt

@mattjones315
Copy link
Collaborator

Hi @bbimber ,

I believe I've made the simple fix that you requested in this PR: #113 . Would you mind taking a look and making sure this addresses your problem so I can merge it in?

Thanks!

-Matt

@bbimber
Copy link
Contributor Author

bbimber commented Mar 3, 2022

@mattjones315 Thanks for checking. I dont think that's best practice on how to do this. I think you should either:

  1. In DESCRIPTION, you could put Seurat under Depends. I think this loads it. Not sure if you want to do this since not all applications need seurat

  2. Add "Seurat::" to all the Seurat methods in that codepath

  3. I think it's a better idea to add "@import Seurat" to the roxygen doc, and then re-run that to update NAMESPACE, rather than put "library(Seurat)" in your code.

@bbimber
Copy link
Contributor Author

bbimber commented Mar 3, 2022

Note: the third point is basically what you're already doing in this file with "@import logging"

@mattjones315
Copy link
Collaborator

Hi @bbimber -- I see what you mean, and I see now that this is what we used to handle Seurat 2.X objects.

I've made these changes in the repo, let me know if this works for you.

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

2 participants