aprile.pure_query module
- class aprile.pure_query.PureAprileQuery(drug1, drug2, side_effect, gdata, regularization=2)
Bases:
object
- get_GOEnrich_table()
- get_pred_table()
- get_query()
- get_subgraph(if_show=True, save_path=None)
- static load_from_pkl(file)
- set_enrich_result(goea_results_sig)
- set_exp_result(pp_index, pp_weight, pd_index, pd_weight)
- set_pred_result(probability, piu_score, ppiu_score)
- to_pickle(file)
- aprile.pure_query.visualize_graph(pp_idx, pp_weight, pd_idx, pd_weight, pp_adj, d1, d2, out_path, protein_name_dict=None, drug_name_dict=None, hiden=True, size=(40, 40))
- Parameters
pp_idx – integer tensor of the shape (2, n_pp_edges)
pp_weight – float tensor of the shape (1, n_pp_edges), values within (0,1)
pd_idx – integer tensor of the shape (2, n_pd_edges)
pd_weight – float tensor of the shape (1, n_pd_edges), values within (0,1)
protein_name_dict – store elements {protein_index -> protein name}
drug_name_dict – store elements {drug_index -> drug name}
use different color for pp and pd edges
annotate the weight of each edge near the edge (or annotate with the tranparentness of edges for each edge)
annotate the name of each node near the node, if name_dict=None, then annotate with node’s index