Commit 64f23079 authored by Carine Rey's avatar Carine Rey
Browse files

add option to useor not the H0+Ha_pcoc concatenation

parent b8338913
......@@ -73,7 +73,7 @@ let derive_from_model ~model ~input_tree ~tree_dataset ~tree_prefix ~profile_f ~
let ready_dataset = { Ready_dataset.input_tree = input_tree ; tree_dataset ; fna; faa; fna_infos} in
{ Dataset.model_prefix; is_real= false; tree_prefix; dataset = ready_dataset }
let derive_from_tree ~tree_dir ~tree ~profile_f ~preview =
let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat =
let tree_prefix = Filename.chop_extension tree in
let input_tree = input (Filename.concat tree_dir tree) in
let tree_dataset = Tree_dataset.prepare input_tree in
......@@ -100,13 +100,13 @@ let derive_from_tree ~tree_dir ~tree ~profile_f ~preview =
let ready_dataset_H0 = (derive_from_model ~model:H0 ~input_tree ~tree_dataset ~tree_prefix ~profile_f ~preview).dataset in
let ready_dataset_HaPCOC = (derive_from_model ~model:HaPCOC ~input_tree ~tree_dataset ~tree_prefix ~profile_f ~preview).dataset in
let concat_H0Ha = {Dataset.model_prefix="H0+HaPCOC"; tree_prefix; is_real = false; dataset = Ready_dataset.paste ready_dataset_H0 ready_dataset_HaPCOC} in
let dataset_concat_hypos = [concat_H0Ha;] in
let dataset_concat_hypos = if use_concat then [concat_H0Ha;] else [] in
List.concat [ dataset_per_hypo ; dataset_concat_hypos ]
let derive_sim ~tree_dir ~trees ~profile_fn ~preview =
let derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat =
let profile_f = input profile_fn in
List.map trees ~f:(fun tree ->
derive_from_tree ~tree_dir ~tree ~profile_f ~preview)
derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat)
|> List.concat
......@@ -236,16 +236,16 @@ let detection_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~no_diffsel () =
let repo = repo_of_dataset_results_l ~dataset_results_l in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let simulation_main ~outdir ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview () =
let simulation_main ~outdir ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview ~use_concat () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat in
let repo = Dataset.repo dataset_l ~preview in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let validation_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~no_diffsel ~tree_dir ~profile_fn () =
let validation_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~no_diffsel ~tree_dir ~profile_fn ~use_concat () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l =
derive_sim ~tree_dir ~trees ~profile_fn ~preview
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat
@ parse_input_data indir in
let dataset_results_l = derive_det ~dataset_l ~preview ~no_diffsel in
let repo = [
......@@ -268,12 +268,14 @@ let simulation_command =
flag "--np" (optional int) ~doc:"INT Number of available processors"
and mem =
flag "--mem" (optional int) ~doc:"INT Available memory (in GB)"
and use_concat =
flag "--use-concat" no_arg ~doc:" Use concatenation H0+Ha_pcoc"
and tree_dir =
flag "--tree-dir" (required string) ~doc:"PATH Path to tree directory"
and profile_fn =
flag "--profile-fn" (required string) ~doc:"PATH Path to profile file"
in
simulation_main ~outdir ?np ?mem ~tree_dir ~profile_fn ~preview
simulation_main ~outdir ?np ?mem ~tree_dir ~profile_fn ~preview ~use_concat
]
let detection_command =
......@@ -310,6 +312,8 @@ let validation_command =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and no_diffsel =
flag "--no-diffsel" no_arg ~doc:" No diffsel mode"
and use_concat =
flag "--use-concat" no_arg ~doc:" Use concatenation H0+Ha_pcoc"
and np =
flag "--np" (optional int) ~doc:"INT Number of available processors"
and mem =
......@@ -319,5 +323,5 @@ let validation_command =
and profile_fn =
flag "--profile-fn" (required string) ~doc:"PATH Path to profile file"
in
validation_main ~outdir ~indir ?np ?mem ~preview ~no_diffsel ~tree_dir ~profile_fn
validation_main ~outdir ~indir ?np ?mem ~preview ~no_diffsel ~tree_dir ~profile_fn ~use_concat
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment