Commit 3aea5571 authored by Carine Rey's avatar Carine Rey
Browse files

add --no-hapc

parent c2d3c0cf
......@@ -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 ~use_concat ~ns ~no_Ne =
let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne ~no_HaPC =
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
......@@ -82,23 +82,32 @@ let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne
H0 ;
HaPCOC ;
];
if preview then
[]
else
if no_Ne then
[HaPC ;
]
if preview then
[]
else
[HaPC ;
H0_NeSmall ;
HaPCOC_NeSmall ;
HaPC_NeSmall ;
H0_NeBig ;
HaPCOC_NeBig ;
HaPC_NeBig ;
]
[(
if no_HaPC then
[]
else
[HaPC ;
]
)
;
(if no_Ne then
[]
else
[HaPC ;
H0_NeSmall ;
HaPCOC_NeSmall ;
HaPC_NeSmall ;
H0_NeBig ;
HaPCOC_NeBig ;
HaPC_NeBig ;
]
)
] |> List.concat
] |> List.concat
in
in
let dataset_per_hypo = List.map models ~f:(fun model ->
derive_from_model ~model ~input_tree ~tree_dataset ~tree_prefix ~profile_f ~preview ~ns
) in
......@@ -108,10 +117,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 =
let derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC =
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)
derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne ~no_HaPC)
|> List.concat
......@@ -245,20 +254,20 @@ let detection_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~fast_mode () =
let repo = repo_of_dataset_results_l ~dataset_results_l in
Repo.build ~outdir ~np ~mem:(`GB mem) ~logger repo
let simulation_main ~outdir ?(ns = 0) ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview ~use_concat ~no_Ne () =
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 in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC 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 ~tree_dir ~profile_fn ~use_concat () =
let validation_main ~outdir ?(indir = "") ?(ns = 0) ?(np = 2) ?(mem = 2) ~preview ~fast_mode ~no_Ne ~no_HaPC ~tree_dir ~profile_fn ~use_concat () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let repo = List.map trees ~f:(fun tree ->
let trees = [tree] in
let tree_prefix = Filename.chop_extension tree in
let indir_dataset_l = if indir = "" then [] else parse_input_data indir in
let dataset_l =
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne ~no_HaPC
@ indir_dataset_l in
let dataset_results_l = derive_det ~dataset_l ~preview ~fast_mode in
let post_analyses = Post_analyses.post_analyses_of_dataset_results_l ~dataset_results_l in
......@@ -285,6 +294,8 @@ let simulation_command =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and no_Ne =
flag "--no-ne" no_arg ~doc:" mode without hypothesis including different Ne"
and no_HaPC =
flag "--no-hapc" no_arg ~doc:" mode without ~HaPC hypothesis"
and ns =
flag "--ns" (optional int) ~doc:"INT Number of sites to simulate"
and np =
......@@ -298,7 +309,7 @@ let simulation_command =
and profile_fn =
flag "--profile-fn" (required string) ~doc:"PATH Path to profile file"
in
simulation_main ~outdir ?ns ?np ?mem ~no_Ne ~tree_dir ~profile_fn ~preview ~use_concat
simulation_main ~outdir ?ns ?np ?mem ~no_Ne ~no_HaPC ~tree_dir ~profile_fn ~preview ~use_concat
]
let detection_command =
......@@ -337,6 +348,8 @@ let validation_command =
flag "--fast" no_arg ~doc:" 'Fast' mode without the most costly methods"
and no_Ne =
flag "--no-ne" no_arg ~doc:" mode without hypothesis including different Ne"
and no_HaPC =
flag "--no-hapc" no_arg ~doc:" mode without ~HaPC hypothesis"
and use_concat =
flag "--use-concat" no_arg ~doc:" Use concatenation H0+Ha_pcoc"
and ns =
......@@ -350,5 +363,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 ~tree_dir ~profile_fn ~use_concat
validation_main ~outdir ?indir ?ns ?np ?mem ~preview ~fast_mode ~no_Ne ~no_HaPC ~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