-
Notifications
You must be signed in to change notification settings - Fork 10
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 conditional print method for objects that contain alternative experiments #89
base: master
Are you sure you want to change the base?
Conversation
Add show test for alt experiments
Add test
Amazing! So if I can imagine a complex SCE with 3 expriments
we would have `# A SingleCellExperiment-tibble abstraction: 80 × 17
`# Features=230 | Cells=80 | Assays=counts, logcounts, ADT-counts, ADT-logcounts, Hashtag demultiplex-counts, Hashtag demultiplex-logcounts Am I interpreting correctly? |
Yes, exactly. When I tested on a more complicated example I noticed that it creates a new line if the maximum line width is exceeded, but it still prints everything. |
Your solution looks great, and very intuitive, especially if experiment names are short. Just to explore all possibilities, could you think about a solution that avoids the repetition of experiment names, so as to increase the scalability of our printout to many long experiment names? |
Printing the name of the experiment instead, followed by the assayNames and separated by a semi-colon is easy enough.
However, like I said in my (edited) comment above, the native tibble print method will break lines if the character count gets too long (I can actually see a difference in how it's printed on my laptop vs. my wide-screen display). |
I like the idea. Let's present both an "easy" and "hard" scenario to the community.
Agree. I think slack Bioc tidy is the best place where to ask our community. But feel free to use any tool. |
@Biomiha Thinking about it. You can leave it as is; maybe edit the example in the unit test to be the worst-case scenario. If it looks good in the worst-case scenario, there is no reason to change for the time being. And instead, you can focus on the features such as |
New, more comprehensive unit tests
Okay, I've now mocked up the expression matrices for the additional alternative experiments and added that to the unit tests. In my hands it works as expected. Will move on to joining features next. |
Add altExp functionality to `get_abundance_sc_wide` and `get_abundance_sc_long`.
So, I think the |
Split out functions
6e698d5
to
2ad486a
Compare
small tweaks
Remove importFrom dplyr::bind_rows
Remove importFrom `when`
I've now consolidated the differences since the two repos were diverging. For RNA only experiments it should produce the same results and for experiments with CITE-seq / Abseq data it should seamlessly add them to the output. |
The first thing, is to see if your PR passes unit tests (the master branch does). Then, I will review the code to ensure it keeps a consistent style with the main repo (I might ask to change few things in case).
Sure go ahead!
Yes this effort is part of the challenges. But nobody has taken them. We need to optimise tidySCE and tidySE. |
Hi Stefano,
I've now made the printing conditional and have amended the
show()
unit test to assure that the default print method works. For the unit test I've added a randomnormcounts
matrix to the existingpbmc_small
sce object and named itADT
When printed to the console the header now looks like this:
The print method takes any number of alternative experiments and appends the name to the assayNames contained therein, separated by a hyphen. I think this looks the tidiest. I hope you agree.
If no alternative experiments exist, the print output is as before.
I'll start working on how to pull features from the alternative experiment slots into the tibble with
join_features
.