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

Converting SingleCellExperiment objects into Seurat objects #6692

Closed
mass-a opened this issue Nov 17, 2022 · 2 comments
Closed

Converting SingleCellExperiment objects into Seurat objects #6692

mass-a opened this issue Nov 17, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@mass-a
Copy link

mass-a commented Nov 17, 2022

Hello,

I am having trouble converting SingleCellExperiment objects from the scRNAseq bioconductor collection using as.Seurat. Here's a reproducible example:

BiocManager::install('scRNAseq')
library(scRNAseq)

sce <- ZilionisLungData('mouse')
seurat <- as.Seurat(sce, counts = "counts", data=NULL)
Error in embeddings[i, j, drop = drop, ...] : subscript out of bounds

Several other datasets in the collection give similar errors. Any idea what's going on here? can I e.g. ask as.Seurat to only convert counts and metadata?

Thanks in advance,
-massimo

@mass-a mass-a added the bug Something isn't working label Nov 17, 2022
@alikhuseynov
Copy link

Hi,
..same issue as well.
it only works when removing embeddings (maybe something is wrong with them in that sce object)

library(scRNAseq)
sce <- ZilionisLungData('mouse')
reducedDim(sce) <- NULL # remove dr
object <- as.Seurat(sce, counts = "counts", data = NULL)
An object of class Seurat 
28205 features across 17549 samples within 1 assay 
Active assay: originalexp (28205 features, 0 variable features)

# package versions
lapply(seq(2), function(i) package.version(c("SeuratObject", "Seurat")[i])) %>% unlist
1] "4.1.3"      "4.2.1.9000"

@timoast
Copy link
Collaborator

timoast commented Dec 7, 2022

The problem with this dataset is many of the cell names are duplicated:

library(scRNAseq)
sce <- ZilionisLungData('mouse')
length(unique(colnames(sce)))
[1] 2711
length(colnames(sce))
[1] 17549

This is unusual, and we require that within a Seurat object a cell name is unique to one cell. The issue here is that we are automatically renaming cells with conflicting names, but that renaming is not being performed on the dimension reduction object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants