def Figure(radio, check): avialable_Plot = [ 'Bar_Graph', 'Scatter', 'Sunburst', 'Orthographic', 'natural_earth', 'Continential' ] if radio is None and check is None: layout = html.Div( html.H4(html.Center('Select file \n and \n plot type'))) return layout elif radio is None: layout = html.Div( html.H4(html.Center('Select plot type from available plots'))) return layout elif check is None: layout = html.Div(html.H4( html.Center('Select file from loaded files'))) return layout else: if len(check) == 0: layout = html.Div( html.H4(html.Center('Select file from loaded files'))) return layout else: figure = Plotly_graph(Plot_points(upLoaded_Details, check), avialable_Plot[int(radio) - 1]) if avialable_Plot[int(radio) - 1] == 'Bar_Graph' or avialable_Plot[ int(radio) - 1] == 'Scatter' or avialable_Plot[ int(radio) - 1] == 'Sunburst' or avialable_Plot[ int(radio) - 1] == 'Continential': layout = html.Div(children=plot_Layouts(figure)) return layout else: layout = html.Div(children=dcc.Graph(figure=figure)) return layout
def setTable(svB, uvB, daB, file_select): ctx = dash.callback_context if not ctx.triggered: button_id = 'No clicks yet' else: button_id = ctx.triggered[0]['prop_id'].split('.')[0] if 'SV_button' == button_id and file_select != []: if len(file_select) > 1: ordered_Files = Sort_info( Plot_points(upLoaded_Details, file_select), 'Bar_Graph') use_file = Usable_files(True, ordered_Files) if len(use_file) > 0: layout = html.Div(style={'white-space': 'pre-wrap'}, children=setting_VariantInfo( True, False, use_file, Database)) return layout else: return html.H6("Selected files with different enzymes") else: return html.H6("Single file selected") if 'UV_button' == button_id and file_select != []: if len(file_select) > 1: ordered_Files = Sort_info( Plot_points(upLoaded_Details, file_select), 'Bar_Graph') use_file = Usable_files(True, ordered_Files) if len(use_file) > 0: layout = html.Div(style={'white-space': 'pre-wrap'}, children=setting_VariantInfo( False, False, use_file, Database)) return layout else: return html.H6("Selected files with different enzymes") else: return html.H6("Single file selected") if 'DrugA_button' == button_id and file_select != []: if len(file_select) >= 1: return AD_dropdown() else: return "No file selected"
def Opioids(clicks, value): if clicks != None and clicks % 2 > 0: ordered_Files = Sort_info(Plot_points(upLoaded_Details, value), 'Bar_Graph') enzymes_Name = Usable_files(False, ordered_Files) return drugs_Affected(enzymes_Name, 'Opioids', Database)
def anticoagulation(clicks, value): if clicks != None and clicks % 2 > 0: ordered_Files = Sort_info(Plot_points(upLoaded_Details, value), 'Bar_Graph') enzymes_Name = Usable_files(False, ordered_Files) return drugs_Affected(enzymes_Name, 'Proton_pump_inhibitor', Database)