-
Notifications
You must be signed in to change notification settings - Fork 21
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 plots for DE analysis and unify plotting API #654
Conversation
# Conflicts: # pertpy/tools/__init__.py
# Conflicts: # .github/workflows/test.yml
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #654 +/- ##
==========================================
- Coverage 66.34% 65.55% -0.79%
==========================================
Files 46 47 +1
Lines 5960 6105 +145
==========================================
+ Hits 3954 4002 +48
- Misses 2006 2103 +97
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! So many improvements in this PR.
are the stars missing for the significance levels here?_utils
modules/files are a code smell. Could we move thesavefig_or_show
code into a plotting module? Could we move the doc stuff into a_doc
file or something?- I didn't always want to mark it, but
show: if
True, show to the plot after saving it.
is maybe better wording then what you have? Another set of colons can also cause unintended issues. - Could you amend the tutorial, please?
Thanks for the review!
|
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
|
Hi @grst! |
The "best" solution IMO would be the Results class object as indicated in the code comments. But since this might entail quite some additional refactoring this is probably beyond the scope of this PR. Why can't you just provide the data frame as you suggest and then filter it for the relevant genes? |
If I understand you correctly, that's what I'm currently doing. I'm just not sure how to incorporate the pairing into this based on the |
@@ -243,7 +299,7 @@ def _map_genes_categories_highlight( | |||
if varm_key is None: | |||
raise ValueError("Please pass a .varm key to use for plotting") | |||
|
|||
raise NotImplementedError("Anndata not implemented yet") | |||
raise NotImplementedError("Anndata not implemented yet") # TODO: Implement this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the anndata usecase here actually? DE results stored in .varm
?
This is not supported by the DE tools either, so not sure this is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure myself - that part was already implemented (or rather not implemented in this case). @Zethson, what exactly did you have in mind here? Should I remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work btw, thank you for working on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more minor points... LGTM in general now
PR Checklist
docs
is updatedDescription of changes
save
,show
,return_fig
) in the plotting functions, and I added a utility method to handle showing and saving plots. Previously, showing and storing figures were handled differently ba the different plotting functions.Discussion points
I'm not entirely sure about the
plot_fold_change
method yet. In #189, it was suggested as a plot for paired samples, but I think it would be nice (and I implemented it that way as of now) if the plot could work directly with theresults_df
returned by all DE tools, i.e., plotting the log-FC from that dataframe. However, I’m unsure how to incorporate the pairing in that case and would appreciate ideas.