Skip to content
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 variantmap #504

Closed
wants to merge 10 commits into from
Closed

Add variantmap #504

wants to merge 10 commits into from

Conversation

cytham
Copy link

@cytham cytham commented Jun 9, 2020

About

  • I am closing an issue
  • This is a new component
  • I am adding a feature to an existing component, or improving an existing feature

Description of changes

Proposing to add VariantMap component into Dash Bio. VariantMap is a genomic structural variant (SV) visualization technique that displays variants across multiple samples in a single heatmap. It leverages on Dash's interactive figures to ease the navigation across massive amounts of SVs in multiple samples, thereby allowing global and local comparisons of SVs within a sample cohort. Gene annotations are also provided for each SV within the figure which assist users in identifying SVs with specific annotations of interest for further investigation.

The input file required for VariantMap is a HDF5 file which can be generated by VariantBreak using VCF files generated from the long-read SV caller NanoVar. Both VariantBreak and NanoVar are available on Conda, PyPI and GitHub. The usage of VCF files generated from other SV callers is still work in progress.

I have also written an app to go with VariantMap and have placed it in tests/dashbio_demos/dash-variant-map, together with sample data, CSS, and demo_image.

One problem I faced with the app is its inability to run on Chrome when large datasets (>32Mb) are used. However, Mozilla Firefox works fine in such cases.

I hope you find VariantMap value adding to Dash Bio.

Thanks

cytham

demo-image

@alexcjohnson
Copy link
Collaborator

@cytham this looks great - nice job in particular constructing the discrete colorbar 🎉

Seems like we have a problem with the CI tests, that has nothing to do with your PR, I'll have to take a closer look. But would you mind adding a simple snapshot test? Something like the first speck test should suffice:

def test_dbsp001_rotate(dash_duo):
app = dash.Dash(__name__)
app.layout = html.Div(
dash_bio.Speck(
id=_COMPONENT_ID,
data=_data
)
)
dash_duo.start_server(app)
dash_duo.wait_for_element('#' + _COMPONENT_ID)
speck = dash_duo.find_element('#' + _COMPONENT_ID + ' canvas')
ac = ActionChains(dash_duo.driver)
ac.move_to_element(speck).drag_and_drop_by_offset(
speck, 150, 200).perform()
dash_duo.percy_snapshot('test-speck_rotate')

Even the interaction part (lines 36-39 there) is unnecessary in this case - just:

# set up a simple app - just use static sample data

# then test that it renders and take a snapshot
dash_duo.start_server(app) 
dash_duo.wait_for_element('#' + _COMPONENT_ID) # use the ID you put for the variantmap
dash_duo.percy_snapshot('test-speck_rotate')

@cytham
Copy link
Author

cytham commented Jun 22, 2020

@alexcjohnson Thanks!

I did not add an ID parameter for VariantMap. Should I add it in? or should I create the test as such in manhatten plot:

def test_dbmp001_genomewideline_value(dash_duo):
app = dash.Dash(__name__)
app.layout = html.Div(nested_component_layout(
dash_bio.ManhattanPlot(
dataframe=_data
)
))
nested_component_app_callback(
app,
dash_duo,
component=dash_bio.ManhattanPlot,
component_data=_data,
data_prop_name='dataframe',
test_prop_name='genomewideline_value',
test_prop_value=3,
prop_value_type='int',
take_snapshot=True
)

@alexcjohnson
Copy link
Collaborator

VariantMap just makes a figure to go in a dcc.Graph, so it doesn't need an id. And the nested... helpers seem overly complicated for this purpose - you can just do:

app = dash.Dash(__name__)
app.layout = dcc.Graph(
    id="variantmap",
    figure=fig  # fig = VariantMap(...)
)

dash_duo.start_server(app)
dash_duo.wait_for_element('#variantmap')
dash_duo.percy_snapshot('variantmap-basic')

@alexcjohnson
Copy link
Collaborator

The new test looks great, thanks! Let me try to figure out why the CI runs are failing, but again that doesn't look like it has anything to do with this PR.

@cytham
Copy link
Author

cytham commented Jul 13, 2020

Hi @alexcjohnson, any luck on fixing the CI runs?

@alexcjohnson
Copy link
Collaborator

@cytham thanks for the nudge - I got halfway through it then got pulled into a different project. I should be able to get back to it later this week.

@cytham
Copy link
Author

cytham commented Jul 30, 2020

Hi @alexcjohnson, will you be free soon to look into this? thanks

@alexcjohnson
Copy link
Collaborator

Still a few things to sort out here... Clustergram has some real test failures (unrelated to this PR) which I imagine @nicholas-esterer's work is going to fix. Not sure why Py37 failed to run the tests at all. And I need to figure out how to deploy your new test app - looks like I have to do something outside of this repo to get that working, but unfortunately the person who set that all up has left Plotly. Making progress, but not quite there yet.

@cytham
Copy link
Author

cytham commented Aug 1, 2020

Thanks for the update, let me know if I can help.

@nicholas-esterer
Copy link
Contributor

I hope that my clustergrams code will eventually pass these tests but I'm having trouble with CI, too. See my PR for clustergrams here: #512. Maybe doing some CI plumbing will fix my problems too.

@cytham
Copy link
Author

cytham commented Nov 21, 2020

Hi, any update on solving this issue?

@HammadTheOne HammadTheOne self-assigned this Jul 23, 2021
@HammadTheOne HammadTheOne mentioned this pull request Jul 30, 2021
2 tasks
@HammadTheOne
Copy link
Contributor

Closed through #567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants