def update_columns(jsonified_consensus_details_table): if not jsonified_consensus_details_table: return [{}] consensus_details_table_data = tools.unjsonify_df( jsonified_consensus_details_table) return [{ "name": i, "id": i } for i in list(consensus_details_table_data.columns)]
def to_consensus_node_details_distribution(tree_click_data, jsonified_full_consensustable): if not jsonified_full_consensustable or not tree_click_data: return "" clicked_node = tree_click_data['points'][0] node_id = clicked_node['pointIndex'] full_consensustable = tools.unjsonify_df(jsonified_full_consensustable) distribution_figure = consensustable.get_node_distribution_fig( node_id, full_consensustable) return distribution_figure
def color_consensuses_table_cells(jsonified_partial_consensustable, jsonified_consensus_tree): if not jsonified_partial_consensustable or not jsonified_consensus_tree: return [] partial_consensustable_data = tools.unjsonify_df( jsonified_partial_consensustable) consensustree_data = tools.unjsonify_builtin_types( jsonified_consensus_tree) tree = consensustree.dict_to_tree(consensustree_data) return consensustable.get_cells_styling(tree, partial_consensustable_data)
def update_partial_table_data(jsonified_full_consensustable: str, jsonified_tree: str, slider_value: float): if not jsonified_full_consensustable or not jsonified_tree: return [] full_consensustable_data = tools.unjsonify_df( jsonified_full_consensustable) full_consensustree_data = tools.unjsonify_builtin_types(jsonified_tree) full_consensustree_tree = consensustree.dict_to_tree( full_consensustree_data) table_without_consensuses_smaller_than_slider = consensustable.remove_smaller_than_slider( full_consensustable_data, full_consensustree_tree, slider_value) return tools.jsonify_df(table_without_consensuses_smaller_than_slider)
def to_consensus_node_details_table(tree_click_data, jsonified_full_consensustable, jsonified_consensustree): if not jsonified_full_consensustable or not tree_click_data: return [] clicked_node = tree_click_data['points'][0] node_id = clicked_node['pointIndex'] full_consensustable = tools.unjsonify_df(jsonified_full_consensustable) consensustree_data = tools.unjsonify_builtin_types(jsonified_consensustree) tree = consensustree.dict_to_tree(consensustree_data) node_details_df = consensustable.get_consensus_details_df( node_id, full_consensustable, tree) return tools.jsonify_df(node_details_df)
def to_consensustree_graph(jsonified_current_consensustree, slider_value, leaf_info, jsonified_full_consensustable): if not jsonified_current_consensustree or not jsonified_full_consensustable: return {} current_consensustree_data = tools.unjsonify_builtin_types( jsonified_current_consensustree) current_consensustree_tree = consensustree.dict_to_tree( current_consensustree_data) full_consensustable_data = tools.unjsonify_df( jsonified_full_consensustable) return consensustree.get_consensustree_graph(current_consensustree_tree, slider_value, leaf_info, full_consensustable_data)
def to_consensusnode_details_content(jsonified_consensus_details_table): if not jsonified_consensus_details_table: return [] consensus_details_table_data = tools.unjsonify_df( jsonified_consensus_details_table) return consensus_details_table_data.to_dict("rows")
def to_consensustree_leaf_info_options_dropdown(jsonified_full_consensustable): if not jsonified_full_consensustable: return [] full_consensustable = tools.unjsonify_df(jsonified_full_consensustable) metadata = consensustable.get_metadata_list(full_consensustable) return consensustree.get_leaf_info_dropdown_options(metadata)
def update_columns(jsonified_partial_consensustable): if not jsonified_partial_consensustable: return [{}] partial_consensustable_data = tools.unjsonify_df( jsonified_partial_consensustable) return [{"name": i, "id": i} for i in partial_consensustable_data.columns]
def to_consensustable_content(jsonified_partial_consensustable): if not jsonified_partial_consensustable: return [] partial_consensustable_data = tools.unjsonify_df( jsonified_partial_consensustable) return partial_consensustable_data.to_dict("rows")