-
Notifications
You must be signed in to change notification settings - Fork 26
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
Create boxplot function in visualize #218
Conversation
…so it actually acts like a save_dir
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.
Looks great. Can you add it in as a cell to the visualization notebook so we can see what it looks like?
Also looks like you took care of some of #183, can you see if there's anything else? |
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.
looks super duper; just a few comments
random_data = test_utils.make_segmented_csv(100) | ||
random_data = random_data[random_data['PatientID'].isin(np.arange(1, 5))] |
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.
we could make this an option in the test_utils if you think cases like this will become more common
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 only did it because I didn't want the boxplot to display like 10 different categories on one chart. I don't imagine we'll be doing this too often unless we plan to add a lot more faceted graphing functions in visualize.py
, for example.
Yeah, and then all of the plots can get saved there
…On Thu, Sep 10, 2020 at 6:06 PM alex-l-kong ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In ark/analysis/visualize.py
<#218 (comment)>
:
> + if save_dir is not None:
+ if not os.path.exists(save_dir):
+ raise ValueError("save_dir %s does not exist" % save_dir)
+
+ plt.savefig(os.path.join(save_dir, "sample_boxplot_viz.png"))
@ngreenwald <https://github.com/ngreenwald> OK, then would it be best to
add a command in the notebook to create data/example_dataset/visualization
if it doesn't exist?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#218 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJB47KDA6JY5HQHMLYCIZDSFFZY7ANCNFSM4RGBIY5A>
.
|
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.
Seaborn defaults look quite nice. However, you picked Na to plot, aka Sodium, which is not actually a protein target: it's a naturally abundant metal. AKA we don't really care at all about sodium expression. Try picking CD20, CD45, PD-1, or one of the other biological targets.
NaBrO (sorry, I couldn't resist). But yeah, I'll fix that up. |
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.
Looks great. Small tweak to function description
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.
looks gucci
woops sorry, forgot to click go. You guys can merge stuff in once it's approved |
* Add boxplot viz function * Add test function for draw_boxplot and change save_dir functionality so it actually acts like a save_dir * Fix leftover PYCODESTYLE errors * Increase coverage with error tests, and fix split_vals check * PYCODESTYLE * Add new changes, including demo of draw_boxplot * Fix visualize cells test and add plot barchart tests * Finish up visualization cleanup, and adding creation of viz directory in notebook * Fix documentation for get_sorted_data * Change column to visualize boxplot for * Make get_sorted_data args and variable names more clear for documentation purposes
* Add boxplot viz function * Add test function for draw_boxplot and change save_dir functionality so it actually acts like a save_dir * Fix leftover PYCODESTYLE errors * Increase coverage with error tests, and fix split_vals check * PYCODESTYLE * Add new changes, including demo of draw_boxplot * Fix visualize cells test and add plot barchart tests * Finish up visualization cleanup, and adding creation of viz directory in notebook * Fix documentation for get_sorted_data * Change column to visualize boxplot for * Make get_sorted_data args and variable names more clear for documentation purposes
What is the purpose of this PR?
Addresses and closes #204. Addresses and closes #183.
How did you implement your changes
Add a function draw_boxplot to visualize.py which will allow the user to draw (and customize) a boxplot. In the meantime, clean up visualize.py and visualize_test.py.
Remaining issues
The previous way save_dir was being used was more of like a save_prefix. I changed the nature of save_dir and added a little more error checking to make sure we weren't trying to save to a save_dir that didn't exist.