Commit ba9835df authored by Philippe Veber's avatar Philippe Veber
Browse files

removed app/diffseldsparse_benchmark

parent e4fd8e26
open Core
open Codepi
let main ~n_h0 ~n_ha ~seed:i () =
let open Simulation_dataset in
let sim =
bppseqgen_mixed
~tree:(NHX (Bistro.Workflow.input "example/trees_analyses/cyp_coding.Chrysithr_root.nhx"))
~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
~n_h0 ~n_ha ~ne_s:4. ~seed:i ()
in
let w = benchmark sim in
Bistro_engine.Scheduler.simple_eval_exn ~np:4 ~mem:(`GB 4) (Bistro.Workflow.path w)
|> print_endline
let command =
let open Command.Let_syntax in
Command.basic
~summary:"Run diffseldsparse bench"
[%map_open
let n_ha =
flag "--n-ha" (required int) ~doc:"INT Number of Ha sites"
and n_h0 =
flag "--n-h0" (required int) ~doc:"INT Number of H0 sites"
and seed =
flag "--seed" (required int) ~doc:"INT Global seed"
in
main ~n_ha ~n_h0 ~seed
]
let () = Command.run command
......@@ -6,14 +6,6 @@
(preprocess
(pps ppx_jane)))
(executable
(name diffseldsparse_benchmark)
(public_name diffseldsparse_benchmark)
(modules diffseldsparse_benchmark)
(libraries codepi)
(preprocess
(pps ppx_jane)))
(executable
(name orthomam_app)
(public_name orthomam_convergence)
......
......@@ -3,6 +3,8 @@ open Bistro
open Codepi
open Codepi.File_formats
module Pipeline = Simulation_pipeline.Mutsel
type dataset = {
label : string ;
tree : nhx file ;
......@@ -49,7 +51,7 @@ let orthomam_echolocation = {
}
type detection_method = {
result : Simulation_dataset.t -> text file ;
result : Pipeline.query -> text file ;
col : int ;
label : string ;
requires_rooted_tree : bool ;
......@@ -58,7 +60,7 @@ type detection_method = {
let meth ?(col = 1) ?(requires_rooted_tree = false) result label =
{ result ; col ; label ; requires_rooted_tree }
let methods = Simulation_dataset.[
let methods = Pipeline.[
meth tdg09 "tdg09" ;
meth pcoc ~col:3 "pcoc" ;
(* meth pcoc_v2 ~col:3 "pcoc v2" ; *)
......@@ -68,65 +70,28 @@ let methods = Simulation_dataset.[
meth topological "topological" ~requires_rooted_tree:true ;
]
let benchmark { tree = t ; rooted ; ne_s ; branch_scale ; _ } =
let open Simulation_dataset in
let sim =
convdet_simulation ~seed:42 ~tree:(NHX t) ~branch_scale ~ne_s
~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
~n_h0:900 ~n_ha:100 ()
in
let results, labels =
List.filter_map methods ~f:(fun m ->
if not m.requires_rooted_tree || rooted then
Some ((m.result sim, m.col), m.label)
else None
)
|> List.unzip
in
Utils.average_precision_plot ~oracle:(oracle sim) ~labels ~results
let benchmark_rds ?(seed = 42) { tree = t ; rooted ; ne_s ; branch_scale ; _ } =
let open Simulation_dataset in
let param =
Convdet_simulation_param.make ~seed ~tree:(NHX t) ~branch_scale ~ne_s
let q =
Pipeline.query ~seed ~tree:(NHX t) ~branch_scale ~ne_s
~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
~n_h0:900 ~n_ha:100 ()
in
let sim = convdet_simulation_of_param param in
let simulation = Convdet_simulation_param.simulation param in
let simulation = Pipeline.simulation q in
let results, labels =
List.filter_map methods ~f:(fun m ->
if not m.requires_rooted_tree || rooted then
Some ((m.result sim, m.col), m.label)
Some ((m.result q, m.col), m.label)
else None
)
|> List.unzip
in
benchmark_statistics simulation ~labels ~results
let report =
let module H = Bistro_utils.Html_report in
H.make ~title:"Codepi benchmark" [
H.section "Besnard 2009 dataset" ;
H.pdf (benchmark besnard2009) ;
H.section "Rubisco dataset" ;
H.pdf (benchmark rubisco) ;
H.section "Rodent dataset" ;
H.pdf (benchmark oneline_rodent) ;
H.section "Orthomam/echolocation dataset" ;
H.pdf (benchmark orthomam_echolocation) ;
]
|> H.render
Pipeline.benchmark_statistics simulation ~labels ~results
let () =
let open Bistro_utils.Repo in
let datasets = [ besnard2009 ; rubisco ; oneline_rodent ; orthomam_echolocation ] in
let repo =
item ["report.html"] report
:: List.map datasets ~f:(fun d ->
List.map datasets ~f:(fun d ->
item [d.label ^ ".rds"] (benchmark_rds d)
)
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