Commit 9a03de8b authored by Philippe Veber's avatar Philippe Veber
Browse files

Simulation_dataset.benchmark_stats: fixed bug

parent 94013a1b
......@@ -15,7 +15,7 @@ let besnard2009 = {
label = "besnard2009" ;
tree = Bistro.Workflow.input "data/besnard2009/besnard2009.nhx" ;
rooted = true ;
branch_scale = 10. ;
branch_scale = 1. ;
ne_s = 4., 4. ;
}
......@@ -23,7 +23,7 @@ let oneline_rodent = {
label = "online_rodent" ;
tree = Bistro.Workflow.input "data/online_rodent/online_rodent.nhx" ;
rooted = true ;
branch_scale = 10. ;
branch_scale = 1. ;
ne_s = 4., 4. ;
}
......@@ -31,7 +31,7 @@ let rubisco = {
label = "rubisco" ;
tree = Rubisco_dataset.(Path "data/rubisco" |> Query.tree ~branch_length_unit:`Amino_acid) ;
rooted = false ;
branch_scale = 10. ;
branch_scale = 1. ;
ne_s = 4., 4. ;
}
......@@ -44,7 +44,7 @@ let orthomam_echolocation = {
(Codepitk.Orthomam_db.make "omm")
) ;
rooted = false ;
branch_scale = 10. ;
branch_scale = 1. ;
ne_s = 4., 4. ;
}
......
......@@ -212,6 +212,7 @@ let%pworkflow benchmark_statistics simulation ~labels ~results =
let open Codepitk in
let open OCamlR_base in
let open Codepitk.Simulator.Site_independent_mutsel in
let module Codon = Codon.Universal_genetic_code.NS in
let load_results fn col =
let open Codepitk in
let df = Dataframe.from_file fn |> Rresult.R.failwith_error_msg in
......@@ -233,7 +234,6 @@ let%pworkflow benchmark_statistics simulation ~labels ~results =
l, `Numeric (Numeric.of_array_opt r)
) in
let amino_acid_vector_of_codon_vector xs =
let module Codon = Codon.Universal_genetic_code.NS in
Amino_acid.Vector.init (fun aa ->
List.fold Codon.all ~init:0. ~f:(fun acc c ->
if Amino_acid.equal aa (Codon.aa_of_codon c) then
......@@ -258,7 +258,13 @@ let%pworkflow benchmark_statistics simulation ~labels ~results =
let t =
Amino_acid.Table.init (fun aa ->
let aa = Amino_acid.to_char aa in
List.count seqs ~f:(fun s -> Char.equal (s : Dna.t :> string).[i] aa)
List.count seqs ~f:(fun s ->
let codon_str = String.sub (s : Dna.t :> string) ~pos:(i * 3) ~len:3 in
let codon = match Codon.of_string codon_str with
| Some c -> c
| None -> assert false
in
Char.equal (Amino_acid.to_char (Codon.aa_of_codon codon)) aa)
)
in
(t :> int array)
......
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