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

SeuratToExpressionSet is not up to date with latest Seurat version #19

Open
CyrilLagger opened this issue Apr 22, 2021 · 4 comments
Open

Comments

@CyrilLagger
Copy link

Hello,

I just noticed that your function SeuratToExpressionSet() assumes by default that the Seurat object is of version 2, and that version 3 can be specified by the user.

bisque/R/utils.R

Lines 47 to 48 in f8ca469

SeuratToExpressionSet <- function(seurat.object, delimiter, position,
version = c("v2", "v3")) {

Seurat recently released their version 4, so it might be useful to update this function.

Looking at this part of your code,

bisque/R/utils.R

Lines 55 to 65 in f8ca469

if (version == "v2") {
get.cell.names <- function(obj) obj@cell.names
get.ident <- function(obj) obj@ident
get.raw.data <- function(obj) obj@raw.data
}
else if (version == "v3") {
get.cell.names <- function(obj) base::colnames(obj)
get.ident <- function(obj) Seurat::Idents(object=obj)
get.raw.data <- function(obj) Seurat::GetAssayData(object = obj,
slot = "counts")
}

I guess it should be sufficient to modify line 60 by:

else if (version %in% c("v3", "v4")) {

and line 48 by:

                                  version = c("v4", "v3", "v2")) {

with the versions in this order, as we can expect that most recent users will work with v4 or v3 rather than v2.

By the way, the documentation might also need to be updated accordingly here

bisque/R/utils.R

Lines 13 to 14 in f8ca469

#' @param seurat.object Seurat object with attributes \emph{raw.data},
#' \emph{ident}, and \emph{cell.names}

as the current Seurat objects don't have those slots anymore.

Hope this can help!

@brandonjew
Copy link
Collaborator

Hi @CyrilLagger, thank you for the suggestion and solution! I'll get around to adding this soon. Much appreciated

@gchen605
Copy link

gchen605 commented Aug 4, 2021

Has this issue been fixed in a new release? I think I am having a related problem in that when I try to load a recent Seurat object I get this error:
Error in getClass(Class, where = topenv(parent.frame())) :
“AnnotatedDataFrame” is not a defined class

@brandonjew
Copy link
Collaborator

Hi @gchen605, this issue has not been addressed yet. If you are using a Seurat v3 or v2 object, the issue may be caused by not loading the Biobase library (with library(Biobase)) before running the function. It also requires the Seurat library to be loaded as well. If you are using a newer Seurat object, you can copy the source code for the SeuratToExpressionSet function and make the small edits suggested by CyrillLagger.

@gchen605
Copy link

gchen605 commented Aug 5, 2021

Thank you for the response - making the small edits as suggested worked.

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

3 participants