tamuri.ml 1.73 KB
Newer Older
1 2 3 4 5 6 7
open Core
open Bistro.Std
open Bistro.EDSL
open Bistro_bioinfo.Std
open File_formats


Carine Rey's avatar
Carine Rey committed
8
let env = docker_image ~account:"carinerey" ~name:"tdg09_python" ~tag:"v1.1.2_07102018" ()
9 10 11 12 13

let tdg09  ~(faa:aminoacid_fasta workflow) ~(tree:_ workflow) : [`tdg09] directory workflow =
  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
14 15
  let package = tmp // "diffsel_script_utils.py" in
  let script = tmp // "try_again.py" in
16 17 18 19
  workflow ~descr:"convergence_detection.run_tdg09" [
  docker env (
      and_list [
        mkdir_p dest ;
Carine Rey's avatar
Carine Rey committed
20 21 22
        mkdir_p tmp ;
        cd tmp ;

23 24 25 26 27 28 29
        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
30 31 32 33 34 35 36

        cmd "cp"  [ file_dump (string Scripts.diffsel_script_utils) ; package] ;
        cmd "cp" [ file_dump (string Scripts.try_again) ; script] ;

        cmd "python" ~stdout:tdg09_out [
            string "try_again.py";
            opt "--timeout" int 60;
37
            string "\"java -cp /tdg09/tdg09-1.1.2/dist/tdg09.jar tdg09.Analyse";
38 39 40 41
            opt "-tree" ident tmp_tree;
            opt "-alignment"  ident tmp_ali_phy ;
            opt "-threads"  int 1 ;
            opt "-groups"  string "XE ME" ;
Carine Rey's avatar
Carine Rey committed
42
            string "\"";
43 44 45 46 47 48 49 50 51 52 53 54 55 56
        ];
    ]
  )
  ]

let results run_tdg09 : text_file workflow =
  let tdg09_out = run_tdg09 / selector [ "tdg09.yaml" ] in
  workflow ~descr:"convergence_detection.parse_tdg09" [
    cmd "python" ~env [
          file_dump (string Scripts.parse_results_tdg09) ;
          opt "-tdg09" dep tdg09_out;
          opt "-o" ident dest;
          ]
  ]