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

from_... and to_SummarizedExperiment #220

Open
ap-- opened this issue Jan 22, 2025 · 4 comments
Open

from_... and to_SummarizedExperiment #220

ap-- opened this issue Jan 22, 2025 · 4 comments

Comments

@ap--
Copy link

ap-- commented Jan 22, 2025

Hello everyone 👋

would it be possible to add support for conversion from and to SummarizedExperiment directly?
One of our researchers asked for it as a convenience feature.

library(anndataR)
library(SummarizedExperiment)
 
nrows <- 200; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
rowData <- DataFrame(feature_id=sprintf("ID%03d", 1:200))
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
                     row.names=LETTERS[1:6])
rse <- SummarizedExperiment(assays=SimpleList(counts=counts),
                            rowData=rowData, colData=colData)
 
a <- from_SingleCellExperiment(rse)  # this currently checks for SingleCellExperiment

Thanks for the great work,
Cheers,
Andreas 😃

@rcannood
Copy link
Collaborator

rcannood commented Feb 6, 2025

#212 was just merged, which adds better support for SingleCellExperiment. Please review the updated documentation for more information.

Having a from_SummarizedExperiment would be nice to have. Do you have a suggested implementation, based on the current available code?

@SZhengP
Copy link

SZhengP commented Feb 7, 2025

Hello,
It seems that two more changes are needed to allow from_SingleCellExperiment to handle SummarizedExperiment objects.
I tested the changes and it now works.
#223

Thank you so much.

@lazappi
Copy link
Collaborator

lazappi commented Feb 12, 2025

What would be the motivation for going to/from a SummarizedExperiment directly? A SingleCellExperiment is more complete and a better match to anndata so I'm wondering what the advantage would be over getting users to do the conversion themselves with as(...)?

@SZhengP
Copy link

SZhengP commented Feb 12, 2025

Hello,
Yes. Using as(se, "SingleCellExperiment") is the strategy we are using now.
It is more of a philosophical thing. Since our data is bulk-RNAseq data, we are reluctant to use SingleCellExperiment class.

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