-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
app_needleplot loading data improvements #51
Conversation
…d component or from a file
…om the mutation data and thus another dcc.Upload component in the Upload file option
…data loading and whether or not the user wants to load the protein domains independently. Also added a dcc.Store to share data between callbacks.
… component larger
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 cool! It would be nice to do the same with other database APIs for some of the other components.
…in filename. Implemented Sham's code styling comments
…fixed a typo in needle_plot_parser.py
…d from UniProt, now getting the mutations labels and the multi-site mutations as well
… choose the demo option
…rot downloaded data sets
… independent loading option
Conflicts: tests/dash/app_needle_plot.py Solved 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.
Some minor suggestions. Other than that it looks good!
tests/dash/app_needle_plot.py
Outdated
import dash_core_components as dcc | ||
import dash_html_components as html | ||
from dash.dependencies import Input, Output, State | ||
import dash_bio | ||
|
||
from .utils.needle_plot_parser import UniprotQueryBuilder, extract_mutations, EMPTY_MUT_DATA,\ |
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 was wondering why this is in utils
for tests/dash
? It might belong in dash_bio/utils
, and that way other apps can use it too.
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.
Yes it starts to become big enough for that, some of it is specific to needleplot data parser though, should I still separate the functions that can be used by other apps while moving the sharable code to dash_bio/utils?
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.
@Bachibouzouk I just reviewed your current solution and it looks great :)
tests/dash/app_needle_plot.py
Outdated
else: | ||
return '' | ||
|
||
div = [] |
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.
You might not have to initialize this; at the end you can put return []
instead of return div
and then on line 476 have
return html.Div(
[....]
)
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.
Thanks for the suggestion :)
@@ -430,15 +514,36 @@ def toggle_individual_domain_loading_in_upload(domains_opt, div_style): | |||
@app.callback( | |||
Output('needle-domain-query-info-div', 'style'), | |||
[Input('needle-protein-domains-select-checklist', 'values')], | |||
[State('needle-domain-query-info-div', 'value')] | |||
[ |
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.
Maybe put these on the same line?
[State('needle-domain-query-info-div', 'value'),
State('needle-dataset-select-radio', 'value')]
…ecify the color of the protein domains
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.
Some minor changes
@@ -1,63 +1,15 @@ | |||
import base64 |
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.
Cool! It'll be nice to have all of these tools together for other people to use as well :)
tests/dash/app_needle_plot.py
Outdated
@@ -88,6 +89,14 @@ def description(): | |||
Also known under the lollipop plot name.' | |||
|
|||
|
|||
def header_colors(): | |||
return { | |||
'bg_color': '#00cc96', |
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.
The logo is a bit difficult to see on this color, could you maybe choose something with more contrast?
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.
default header looks good : ) maybe we could leave it like that as it seems to look good on all apps
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.
@VeraZab I thought it would be nice to use different colours for all of our headers, since right now my Clustergram app is the only one with a different colour.
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 guess that's not on dds, I don't see it, thought Pierre's was the only one using a different one. I'll let you guys decide.
html.Div( | ||
id='needle-dataset-select-div', | ||
title='"Demo dataset" choice will allow you to play with the options.\n' | ||
'"UniProt dataset" choice will retrieve protein domain ' |
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.
Use \
to break multiline strings
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.
When I use \
it leaves a bunch of trailing whitespaces in the hover text, so I prefer not to
), | ||
html.Div( | ||
id='needle-protein-domains-select-div', | ||
title='If checked, it will allow the user to load mutation data such ' |
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.
Same as above
Everything looks great :) 💃 |
Dash Bio pull request
Name and description of your component
-added a dcc.Store to share data between the callbacks
-added the option to load protein domains independently from the mutation data, the user can now download the protein domain from UniProt/PFAM database and load their own mutation data on top of it (the protein domains can also be loaded from an individual file as well)
-documented the callbacks and the code
-deleted sample data files which weren't used anymore for needleplot app
addresses #56 and #64
Before asking for a review
PR merging checklist
Please make sure you have done these things before asking for approval to finally merge.
master
: checkout the master branch withgit checkout master
, pull from latest mastergit pull
, checkout to your branchgit checkout your-branch
, merge master into your branchgit merge master
. Resolve conflicts.DDS Deployment
developers
user credentials from a dash-bio team member.git pull
).git remote -v
, make sure you have the dash-bio one:https://dash-gallery.plotly.host/GIT/dash-bio
.git remote add dash-bio https://dash-gallery.plotly.host/GIT/dash-bio
.developers
user credentials, have them ready.git push dash-bio master
.DDS Deployment Debugging
git push dash-bio master
you may encounter the following issue:This may be because the
git
credentials are saved on theclient-side
. In order to solve this, do the following:Windows
OS X