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

RP curve: allow to choose column in result file

parent 702df100
......@@ -4,23 +4,24 @@ let benchmark d =
let open Simulation_dataset in
Utils.recall_precision_curve
~oracle:(oracle d)
~labels:[| "topological"; "multinomial";"gemma_score";"inhouse"; "tdg09" |]
~labels:[| "topological"; "multinomial";"gemma_score";"inhouse"; "pcoc"; (* "pcocv2" ; *)"tdg09" |]
~results:[
topological d ;
multinomial_asymptotic_lrt d ;
gemma ~lmm_test:`Score ~relatedness_mode:`Standardized d ;
inhouse_lmm d ;
tdg09 d ;
topological d, 1 ;
multinomial_asymptotic_lrt d, 1 ;
gemma ~lmm_test:`Score ~relatedness_mode:`Standardized d, 1 ;
inhouse_lmm d, 1 ;
pcoc d, 3 ;
(* pcoc_v2 d ; *)
tdg09 d, 1 ;
]
let () =
let sim =
let open Simulation_dataset in
convdet_simulation
(* ~tree:(NHX "example/trees4analyses_db/cyp_coding.Chrysithr_root.nhx") *)
~tree:(NHX "example/trees_test/orthomam_rooted.nhx")
~tree:(NHX "data/besnard2009/besnard2009.nhx")
~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
~n_h0:900 ~n_ha:100 ~ne_s:(2., 2.) ()
~n_h0:900 ~n_ha:100 ~branch_scale:3. ~ne_s:(2., 2.) ()
in
let w = benchmark sim in
let loggers = [ Bistro_utils.Console_logger.create () ] in
......
......@@ -164,10 +164,10 @@ let multinomial_benchmark d =
~oracle:(oracle d)
~labels:[|"LRT";"LRTsim";"sparse";"sparse_sim"|]
~results:[
multinomial_asymptotic_lrt d ;
multinomial_simulation_lrt d ;
multinomial_asymptotic_sparse d ;
multinomial_simulation_sparse d ;
multinomial_asymptotic_lrt d, 1 ;
multinomial_simulation_lrt d, 1 ;
multinomial_asymptotic_sparse d, 1 ;
multinomial_simulation_sparse d, 1 ;
]
......@@ -199,11 +199,11 @@ let benchmark2 d =
~oracle:(oracle d)
~labels:[|"identical";"topological";"multinomial";"pcoc";"tdg09"|]
~results:[
identical d ;
topological d ;
multinomial_asymptotic_lrt d ;
pcoc d ;
tdg09 d ;
identical d, 1 ;
topological d, 1 ;
multinomial_asymptotic_lrt d, 1 ;
pcoc d, 3 ;
tdg09 d, 1 ;
]
(* param exploration for SMBE paper *)
......
......@@ -37,11 +37,11 @@ let%pworkflow recall_precision_curve ~labels ~oracle ~results : pdf file =
let open Codepitk in
let n = Array.length labels in
assert (n = List.length results) ;
let colors = Array.sub [|"blue";"green";"red";"tan1";"royalblue4";"darkorchid"|] ~pos:0 ~len:n in
let colors = Array.sub [|"blue";"green";"red";"tan1";"royalblue4";"darkorchid";"yellow"|] ~pos:0 ~len:n in
let labels = [%param labels] in
let load_results fn =
let load_results fn col =
let df = Dataframe.from_file fn |> Rresult.R.failwith_error_msg in
match Dataframe.get_col df 1 with
match Dataframe.get_col df col with
| Some (Floats xs) -> Array.map xs ~f:Option.some
| Some (Float_opts xs) -> xs
| Some (Ints xs) -> Array.map xs ~f:(fun i -> Some (Float.of_int i))
......@@ -49,10 +49,11 @@ let%pworkflow recall_precision_curve ~labels ~oracle ~results : pdf file =
| _ -> failwith "expected a numeric column at pos 1"
in
let oracle =
load_results [%path oracle]
load_results [%path oracle] 1
|> Array.map ~f:(Option.map ~f:Float.(( <> ) 0.))
in
let results = List.map ~f:load_results [%eval Bistro.Workflow.path_list results] in
let result_paths = [%eval Bistro.Workflow.path_list (List.map ~f:fst results)] in
let results = List.map2_exn result_paths (List.map ~f:snd results) ~f:load_results in
let filter_table x y =
Array.filter_mapi x ~f:(fun i x_i ->
match x_i, y.(i) with
......
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