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

Transfer feature-level metadata from SingleCellExperiment in as.Seurat.SingleCellExperiment function #4205

Closed
lianos opened this issue Mar 10, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lianos
Copy link

lianos commented Mar 10, 2021

Currently (Seurat v4.0.0, SeuratObject v4.0.0) there is no feature-level metadata that transfers over to a Seurat object from a SingleCellExperiment when we call seu <- as.Seurat(mySingleCellExperiment).

I'm not very familiar with the Seurat codebase and the structure of the Seurat object itself, but it looks like injecting this code chunk in between lines 1072 and 1073 here might do the trick:

assays[[1L]] <- AddMetaData(
  assays[[1L]],
  as.data.frame(SingleCellExperiment::rowData(x), row.names = rownames(assays[[1L]])))
@lianos lianos added the enhancement New feature or request label Mar 10, 2021
@torkencz torkencz self-assigned this Mar 12, 2021
@torkencz
Copy link
Collaborator

torkencz commented Apr 2, 2021

Thank you for your suggestion. I added the code snippet and will likely be an update in a later release of Seurat.

@torkencz torkencz closed this as completed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants