-
Notifications
You must be signed in to change notification settings - Fork 22
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
Cohort Tracker #658
Cohort Tracker #658
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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!
Just a few general comments and then some random code comments.
- What do you think about actually combining both plots into one? That's what I thought we'd do. Having them separate is also a good option!
- I think that we'll have to discuss the naming of the functions and parameters a bit more but that's easily changed
- The colormap looks a bit weird. The colors are overlapping a bit too much I think?
plt.tight_layout() | ||
plt.show() | ||
|
||
def plot_flowchart(self, save: str = None, return_plot: bool = True): |
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.
Is there any way to style the graphviz plot? It's pretty ugly^^
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.
From my limited experience here, going to matplotlib in our case seems to make more sense and certainly saves some pain. Not amazingly pretty, still
Fairly big overhaul, now including some test for the plots, moving from graphviz to matplotlib, enhanced coloring, better documentation. To your questions
Yes, I thought to end up there as well. Started off with the two individual plots with the idea of combining them in the end. By now, I am not sure this is helpful anymore; The arguments for two very different plots would be mixed somehow. Making this requires quite some engineering and is open to Errors and additional maintenance, while the added value of having them beneath instead of underneath in a Notebook is marginal I think?
More than happy for any inputs
Oh yes, I think the coloring now is a step forward at least giving some consistency of different colors vs different shadings. New questions
|
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
TODO's
|
for more information, see https://pre-commit.ci
Signed-off-by: zethson <[email protected]>
Signed-off-by: zethson <[email protected]>
for more information, see https://pre-commit.ci
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.
Minor comments! Let's merge it afterwards.
You may want to delete the cohort_tracking.ipynb
notebook from this PR
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
Co-authored-by: Lukas Heumos <[email protected]>
PR Checklist
docs
is updatedDescription of changes
Resolves #646.
This PR suggests a new feature, the
ep.tl.CohortTracker
, which offers tracking and visualization of the cohort during data filtering.It is inspired by the ideas outlined by Ellen et al., offering automation.
Technical details
The implementation is carried out by suggestion a new object,
ep.tl.CohortTracker
, which features methods__call__
to track anAnnData
orDataFrame
object whenever filtering steps have been madeplot_cohort_barplot
to plot a visual summarization of the cohort considered. This is a boiled down visual of atableone
summarization.plot_flowchart
to plot a flowchart of the filtering stepsand has attributes
.tracked_steps
(int
), how many trackings have happened.tracked_tables
(list
), tracked tableones at each stepAdditional context
Example:
(basic plot)
(more customization)