Commit 6785aed5 authored by Akdel's avatar Akdel
Browse files

demo site eta

parent 5aa4d545
......@@ -373,17 +373,18 @@ def get_estimated_time(pdb_entries):
return func((l, n), 9.14726052e-06) / 60
@app.callback(dash.dependencies.Output("time-estimate", "children"),
@app.callback([dash.dependencies.Output("time-estimate", "children"),
dash.dependencies.Output("alignment-done", "children")],
[dash.dependencies.Input("align", "n_clicks"),
dash.dependencies.Input("alignment-done", "children")],
[dash.dependencies.State("structure-selection", "value")])
def get_time_estimate(clicked, aln_done, pdb_entries):
if aln_done[0]:
return ""
return "", [False]
elif clicked and pdb_entries:
pdb_entries = [decompress_object(x) for x in pdb_entries]
time = get_estimated_time(pdb_entries)
return f"ETA: {np.round(time,2)} min"
return f"ETA: {np.round(time,2)} min", [False]
else:
return ""
......@@ -396,7 +397,7 @@ def get_time_estimate(clicked, aln_done, pdb_entries):
dash.dependencies.Output("feature-selection", "options"),
dash.dependencies.Output("alignment-data", "children"),
dash.dependencies.Output("pfam-class", "children"),
dash.dependencies.Output("time-estimate", "children")],
dash.dependencies.Output("alignment-done", "children")],
[dash.dependencies.Input("align", "n_clicks")],
......@@ -426,10 +427,10 @@ def align_structures(clicked, pdb_entries, pfam_class, gap_open, gap_extend):
return "", component, dcc.Graph(figure=structure_plot({s.name: s.coords for s in pfam_class.msa.structures}),
id="scatter3d"), compress_object(
features), [{"label": x, "value": x} for x in features[list(features.keys())[0]]], compress_object(
alignment), compress_object(pfam_class), ""
alignment), compress_object(pfam_class), [True]
else:
return "", "", "", compress_object(np.zeros(0)), [
{"label": "no alignment present", "value": "no alignment"}], pdb_entries, pfam_class, ""
{"label": "no alignment present", "value": "no alignment"}], pdb_entries, pfam_class, [False]
@app.callback([dash.dependencies.Output("feature-plot1", "children"),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment