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

Realism filter now uses convergent gc content instead of global

parent 9589905d
......@@ -277,13 +277,13 @@ let benchmark2 d =
(* param exploration for SMBE paper *)
(* type branch_factor_t = float *)
let branch_factor_range = [ 1.; 2.; 3.; 4.; 5. ]
let branch_factor_range = [ 1.; 3.; 6.; 9. ]
type gBGC_t = Global of float | Convergent of float * float
let gBGC_range =
let range = [ 0.; 2.; 4.; 8.; 16.; 32. ] in
let range = [ 0.; 2.; 4.; 8.; 16.; 32.; 64.; ] in
List.concat [
List.map ~f:(fun x -> Global x) range ;
(* List.map ~f:(fun x -> Global x) range ; *)
List.map ~f:(fun x -> Convergent (0., x)) range ;
]
......@@ -312,19 +312,21 @@ let filter_results ~(f: _ -> bool) (results: (param_t * _) list) =
List.filter results ~f:(fun (_, x) -> f x)
type record_t = {
gc_means: ([`first | `second | `third] * float) list
gc_means_ancestral: ([`first | `second | `third] * float) list ;
gc_means_convergent: ([`first | `second | `third] * float) list
}
let record_of_param ?n_h0:(n_h0=50) s =
let simu = simu_of_param ~n_h0 s in
let gc_mean_from_simu ~pos s =
(s |> nucleotide_alignment |> Debug.path |> Alistats.nucleotide_fasta_gc ~pos).gc_mean in
{
gc_means = [
(`first, (gc_mean_from_simu simu ~pos:`first)) ;
(`second, gc_mean_from_simu simu ~pos:`second) ;
(`third, gc_mean_from_simu simu ~pos:`third)
]
Alistats.nucleotide_fasta_gc_ac ~pos (s |> tree |> Debug.path) (s |> nucleotide_alignment |> Debug.path)
in let (m1_a, m1_c), (m2_a, m2_c), (m3_a, m3_c) =
gc_mean_from_simu simu ~pos:`first,
gc_mean_from_simu simu ~pos:`second,
gc_mean_from_simu simu ~pos:`third
in {
gc_means_ancestral = [(`first, m1_a.gc_mean) ; (`second, m2_a.gc_mean) ; (`third, m3_a.gc_mean)] ;
gc_means_convergent = [(`first, m1_c.gc_mean) ; (`second, m2_c.gc_mean) ; (`third, m3_c.gc_mean)]
}
let expected_gc = [
......@@ -346,14 +348,14 @@ let quartile (min_, fq_, mean_, tq_, max_) x =
let adjacent q1 q2 =
match q1, q2 with
| `first, `first | `second, `second
| `thrid, `thrid | `fourth, `fourth
| `third, `third | `fourth, `fourth
| `first, `second | `second, `first
| `second, `third | `third, `second
| `third, `fourth | `fourth, `third -> true
| _ -> false
let quartile_of_record (r: record_t) =
List.map r.gc_means ~f:(fun (q, x) ->
List.map r.gc_means_convergent ~f:(fun (q, x) ->
let q_list = List.Assoc.find_exn expected_gc ~equal:(fun x y -> Caml.(x = y)) q in
quartile q_list x
)
......
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