Skip to content

Commit

Permalink
fix run method
Browse files Browse the repository at this point in the history
  • Loading branch information
hag007 committed May 31, 2021
1 parent 3ff0def commit 6fbedc3
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
*.pyc
/src/sh/*.sh
*.swp
/emp-env

2 changes: 1 addition & 1 deletion config/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"hg_th" : "0.05",
"permuted_datasets_folder" : "../../data/emp_test/permuted_datasets",
"permuted_solutions_folder" : "../../data/emp_test/permuted_solutions",
"true_solutions_folder" : "../../emp_test/true_solutions",
"true_solutions_folder" : "../../data/emp_test/true_solutions",
"report_folder" : "../../data/emp_test/report",
"n_start" : "0",
"n_end" : "1010",
Expand Down
Binary file not shown.
205 changes: 205 additions & 0 deletions data/emp_test/networks/dip_louvain_slices.txt

Large diffs are not rendered by default.

Binary file not shown.
Binary file added data/emp_test/networks/dip_original.sif.pkl
Binary file not shown.
2 changes: 2 additions & 0 deletions src/emp/generate_permuted_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def main():
params=[ [empirical_dist_iteration, [dataset_file, x, algo, network_file, go_folder, permuted_datasets_folder, permuted_solutions_folder, additional_args]] for x in np.arange(int(n_start), int(n_end)) if override_permutations or not permutation_solution_exists(dataset_name, algo, x, permuted_solutions_folder)]
print("about to start generation of {} permuted solutions".format(len(params)))
p.map(func_star, params)
# for a in params:
# a[0](*a[1])
break_loop=True

except (Exception, MemoryError, OSError) as e:
Expand Down
1 change: 1 addition & 0 deletions src/runners/abstract_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ def main(self, dataset_file_name, network_file_name, go_folder, output_folder, *
print(f'about to run algo with the following parameters: {os.path.abspath(dataset_file_name)}, {os.path.abspath(network_file_name)}, {os.path.abspath(output_folder)}, {kwargs}')

modules, all_bg_genes = self.run(os.path.abspath(dataset_file_name), os.path.abspath(network_file_name), os.path.abspath(output_folder), **kwargs)
self.build_all_reports(self.ALGO_NAME, modules, all_bg_genes, os.path.abspath(go_folder), os.path.abspath(os.path.join(output_folder, "report")))
9 changes: 4 additions & 5 deletions src/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,12 @@ def build_all_reports(algo_name, modules, all_bg_genes, go_folder, output_folder
modules_summary = manager.list()

params=[]
# p=multiprocessing.Pool(3)
p=multiprocessing.Pool(3)
for i, module in enumerate(modules):
# params.append([module_report, [algo_name, i, module, all_bg_genes[i], score_file_name, network_file_name, dataset_name, all_hg_reports,
# modules_summary]])
module_report(algo_name, i, module, all_bg_genes[i], go_folder, output_folder, modules_summary)
params.append([module_report, [algo_name, i, module, all_bg_genes[i], go_folder, output_folder, modules_summary]])
# module_report(algo_name, i, module, all_bg_genes[i], go_folder, output_folder, modules_summary)

# p.map(func_star, params)
p.map(func_star, params)

modules_summary=list(modules_summary)
all_hg_reports=list(all_hg_reports)
Expand Down

0 comments on commit 6fbedc3

Please sign in to comment.