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

Add SingleCellExperiment support #43

Open
czackl opened this issue Jun 15, 2022 · 2 comments
Open

Add SingleCellExperiment support #43

czackl opened this issue Jun 15, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@czackl
Copy link
Collaborator

czackl commented Jun 15, 2022

Since omnideconv can import SingleCellExperiments we should enable users to upload those in the app

@federicomarini
Copy link
Collaborator

An easy way - if the redDim slots and co are not really used: We can simply "cast" that to be a simple SummarizedExperiment object.
Which in the end, it already is, but has some extra slots that one probably won't need here.

That being said: a SCE is already an SE, so ideally we probably don't even need to do anything - what will happen is that simply some of the information in it just won't be used.

Heads up! The check should not be done using the class() function, because that does not capture the fact that SCE is also an SE.
See this chunk to reproduce the idea of it:

> library(SingleCellExperiment)
> 
> my_sce <- SingleCellExperiment::SingleCellExperiment(
+     assays = List(
+         logcounts = matrix(rnorm(1000, mean = 3, sd = 1), nrow = 100)
+     ),
+     reducedDims = List(
+         PCA = matrix(rnorm(20), nrow = 10)
+     )
+ )
> 
> my_se <- SummarizedExperiment::SummarizedExperiment(
+     assays = List(
+         logcounts = matrix(rnorm(1000, mean = 3, sd = 1), nrow = 100)
+     )
+ )
> 
> class(my_sce)
[1] "SingleCellExperiment"
attr(,"package")
[1] "SingleCellExperiment"
> class(my_se)
[1] "SummarizedExperiment"
attr(,"package")
[1] "SummarizedExperiment"
> 
> ## but 
> 
> is(my_sce, "SingleCellExperiment")
[1] TRUE
> is(my_sce, "SummarizedExperiment")
[1] TRUE
> is(my_se, "SingleCellExperiment")
[1] FALSE
> is(my_sce, "SummarizedExperiment")
[1] TRUE

@federicomarini
Copy link
Collaborator

... with is(my_sce, "SummarizedExperiment") being the key of the whole "shortcut"

@alex-d13 alex-d13 added the enhancement New feature or request label Feb 26, 2024
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

3 participants