Skip to content

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

Open

Description

@bbimber

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.

Activity

  1. mattjones315 commented on Mar 2, 2022

    @mattjones315
    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

  2. mattjones315 commented on Mar 3, 2022

    @mattjones315
    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

  3. bbimber commented on Mar 3, 2022

    @bbimber
    ContributorAuthor

    @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.

  4. bbimber commented on Mar 3, 2022

    @bbimber
    ContributorAuthor

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

  5. mattjones315 commented on Mar 5, 2022

    @mattjones315
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions