Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

reviewphiltrans_app.ml 4.01 KB
Newer Older
Philippe Veber's avatar
Philippe Veber committed
1 2
open Core
open Reviewphiltrans
3 4
open Bistro_utils

Philippe Veber's avatar
Philippe Veber committed
5

6 7 8 9
let first_nhx_in_dir dir =
  Sys.readdir dir
  |> Array.find_exn ~f:(String.is_suffix ~suffix:".nhx")

10 11
let sw b x = if b then Some x else None

12 13 14 15
let realdata_main ~use_diffsel
                  ~use_pcoc
                  ~use_pcoc_c60
                  ~use_pcoc_gamma
16 17 18
                  ~use_pcoc_v2 
                  ~use_pcoc_pcp
                  ~use_tdg09
19 20 21
                  ~use_topological
                  ~use_identical
                  ~no_use_multinomial
22 23
                  ~calc_dnds
                  ~calc_gene_trees
24 25 26 27
                  ~indir ~outdir ~np ~mem () =
  let loggers = [
      Console_logger.create () ;
  ] in
28 29 30 31 32 33
  let mem = Option.map mem ~f:(fun i -> `GB i) in
  let rd =
    Real_dataset.make
      ~alignment_dir_path:(Filename.concat indir "Alignments")
      ~tree_path:(Filename.concat indir (first_nhx_in_dir indir))
  in
34
  let use_multinomial = not no_use_multinomial in
35 36
  let meths = List.filter_opt [
      sw use_diffsel `Diffsel ;
37
      sw use_pcoc `Pcoc ;
Carine Rey's avatar
Carine Rey committed
38
      sw use_pcoc_c60 `Pcoc_C60 ;
39
      sw use_pcoc_gamma `Pcoc_gamma ;
40 41 42
      sw use_pcoc_v2   `PCOC_v2 ;
      sw use_pcoc_pcp `PCOC_pcp ;
      sw use_tdg09 `Tdg09 ;
43 44 45
      sw use_topological `Topological ;
      sw use_identical `Identical ;
      sw use_multinomial `Multinomial ;
46 47
    ]
  in
48 49 50 51 52
  let pal  = List.filter_opt [
    sw calc_dnds `DnDs;
    sw calc_gene_trees `GeneTree;
    ]
  in
53 54
  List.concat [
    Repo.shift "Merged_results" (Real_dataset.repo meths rd) ;
55
    Repo.shift "PreParsed_Dataset" (Real_dataset.repo_parsed_rd pal rd);
56
    ]
57
  |> Bistro_utils.Repo.build_main ~outdir ~loggers ?np ?mem
58 59 60 61 62 63 64 65 66 67

let realdata_command =
  let open Command.Let_syntax in
  Command.basic
    ~summary:"Run pipeline on real data"
    [%map_open
      let outdir =
        flag "--outdir" (required string) ~doc:"PATH Output directory"
      and indir =
        flag "--indir" (required string) ~doc:"PATH Input directory"
68 69
      and use_diffsel =
        flag "--diffsel" no_arg ~doc:" use the diffsel method (very slow)."
70 71 72
      and use_pcoc =
        flag "--pcoc" no_arg ~doc:" use the pcoc method (slow)."
      and use_pcoc_c60 =
73
        flag "--pcoc-c60" no_arg ~doc:" use the pcoc method with c60 profils (very_slow)."
74
      and use_pcoc_gamma =
75
        flag "--pcoc-gamma" no_arg ~doc:" use the pcoc method with the gamma option (very_slow)."
76 77 78 79 80 81
      and use_pcoc_v2 =
        flag "--pcoc-v2" no_arg ~doc:" use the pcoc v2 method with the C10 profiles (slow)."
      and use_pcoc_pcp =
        flag "--pcoc-pcp" no_arg ~doc:" use the pcoc v2 method with the physico-chemical profiles (slow)."
      and use_tdg09 =
        flag "--tdg09" no_arg ~doc:" use the tdg09 method (slow)."
82 83 84 85 86 87
      and use_topological =
        flag "--topological" no_arg ~doc:" use the topological method (fast)."
      and use_identical =
        flag "--identical" no_arg ~doc:" use the identical method (fast)."
      and no_use_multinomial =
        flag "--no-multinomial" no_arg ~doc:" not use the multinomial method (very fast so by default)."
88 89 90 91
      and calc_dnds =
          flag "--dnds" no_arg ~doc:" calculate dn ds dnds trees (slow)."
      and calc_gene_trees =
          flag "--gt" no_arg ~doc:" calculate gene trees (slow)."
92 93 94 95 96
      and np =
        flag "--np" (optional int) ~doc:"INT Number of available processors"
      and mem =
        flag "--mem" (optional int) ~doc:"INT Available memory (in GB)"
      in
97 98 99 100
      realdata_main ~use_diffsel
                    ~use_pcoc
                    ~use_pcoc_c60
                    ~use_pcoc_gamma
101 102 103
                    ~use_pcoc_v2 
                    ~use_pcoc_pcp
                    ~use_tdg09
104 105 106
                    ~use_topological
                    ~use_identical
                    ~no_use_multinomial
107 108
                    ~calc_dnds
                    ~calc_gene_trees
109
                    ~indir ~outdir ~np ~mem
110 111
    ]

Philippe Veber's avatar
Philippe Veber committed
112 113
let () =
  Command.group ~summary:"Reviewphiltrans" [
Philippe Veber's avatar
Philippe Veber committed
114
    "validation", Pipeline.validation_command ;
115
    "realdata", realdata_command ;
116
    "alistats", Alistats.command ;
Philippe Veber's avatar
Philippe Veber committed
117 118
  ]
  |> Command.run