Commit 0e8ab97f authored by Carine Rey's avatar Carine Rey
Browse files

add an option to run test hyp

parent 10badf91
......@@ -81,7 +81,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 ~use_concat ~ns ~no_Ne ~no_HaPC =
let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test =
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
......@@ -108,9 +108,15 @@ let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne
HaPC_NeSmall ;
H0_NeBig ;
HaPC_NeBig ;
]
);
(if ne_test then
[H0_NeVerySmall;
H0_BigNeInSmallNe;
H0_SmallNeInBigNe;
]
else
[]
)
] |> List.concat
] |> List.concat
......@@ -124,10 +130,10 @@ let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne
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 ~use_concat ~ns ~no_Ne ~no_HaPC =
let derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test =
let profile_f = input profile_fn in
List.map trees ~f:(fun tree ->
derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne ~no_HaPC)
derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test)
|> List.concat
......@@ -260,21 +266,21 @@ let detection_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~fast_mode () =
let simulation_main ~outdir ?(ns = 0) ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview ~use_concat ~no_Ne ~no_HaPC () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test:false in
let repo = Dataset.repo dataset_l ~preview in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let validation_main ~outdir ?(indir = "") ?(ns = 0) ?(np = 2) ?(mem = 2) ~preview ~fast_mode ~no_Ne ~no_HaPC ~tree_dir ~profile_fn ~use_concat ~only_simu () =
let validation_main ~outdir ?(indir = "") ?(ns = 0) ?(np = 2) ?(mem = 2) ~preview ~fast_mode ~no_Ne ~ne_test ~no_HaPC ~tree_dir ~profile_fn ~use_concat ~only_simu () =
(* simulated trees *)
let trees = Array.to_list @@ Sys.readdir tree_dir in
let simu_dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC in
let simu_dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test in
let post_analyses_simu = Post_analyses.post_analyses_simu_of_simu_dataset_l ~simu_dataset_l in
let repo_of_post_analyses_simu = Post_analyses.repo_of_post_analyses_simu ~post_analyses_simu in
let repo_and_post_analyses_per_tree_simu = List.map trees ~f:(fun tree -> (*to keep together all models per tree*)
let trees = [tree] in
let tree_prefix = Filename.chop_extension tree in
let dataset_l =
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC in
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test in
let dataset_results_l =
if only_simu then
[]
......@@ -375,6 +381,8 @@ let validation_command =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and fast_mode =
flag "--fast" no_arg ~doc:" 'Fast' mode without the most costly methods"
and ne_test =
flag "--ne-test" no_arg ~doc:" mode with hypothesis in test including different Ne"
and no_Ne =
flag "--no-ne" no_arg ~doc:" mode without hypothesis including different Ne"
and no_HaPC =
......@@ -394,5 +402,5 @@ let validation_command =
and profile_fn =
flag "--profile-fn" (required string) ~doc:"PATH Path to profile file"
in
validation_main ~outdir ?indir ?ns ?np ?mem ~preview ~fast_mode ~no_Ne ~no_HaPC ~tree_dir ~profile_fn ~use_concat ~only_simu
validation_main ~outdir ?indir ?ns ?np ?mem ~preview ~fast_mode ~no_Ne ~ne_test ~no_HaPC ~tree_dir ~profile_fn ~use_concat ~only_simu
]
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