Commit bb8a7d46 authored by LANORE Vincent's avatar LANORE Vincent
Browse files

Added filtering functions + random refactoring of exploration things

parent 9c63ef86
......@@ -273,9 +273,9 @@ let benchmark2 d =
pcoc d ;
tdg09 d ;
]
(* param exploration for SMBE paper *)
type branch_factor_t = float
(* type branch_factor_t = float *)
let branch_factor_range = [ 1.; 2.; 3.; 4.; 5. ]
type gBGC_t = Global of float | Convergent of float * float
......@@ -286,11 +286,11 @@ let gBGC_range =
List.map ~f:(fun x -> Convergent (0., x)) range ;
]
type param_t = branch_factor_t * gBGC_t
type param_t = float * gBGC_t
let explore_params ~(f: param_t -> _) =
List.map branch_factor_range ~f:(fun (bf:branch_factor_t) ->
List.map gBGC_range ~f:(fun (gbgc:gBGC_t) -> (bf, gbgc, f (bf, gbgc)))
List.map branch_factor_range ~f:(fun (bf:float) ->
List.map gBGC_range ~f:(fun (gbgc:gBGC_t) -> ((bf, gbgc), f (bf, gbgc)))
) |> List.concat
let simu_of_param ?n_h0:(n_h0=50) (p: param_t) =
......@@ -306,3 +306,18 @@ let simu_of_param ?n_h0:(n_h0=50) (p: param_t) =
~n_ha:0
~n_h0
()
let filter_results ~(f: _ -> bool) (results: (param_t * _) list) =
List.filter results ~f:(fun (_, x) -> f x)
type record_t = {
gc_stat: Alistats.gc_stat
}
let record_of_param ?n_h0:(n_h0=50) s =
let simu = simu_of_param ~n_h0 s in
{ gc_stat = simu |> nucleotide_alignment |> Debug.path |> Alistats.nucleotide_fasta_gc }
let realistic_result (g: record_t) =
let v = g.gc_stat.gc_variance_among_sequences in
Float.(v >= 8.388e-05 && v <= 5.262e-02)
\ No newline at end of file
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