satijalab / seurat-data

Dataset distribution for Seurat
GNU General Public License v3.0
122 stars 45 forks source link

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 3 months ago

erzakiev commented 3 months ago
> 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 https://github.com/satijalab/seurat-data/issues/70#issuecomment-1648751454, 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