Commit 907d47ca authored by LANORE Vincent's avatar LANORE Vincent
Browse files

More refactoring.

parent 4a026c95
......@@ -18,7 +18,7 @@ let string_of_float_without_dot f = (* to avoid things like "H0_NeG4._NeC2." *)
if rounded -. f = 0. then string_of_int int_value else string_of_float f
let string_of_nes nes = match nes with
| Fixed g -> "NeG" ^ (string_of_float_without_dot g)
| Variable (g, c) -> "NeG" ^ (string_of_float_without_dot g) ^ "_NeC" ^ (string_of_float_without_dot c)
| Variable (g, c) -> "NeG" ^ (string_of_float_without_dot g) ^ "_NeC_" ^ (string_of_float_without_dot c)
let string_of_model m = match m with
| H0 nes -> "H0_" ^ (string_of_nes nes)
| HaPC nes -> "HaPC_" ^ (string_of_nes nes)
......@@ -32,6 +32,9 @@ let nec_of_model m = match m with
| H0 nes | HaPC nes | HaPCOC nes -> match nes with
| Fixed c | Variable (_, c) -> c
let h0_hapc_forall nes_list =
List.map nes_list (fun nes -> [H0 nes; HaPC nes]) |> List.concat
let assign k v =
seq ~sep:"=" [ string k ; v ]
......
......@@ -88,35 +88,13 @@ let derive_from_tree ~tree_dir ~tree ~profile ~preview ~use_concat ~ns ~no_Ne ~n
let indel_H0_NeG5 = Dataset.add_indels_to_dataset dataset_H0_NeG5 ~seed:(Random.int Int.max_value) in
let indel_HaPC_NeG5 = Dataset.add_indels_to_dataset dataset_HaPC_NeG5 ~seed:(Random.int Int.max_value) in
(* let dataset_basis_hyps = [dataset_H0_NeG5; dataset_HaPCOC; dataset_HaPC_NeG5] in *)
let models = Convergence_hypothesis.[
[ H0 (Fixed 4.) ;
HaPC (Fixed 4.);
];
if preview then
[]
else
[
H0 (Fixed 1.);
H0 (Fixed 2.);
H0 (Fixed 6.);
HaPC (Fixed 1.);
HaPC (Fixed 2.);
HaPC (Fixed 6.);
H0 (Variable (1., 4.)) ;
H0 (Variable (2., 4.)) ;
H0 (Variable (4., 1.)) ;
H0 (Variable (4., 2.)) ;
H0 (Variable (4., 6.)) ;
H0 (Variable (4., 8.)) ;
HaPC (Variable (1., 4.)) ;
HaPC (Variable (2., 4.)) ;
HaPC (Variable (4., 1.)) ;
HaPC (Variable (4., 2.)) ;
HaPC (Variable (4., 6.)) ;
HaPC (Variable (4., 8.)) ;
]
] |> List.concat
let nes_list =
[Fixed 4.] @ if preview then [] else
[Fixed 1.; Fixed 2.; Fixed 6.;
Variable (1., 4.); Variable (2., 4.); Variable (4., 1.); Variable (4., 2.); Variable (4., 6.); Variable (4., 8.)]
in
let models = h0_hapc_forall nes_list in
let dataset_per_hypo = List.map models ~f:(fun model ->
derive_from_model ~model ~input_tree ~tree_dataset ~tree_prefix ~profile ~preview ~ns ~seed
) in
......
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