Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* ENCODE_Histone_Modifications_2015
* Disease_Perturbations_from_GEO_up
* Disease_Perturbations_from_GEO_down
* GO_Molecular_Function_2015
* GO_Biological_Process_2015
* GO_Cellular_Component_2015
* Reactome_2016
* KEGG_2016
* MGI_Mammalian_Phenotype_Level_4
* LINCS_L1000_Chem_Pert_up
* LINCS_L1000_Chem_Pert_down
'''
df = self.export_df()
df, bar_info = enr_fun.add_enrichr_cats(df, axis, lib)
self.load_df(df)
self.dat['enrichrgram_lib'] = lib
self.dat['row_cat_bars'] = bar_info
def make_clust(net, dist_type='cosine', run_clustering=True, dendro=True,
requested_views=['pct_row_sum', 'N_row_sum'],
linkage_type='average', sim_mat=False, filter_sim=0.0,
calc_cat_pval=False, sim_mat_views=['N_row_sum'],
run_enrichr=None, enrichrgram=None):
'''
This will perform hierarchical clustering
'''
# threshold = 0.0001
# df = run_filter.df_filter_row_sum(df, threshold)
# df = run_filter.df_filter_col_sum(df, threshold)
if run_enrichr is not None:
df = net.dat_to_df()
df = enr_fun.add_enrichr_cats(df, 'row', run_enrichr)
define_cat_colors = True
net.df_to_dat(df, define_cat_colors=True)
inst_dm = calc_clust.cluster_row_and_col(net, dist_type=dist_type,
linkage_type=linkage_type,
run_clustering=run_clustering,
dendro=dendro, ignore_cat=False,
calc_cat_pval=calc_cat_pval)
which_sim = []
if sim_mat == True:
which_sim = ['row', 'col']
elif sim_mat == 'row':
which_sim = ['row']
elif sim_mat == 'col':