Commit 5b7f9605 authored by Carine Rey's avatar Carine Rey
Browse files

add --no-ne option to save time

parent e270a427
......@@ -73,27 +73,32 @@ 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 =
let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne =
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
let models = if preview then
Convergence_hypothesis.[
let models = Convergence_hypothesis.[
[
H0 ;
HaPCOC ;
]
];
if preview then
[]
else
Convergence_hypothesis.[
H0 ;
HaPC ;
HaPCOC ;
if no_Ne then
[HaPC ;
]
else
[HaPC ;
H0_NeSmall ;
HaPCOC_NeSmall ;
HaPC_NeSmall ;
H0_NeBig ;
HaPCOC_NeBig ;
HaPC_NeBig ;
] in
]
] |> List.concat
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
......@@ -103,10 +108,10 @@ let derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns =
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 =
let derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne =
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)
derive_from_tree ~tree_dir ~tree ~profile_f ~preview ~use_concat ~ns ~no_Ne)
|> List.concat
......@@ -240,20 +245,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 () =
let simulation_main ~outdir ?(ns = 0) ?(np = 2) ?(mem = 2) ~tree_dir ~profile_fn ~preview ~use_concat ~no_Ne () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns in
let dataset_l = derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne 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 ~tree_dir ~profile_fn ~use_concat () =
let validation_main ~outdir ?(indir = "") ?(ns = 0) ?(np = 2) ?(mem = 2) ~preview ~fast_mode ~no_Ne ~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
derive_sim ~tree_dir ~trees ~profile_fn ~preview ~use_concat ~ns ~no_Ne
@ 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
......@@ -278,6 +283,8 @@ let simulation_command =
flag "--outdir" (required string) ~doc:"PATH Output directory"
and preview =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and no_Ne =
flag "--no-ne" no_arg ~doc:" mode without hypothesis including different Ne"
and ns =
flag "--ns" (optional int) ~doc:"INT Number of sites to simulate"
and np =
......@@ -291,7 +298,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 ~tree_dir ~profile_fn ~preview ~use_concat
simulation_main ~outdir ?ns ?np ?mem ~no_Ne ~tree_dir ~profile_fn ~preview ~use_concat
]
let detection_command =
......@@ -328,6 +335,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 no_Ne =
flag "--no-ne" no_arg ~doc:" mode without hypothesis including different Ne"
and use_concat =
flag "--use-concat" no_arg ~doc:" Use concatenation H0+Ha_pcoc"
and ns =
......@@ -341,5 +350,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 ~tree_dir ~profile_fn ~use_concat
validation_main ~outdir ?indir ?ns ?np ?mem ~preview ~fast_mode ~no_Ne ~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