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

as.SingleCellExperiment Fails in Seurat_4.0.2 #4531

Closed
bbimber opened this issue May 25, 2021 · 0 comments · Fixed by #4532
Closed

as.SingleCellExperiment Fails in Seurat_4.0.2 #4531

bbimber opened this issue May 25, 2021 · 0 comments · Fixed by #4532
Labels
bug Something isn't working

Comments

@bbimber
Copy link
Contributor

bbimber commented May 25, 2021

Hello,

I'm seeing one warning and two errors in R 4.1, Seurat_4.0.2, and SeuratObject_4.0.1. The most severe is w/ as.SingleCellExperiment. Here is a repro


# Create dummy object:
mat <- matrix(1:100, ncol = 10)
colnames(mat) <- LETTERS[1:10]
rownames(mat) <- LETTERS[1:10]
  
# this works, but prints the warning "Warning: The following arguments are not used: row.names"
# I pointed this issue out with code pointers here: https://github.com/mojaveazure/seurat-object/issues/13
seuratObj <- Seurat::CreateSeuratObject(mat)
  

and then try this:

  sce <- as.SingleCellExperiment(seuratObj)

which gives:

Error in value[3L] :
invalid subscript 'e' in 'altExp(, type="character", ...)':
'RNA' not in 'altExpNames()'

I assume this has to do w/ trying to make as.SingleCellExperiment work with multiple assays in the object? The problem is here:

for (assayn in assay){
	# This fails if you try to swap the active experiment. 
	sce <- SingleCellExperiment::swapAltExp(x = sce, name = assayn, saved = orig.exp.name)
	SummarizedExperiment::rowData(x = sce) <- S4Vectors::DataFrame(x[[assayn]][[]])
	sce <- SingleCellExperiment::swapAltExp(x = sce, name = orig.exp.name, saved = assayn)
}

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

Successfully merging a pull request may close this issue.

2 participants