diff --git a/callbacks/browse_loci/callbacks.py b/callbacks/browse_loci/callbacks.py index fe931fff..c7e376ce 100644 --- a/callbacks/browse_loci/callbacks.py +++ b/callbacks/browse_loci/callbacks.py @@ -110,7 +110,8 @@ def send_open_chromatin_panicle_url(filename): ) def display_selected_genomic_intervals(nb_intervals_str, homepage_is_submitted, selected_nb_interval): if homepage_is_submitted: - igv_options = nb_intervals_str.split(';') + igv_options = util.sanitize_nb_intervals_str(nb_intervals_str) + igv_options = igv_options.split(';') if not selected_nb_interval: selected_nb_interval = igv_options[0] @@ -171,6 +172,9 @@ def display_igv(selected_nb_intervals_str, selected_tracks, homepage_is_submitte display_tracks = [ track for track in track_info if selected_tracks and track['name'] in selected_tracks] + selected_nb_intervals_str = lift_over_util.to_genomic_interval(selected_nb_intervals_str) + selected_nb_intervals_str = str(selected_nb_intervals_str.chrom) + ':' + str(selected_nb_intervals_str.start) + '-' + str(selected_nb_intervals_str.stop) + return html.Div([ dashbio.Igv( id='igv-Nipponbare-local', diff --git a/callbacks/browse_loci/util.py b/callbacks/browse_loci/util.py index ed420357..56edd059 100644 --- a/callbacks/browse_loci/util.py +++ b/callbacks/browse_loci/util.py @@ -23,7 +23,9 @@ def write_igv_tracks_to_file(nb_intervals_str): def write_gff_igv_track_to_file(source_dir, source_file, nb_intervals_str): if path_exists(source_dir): - loci_list = nb_intervals_str.split(';') + loci_list = util.sanitize_nb_intervals_str(nb_intervals_str) + loci_list = loci_list.split(';') + genomic_interval_list = util.get_genomic_intervals_from_input( nb_intervals_str) diff --git a/callbacks/coexpression/callbacks.py b/callbacks/coexpression/callbacks.py index 08865572..a34e0ed2 100644 --- a/callbacks/coexpression/callbacks.py +++ b/callbacks/coexpression/callbacks.py @@ -6,6 +6,8 @@ from ..lift_over import util as lift_over_util from ..branch import * +import json + Input_parameter_module = namedtuple('Input_parameter_module', [ 'param_slider_marks', 'param_slider_value']) @@ -532,8 +534,18 @@ def download_coexpression_table_to_csv(download_n_clicks, coexpression_df, genom State('coexpression-module-graph', 'elements'), State('homepage-genomic-intervals-submitted-input', 'data') ) - def download_coexpression_table_to_csv(download_n_clicks, coexpression_dict, genomic_intervals): + def download_coexpression_graph_to_csv(download_n_clicks, coexpression_dict, genomic_intervals): if download_n_clicks >= 1: return dict(content='Hello world!', filename=f'[{genomic_intervals}] Co-Expression Network Analysis Graph.txt') raise PreventUpdate + + @app.callback( + Output('coexpression-module-graph-node-data', 'children'), + Input('coexpression-module-graph', 'tapNodeData') + ) + def display_node_data(node_data): + if node_data: + return json.dumps(node_data) + + raise PreventUpdate diff --git a/pages/analysis/co_expr.py b/pages/analysis/co_expr.py index fc1d8ac9..f3c603dd 100644 --- a/pages/analysis/co_expr.py +++ b/pages/analysis/co_expr.py @@ -495,6 +495,8 @@ ] ), + html.Div(id='coexpression-module-graph-node-data', hidden=True), + dcc.Loading([ cyto.Cytoscape( id='coexpression-module-graph',