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

longFormat for SE with rowvars #196

Open
lgatto opened this issue Nov 30, 2023 · 1 comment
Open

longFormat for SE with rowvars #196

lgatto opened this issue Nov 30, 2023 · 1 comment
Assignees

Comments

@lgatto
Copy link
Member

lgatto commented Nov 30, 2023

> class(x)
[1] "SummarizedExperiment"
attr(,"package")
[1] "SummarizedExperiment"
> qf <- QFeatures(list(x = x))

longFormat() works for for QFeatures with and without rowvars:

> head(longFormat(qf))
DataFrame with 6 rows and 5 columns
        assay       primary     rowname       colname     value
  <character>   <character> <character>   <character> <numeric>
1           x control_at...           1 control_at...        NA
2           x control_at...           2 control_at...   20.2415
3           x control_at...           3 control_at...   18.8851
4           x control_at...           4 control_at...   18.1608
5           x control_at...           5 control_at...   19.1839
6           x control_at...           6 control_at...   15.6747
> head(longFormat(qf, rowvars = "nNA"))
DataFrame with 6 rows and 6 columns
        assay       primary     rowname       colname     value       nNA
  <character>   <character> <character>   <character> <numeric> <integer>
1           x control_at...           1 control_at...        NA         5
2           x control_at...           2 control_at...   20.2415         0
3           x control_at...           3 control_at...   18.8851         0
4           x control_at...           4 control_at...   18.1608         2
5           x control_at...           5 control_at...   19.1839         0
6           x control_at...           6 control_at...   15.6747         1

longFormat() works for an SE only without rowvars:

> head(longFormat(x))
  rowname      colname    value
1       1 control_atcc       NA
2       2 control_atcc 20.24148
3       3 control_atcc 18.88513
4       4 control_atcc 18.16084
5       5 control_atcc 19.18385
6       6 control_atcc 15.67467
> head(longFormat(x, rowvars = "nNA"))
Error in (function (cond)  : 
  error in evaluating the argument 'x' in selecting a method for function 'head': inherits(x, "MultiAssayExperiment") is not TRUE
@lgatto
Copy link
Member Author

lgatto commented Dec 12, 2023

Or switch to tidySummarizedExperiment and tidySingleCellExperiment.

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

2 participants