Skip to content
Snippets Groups Projects
Commit b0c61843 authored by Le, Mia's avatar Le, Mia
Browse files

edited cami_suite

parent 37715e1e
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,15 @@ import itertools
def generate_param_combinations(params_dict):
"""
Generates all possible combinations of parameters for the given function(s) and returns them as a list.
Args:
params_dict (dict): A dictionary containing the parameters and their possible values for each function.
Returns:
list: A list of lists where each inner list contains the function name, parameter string, and a dictionary with the parameter values and corresponding function.
"""
params_keys = list(params_dict.keys())
params_values = [params_dict[k] for k in params_keys if k != 'function']
function_dict = params_dict['function']
......@@ -110,6 +119,7 @@ class cami():
self.seed_lst = seed_lst
self.origin_seed_lst = seed_lst.copy()
self.tool_wrappers = tool_wrappers
self.prediction_tools = [wrapper.name for wrapper in tool_wrappers]
self.toolweights = toolweights
self.home_path = home_path
if uid==None:
......@@ -347,18 +357,24 @@ class cami():
'first_neighbours': cami_v1.make_first_neighbor_result_set}
}
params_tr = {'hub_penalty': [0, 0.25, 0.5, 0.75, 1.0],
'damping_factor': [0.1, 0.25, 0.5, 0.75],
'confidence_level': [0.2, 0.35, 0.5, 0.75],
params_tr = {'hub_penalty': [0.5],
'damping_factor': [0.5],
'confidence_level': [0.5],
'ranking': ['trustrank'],
'function': {'cami_v2': cami_v2.run_cami,
'cami_v3':cami_v3.run_cami}}
params_b_m = {'hub_penalty': [0, 0.25, 0.5, 0.75, 1.0],
'confidence_level': [0.2, 0.35, 0.5, 0.75],
params_b_m = {'hub_penalty': [0.5],
'confidence_level': [0.5],
'ranking': ['betweenness', 'harmonic'],
'function': {'cami_v2': cami_v2.run_cami,
'cami_v3':cami_v3.run_cami}}
'cami_v3':cami_v3.run_cami}}
# params_b_m = {'hub_penalty': [0, 0.25, 0.5, 0.75, 1.0],
# 'confidence_level': [0.2, 0.35, 0.5, 0.75],
# 'ranking': ['betweenness', 'harmonic'],
# 'function': {'cami_v2': cami_v2.run_cami,
# 'cami_v3':cami_v3.run_cami}}
c = generate_param_combinations(params_0)
cami_setting_list = generate_param_combinations(params_0)+\
......@@ -369,7 +385,7 @@ class cami():
camis = {}
for setting in cami_setting_list:
if setting[1]:
func_name = setting[0] + '_' +setting[1]
func_name = setting[0] + '_' +setting[1].rsplit('_', 1)[-1]
else:
func_name = setting[0]
......@@ -553,7 +569,7 @@ class cami():
else:
print('Cannot use degradome to create venn diagrams of 6 or more tools')
return None
def download_diagram(self, url):
venn_name = f'{self.output_dir}/vdiagram_{self.uid}'
response = degradome.download_image(url, venn_name + '.png')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment