Repository navigation
Tutorial notebook for Pearson residuals - #43
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
hi @jlause , sorry again for late reply , I think the current tutorial look really good! I'd like to have someone else review it as well, I'll ask internally for another pair of eyes as well (should be quicker than mine 😅 ). Will keep you posted here! Giovanni |
|
View / edit / reply to this conversation on ReviewNB cartal commented on 2021-08-04T15:50:37Z Personal preference: I would like to add a header with what the notebook is about and what the goal is. jlause commented on 2021-08-04T16:10:30Z Ok, I can add something like that tomorrow! jlause commented on 2021-08-05T22:55:55Z (done) |
|
View / edit / reply to this conversation on ReviewNB cartal commented on 2021-08-04T15:50:38Z This is a beautiful and clear explanation of what is going on. I would just add a reference fo the method for more details. jlause commented on 2021-08-04T16:09:41Z Ok, will do!
jlause commented on 2021-08-05T22:56:24Z (done) |
|
View / edit / reply to this conversation on ReviewNB cartal commented on 2021-08-04T15:50:39Z As a general rule, I personally split the processing cells and the plotting cells so they are separated. It helps me focus on what is going on and keep my notebook clean. Regarding colours, Red and Blue are fine, but also consider Gold and Blue or Purple and Green. I would move the genes for jlause commented on 2021-08-04T16:09:07Z Good points, thank you! I will split/reorganize the cell a little and add an explanation why the markers are needed/where they come from etc
Is there a default scanpy tutorial color scheme? Then I'd be happy to use that of course :) jlause commented on 2021-08-05T22:57:35Z Did the splitting and moved/explained the marker list above.
Left the colors as they are for now, but let me know if there is a favorite scanpy color scheme! giovp commented on 2021-08-06T11:23:23Z I think it looks great! jlause commented on 2021-08-06T21:41:24Z ok, then I'll leave it like this for now |
|
View / edit / reply to this conversation on ReviewNB cartal commented on 2021-08-04T15:50:40Z Ok, so DEGs from small populations will produce larger residuals. Define small population. What if I don't have small population in my data? Should I still use this method or go back to standard _This is why it makes sense to use them as basis for downstream processing._ - Not from this explanation. Also, can we do this with UMAP as well? jlause commented on 2021-08-04T16:05:58Z Thank you for your feedback, I will try to clarify those points! jlause commented on 2021-08-05T22:59:11Z Done - let me know of you find it clearer now :) |
|
View / edit / reply to this conversation on ReviewNB cartal commented on 2021-08-04T15:50:41Z Very nice!
One question: could you add an example of how many cells do you mean by large or small? jlause commented on 2021-08-04T16:04:22Z Sure, I can e.g. add an example configuration how we processed a 2-million cell dataset with this method -- but the optimal settings for any will depend strongly on the amount of RAM available. jlause commented on 2021-08-05T22:57:52Z done |
|
Sure, I can e.g. add an example configuration how we processed a 2-million cell dataset with this method -- but the optimal settings for any will depend strongly on the amount of RAM available. View entire conversation on ReviewNB |
|
Thank you for your feedback, I will try to clarify those points! View entire conversation on ReviewNB |
|
Good points, thank you! I will split/reorganize the cell a little and add an explanation why the markers are needed/where they come from etc
Is there a default scanpy tutorial color scheme? Then I'd be happy to use that of course :) View entire conversation on ReviewNB |
|
Ok, will do!
View entire conversation on ReviewNB |
|
Ok, I can add something like that tomorrow! View entire conversation on ReviewNB |
|
(done) View entire conversation on ReviewNB |
1 similar comment
|
(done) View entire conversation on ReviewNB |
|
Did the splitting and moved/explained the marker list above.
Left the colors as they are for now, but let me know if there is a favorite scanpy color scheme! View entire conversation on ReviewNB |
|
done View entire conversation on ReviewNB |
|
Done - let me know of you find it clearer now :) View entire conversation on ReviewNB |
|
I think it looks great! View entire conversation on ReviewNB |
|
View / edit / reply to this conversation on ReviewNB lazappi commented on 2021-08-06T14:53:37Z Nice intro, small typo in "archieved" -> "achieved" jlause commented on 2021-08-06T19:59:00Z thx! fixed :) |
|
View / edit / reply to this conversation on ReviewNB lazappi commented on 2021-08-06T14:53:38Z Typo "Preperations" -> "Preparations" jlause commented on 2021-08-06T19:59:05Z fixed! |
|
View / edit / reply to this conversation on ReviewNB lazappi commented on 2021-08-06T14:53:39Z Is this used in the tutorial? If not I would probably leave it out. jlause commented on 2021-08-06T19:07:45Z Yes, we use |
|
View / edit / reply to this conversation on ReviewNB lazappi commented on 2021-08-06T14:53:39Z Is there a way to include the code without it being run other than commenting it? I feel this might be confusing for users who are probably copy-pasting from the web. Maybe just describe how to get the data in text or maybe there is a Scanpy function that could be used? jlause commented on 2021-08-06T19:14:01Z I pretty much copied the approach from one of the existing tutorials: https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html
so I thought it might be ok like this. But you are right: For the 3k data there actually is a function that does the job: https://scanpy.readthedocs.io/en/stable/generated/scanpy.datasets.pbmc3k.html. for the 10k dataset, we would need to create a similar function for the 10k dataset.. happy to do that, but I'll leave that up to the scanpy team to decide :)
|
|
View / edit / reply to this conversation on ReviewNB lazappi commented on 2021-08-06T14:53:40Z I would probably move this to straight after importing packages. jlause commented on 2021-08-06T19:59:19Z ok! done |
|
Ok, I added short intro sentences to all cells - I think it was a good idea because it added some more motivation/context to some of the details
Regarding caching: I have not checked all tutorials, but in https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html caching is used as well View entire conversation on ReviewNB |
|
ok, fixed! View entire conversation on ReviewNB |
|
ok! View entire conversation on ReviewNB |
|
ok, changed accordingly! View entire conversation on ReviewNB |
|
I added a comment & explainer when the layer is created! View entire conversation on ReviewNB |
|
Right, I use those as a habit but it might be distracting here. removed and now using defaults! View entire conversation on ReviewNB |
|
good point, looping is not necessary here at all, fixed!
View entire conversation on ReviewNB |
|
Yes, sure - I struggled to do it cleanly within the loop so I switched back to just modifying the two View entire conversation on ReviewNB |
|
(I think this also makes it much more readable :) ) View entire conversation on ReviewNB |
|
I agree, such a function makes a lot of sense to have (for any gene selection method, actually). Are you suggesting to add it as a scanpy core plotting function? Maybe you as the scanpy team should decide if we need to have it now, or add it at a later point and then change the tutorial again..? View entire conversation on ReviewNB |
|
ok, then I'll leave it like this for now View entire conversation on ReviewNB |
Thanks a lot for the feedback @lazappi, that was very helpful! I made another improved revision including your suggestions which I will push in a moment. You also raised some issues that might require a joint decision from the scanpy team @giovp @cartal @lazappi @ivirshup:
Let me know what you think :) |
|
PS: I added a brief mention of the wrapper functions ( |
…-tutorials into tutorial_pearson_residuals
|
@jlause I decided to also put this paper in references https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02584-9
At this point, I think this is fine although although a bit suboptimal. We have a pbmc3k datasets in Scanpy
it would be very useful indeed but I think if you are still willing we can postpone it to another PR. |
|
Thanks for the feedback!
Yes that makes sense! I slightly edited the reference section again to have all references in the same format as the references in the scanpy docs (Authors, Title, Journal_with_Link).
I think it would be nice to keep both in. If I'd need to choose, I'd prefer to keep the newer chemistry, because I think people would like to see a new method demonstrated on that. I could also write a loading function similar to the
Okay, if you want to I can setup a PR for that next week and then we can see when there is time to merge it :) |
thank you!
makes sense, let's wait as datasets in general needs refactoring and also another host (pbmc3k in hosted by alex somwhere and makes CI fails sometime)
that'd be great, not sure if we can fit it in for this release already but it'd be useful to have so I assume this is ready to merge then @jlause ? |
okay sounds good!
from my side yes! thanks a lot once more :) |
Hey all!
@giovp asked me over at scverse/scanpy#1715 to create a tutorial/demo notebook for the Pearson residual functions that I wrote for scanpy. Here is the first version I prepared.
In the notebooks I am using two different datasets to demonstrate an example workflow based on Pearson residuals. I borrowed some code/structure from the existing pbmc3k-tutorial, and restricted myself to showing the core functionality of Pearson residuals. For everything not directly demonstrated, I added some info on the optional arguments in the end.
Hope this is along the lines of what you expected - if not I'm happy to adjust :)
Looking forward to your feedback!
Jan