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

SeuratData::LoadData throws Error in as.vector(x) : no method for coercing this S4 class to a vector when loading pbmcsca dataset #90

Open
erzakiev opened this issue May 21, 2024 · 3 comments

Comments

@erzakiev
Copy link

> SeuratData::InstallData("pbmcsca")
# installs pbmcsca.SeuratData_3.0.0.tar.gz

When trying to load the pbmcsa dataset, it throws an error. I guess here LoadData actually does preemptively the UpdateSeuratObject, unlike in #86. But it promptly fails:

> obj <- SeuratData::LoadData("pbmcsca")
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Warning: Assay RNA changing from Assay to Assay
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Validating object structure for Assay ‘RNA’
Object representation is consistent with the most current Seurat version
Error in as.vector(x) : no method for coercing this S4 class to a vector

but if I do the trick, mentioned in #70 (comment),
namely:

> library(pbmcsca.SeuratData)
> data("pbmcsca")
> pbmcsca
Error: Please run UpdateSeuratObject on your object
> pbmcsca <- UpdateSeuratObject(pbmcsca)
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Warning: Assay RNA changing from Assay to Assay
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Validating object structure for Assay ‘RNA’
Object representation is consistent with the most current Seurat version

... then it works:

> pbmcsca
An object of class Seurat 
33694 features across 31021 samples within 1 assay 
Active assay: RNA (33694 features, 0 variable features)
 2 layers present: counts, data
@derrik-gratz
Copy link

Thanks for posting this workaround. I had the same issue with the pbcm3k dataset. This worked

@jr-leary7
Copy link

just so the developers are aware, i'm experiencing this issue right now with the pbmc3k dataset using the most recent CRAN version of Seurat and the most recent GitHub version of SeuratData.

@XinLi-0419
Copy link

Thanks for the workaround!

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