tamuri.ml 1.46 KB
Newer Older
1
open Core
Philippe Veber's avatar
Philippe Veber committed
2 3
open Bistro
open Bistro.Shell_dsl
4 5
open File_formats

Philippe Veber's avatar
Philippe Veber committed
6
let img = Env.env_tdg09
7

Philippe Veber's avatar
Philippe Veber committed
8
let tdg09  ?(descr="") ~(faa:aminoacid_fasta file) ~(tree:_ file) () : [`tdg09] directory =
9 10 11
  let tdg09_out = dest // "tdg09.yaml" in
  let tmp_ali_phy = dest // "tmp_ali.phy" in
  let tmp_tree = dest // "tmp.nw" in
Carine Rey's avatar
Carine Rey committed
12 13
  let package = tmp // "diffsel_script_utils.py" in
  let script = tmp // "try_again.py" in
Philippe Veber's avatar
Philippe Veber committed
14 15 16 17 18
  Workflow.shell ~descr:("convergence_detection.run_tdg09."^descr) ~img [
    and_list [
      mkdir_p dest ;
      mkdir_p tmp ;
      cd tmp ;
Carine Rey's avatar
Carine Rey committed
19

Philippe Veber's avatar
Philippe Veber committed
20 21 22 23 24 25 26
      cmd "python" [
        file_dump (string Scripts.rename_input_tree_ali_tdg09) ;
        opt "-t" dep tree;
        opt "-a" dep faa;
        opt "-out_a " ident tmp_ali_phy;
        opt "-out_t " ident tmp_tree;
      ];
Carine Rey's avatar
Carine Rey committed
27

Philippe Veber's avatar
Philippe Veber committed
28 29
      cmd "cp"  [ file_dump (string Scripts.diffsel_script_utils) ; package] ;
      cmd "cp" [ file_dump (string Scripts.try_again) ; script] ;
Carine Rey's avatar
Carine Rey committed
30

Philippe Veber's avatar
Philippe Veber committed
31 32 33 34 35 36
      cmd "java" ~stdout:tdg09_out [
        string "-cp /tdg09/tdg09.jar tdg09.Analyse";
        opt "-tree" ident tmp_tree;
        opt "-alignment"  ident tmp_ali_phy ;
        opt "-threads"  int 1 ;
        opt "-groups"  string "XE ME" ;
37
      ]
Philippe Veber's avatar
Philippe Veber committed
38
    ]
39 40
  ]

41
let results run_tdg09 : cpt file =
Philippe Veber's avatar
Philippe Veber committed
42
  let tdg09_out = Workflow.select run_tdg09 [ "tdg09.yaml" ] in
Philippe Veber's avatar
Philippe Veber committed
43 44
  Workflow.shell ~descr:"convergence_detection.parse_tdg09" ~img [
    cmd "python" [
45 46 47 48
      file_dump (string Scripts.parse_results_tdg09) ;
      opt "-tdg09" dep tdg09_out;
      opt "-o" ident dest;
    ]
49
  ]