Commit 1940c313 authored by Louis Duchemin's avatar Louis Duchemin
Browse files

Rerconverge : rename wip.ml to rer_omm.ml + tidy up stdout

parent 3d8e32a1
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
(pps ppx_jane))) (pps ppx_jane)))
(executable (executable
(name wip) (name rer_omm)
(public_name wip) (public_name rer_omm)
(modules wip) (modules rer_omm)
(libraries codepi) (libraries codepi)
(preprocess (preprocess
(pps ppx_jane))) (pps ppx_jane)))
open Core_kernel
let db = Codepitk.Orthomam_db.make "/home/louis/Data/omm/" let db = Codepitk.Orthomam_db.make "/home/louis/Data/omm/"
let echolocators = Bistro.Workflow.data Codepi.Orthomam.species_with_echolocation let echolocators = Bistro.Workflow.data Codepi.Orthomam.species_with_echolocation
...@@ -21,16 +22,16 @@ module Top = Bistro_utils.Toplevel_eval.Make(struct ...@@ -21,16 +22,16 @@ module Top = Bistro_utils.Toplevel_eval.Make(struct
let result_table_script targets = let result_table_script targets =
let open Codepi.R_console in let open Codepi.R_console in
let assignments = let assignments =
List.map (fun (clade, target) -> List.map ~f:(fun (clade, target) ->
path (Codepi.Rer_converge.string_of_clade clade) Codepi.Orthomam.(target.result_table) path (Codepi.Rer_converge.string_of_clade clade) Codepi.Orthomam.(target.result_table)
) targets ) targets
in in
rconsole (module Top) "library(tidyverse)" assignments rconsole (module Top) "library(tidyverse)" assignments
let () = (* let () =
result_table_script (pipeline ~phenotypes:subterraneans) result_table_script (pipeline ~phenotypes:subterraneans) *)
let main () = let () =
try try
let loggers = [ Bistro_utils.Console_logger.create () ] in let loggers = [ Bistro_utils.Console_logger.create () ] in
let allowed_containers = [ `Docker ] in let allowed_containers = [ `Docker ] in
...@@ -40,12 +41,12 @@ let main () = ...@@ -40,12 +41,12 @@ let main () =
~mem:(`GB 8) ~loggers ~mem:(`GB 8) ~loggers
|> print_endline |> print_endline
in in
List.iter2 (fun label phenotypes -> List.iter2_exn ~f:(fun label phenotypes ->
pipeline ~phenotypes let result_list = pipeline ~phenotypes in
|> List.iter (fun (clade, target) -> result_list |> List.iter ~f:(fun (clade, target) ->
print_endline label;
print_endline ("Foreground clade : " ^ (Codepi.Rer_converge.string_of_clade clade)); Printf.sprintf "%s : %s" label (Codepi.Rer_converge.string_of_clade clade)
|> print_endline;
print_string "Result table : "; print_string "Result table : ";
execute Codepi.Orthomam.(target.result_table); execute Codepi.Orthomam.(target.result_table);
...@@ -55,11 +56,18 @@ let main () = ...@@ -55,11 +56,18 @@ let main () =
print_string "Candidates summary : "; print_string "Candidates summary : ";
execute target.best_candidate_summary; execute target.best_candidate_summary;
print_endline "```r";
result_table_script result_list;
print_endline "```";
Out_channel.newline stdout;
) )
) )
["Subterraneans"; "Marines"] ["Subterraneans" ]
(* ; "Marines"] *)
(* ; "Marines "; "Echolocators"] *) (* ; "Marines "; "Echolocators"] *)
[subterraneans; marines] [subterraneans]
(* ; marines] *)
(* ; marines; echolocators] *) (* ; marines; echolocators] *)
with Failure msg -> print_endline msg with Failure msg -> print_endline msg
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