1414#pr = cProfile.Profile()
1515#pr.enable()
1616
17- def run_impute (conf_file = "../conf/minimal-configuration.json" , project_dir = "" ):
17+ def run_impute (conf_file = "../conf/minimal-configuration.json" , project_dir_graph = "" , project_dir_in_file = "" ):
1818
1919 configuration_file = conf_file
2020
2121 #project_dir = ""# "../"
22- output_dir = "output/"
22+ # output_dir = "output/"
2323
2424
2525 # Read configuration file and load properties
2626 with open (configuration_file ) as f :
2727 json_conf = json .load (f )
2828
29+ graph_files_path = json_conf .get ("graph_files_path" )
30+ if graph_files_path [- 1 ] != '/' :
31+ graph_files_path += '/'
32+ output_dir = json_conf .get ("imuptation_out_path" , "output" )
33+ if output_dir [- 1 ] != '/' :
34+ output_dir += '/'
2935 config = {
3036 "planb" : json_conf .get ('planb' , True ),
3137 "pops" : json_conf .get ('populations' ),
@@ -35,10 +41,10 @@ def run_impute(conf_file = "../conf/minimal-configuration.json", project_dir = "
3541 "number_of_pop_results" : json_conf .get ('number_of_pop_results' , 100 ),
3642 "output_MUUG" : json_conf .get ("output_MUUG" , True ),
3743 "output_haplotypes" : json_conf .get ("output_haplotypes" , False ),
38- "node_file" : project_dir + json_conf .get ("node_csv_file" ),
39- "top_links_file" : project_dir + json_conf .get ("top_links_csv_file" ),
40- "edges_file" : project_dir + json_conf .get ("edges_csv_file" ),
41- "imputation_input_file" : project_dir + json_conf .get ("imputation_in_file" ),
44+ "node_file" : project_dir_graph + graph_files_path + json_conf .get ("node_csv_file" ),
45+ "top_links_file" : project_dir_graph + graph_files_path + json_conf .get ("top_links_csv_file" ),
46+ "edges_file" : project_dir_graph + graph_files_path + json_conf .get ("edges_csv_file" ),
47+ "imputation_input_file" : project_dir_in_file + json_conf .get ("imputation_in_file" ),
4248 "imputation_out_umug_freq_file" : output_dir + json_conf .get ("imputation_out_umug_freq_filename" ),
4349 "imputation_out_umug_pops_file" : output_dir + json_conf .get ("imputation_out_umug_pops_filename" ),
4450 "imputation_out_hap_freq_file" : output_dir + json_conf .get ("imputation_out_hap_freq_filename" ),
@@ -55,11 +61,11 @@ def run_impute(conf_file = "../conf/minimal-configuration.json", project_dir = "
5561 [[1 ], [2 , 3 ], [4 ], [5 ]],
5662 [[1 ], [2 ], [3 ], [4 ], [5 ]]
5763 ]),
58- "pops_count_file" : project_dir + json_conf .get ("pops_count_file" ,'' ),
64+ "pops_count_file" : project_dir_graph + json_conf .get ("pops_count_file" ,'' ),
5965 "use_pops_count_file" : json_conf .get ("pops_count_file" ,False ),
6066 "number_of_options_threshold" : json_conf .get ("number_of_options_threshold" , 100000 ),
6167 "max_haplotypes_number_in_phase" : json_conf .get ("max_haplotypes_number_in_phase" ,100 ),
62- "bin_imputation_input_file" : project_dir + json_conf .get ("bin_imputation_in_file" , "None" ),
68+ "bin_imputation_input_file" : project_dir_in_file + json_conf .get ("bin_imputation_in_file" , "None" ),
6369 "nodes_for_plan_A" : json_conf .get ("Plan_A_Matrix" , []),
6470 "save_mode" : json_conf .get ("save_space_mode" , False )
6571
0 commit comments