tamuri.ml 1.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
open Core
open Bistro.Std
open Bistro.EDSL
open Bistro_bioinfo.Std
open File_formats


let env = docker_image ~account:"carinerey" ~name:"tdg09" ~tag:"v1.1.2" ()

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
  workflow ~descr:"convergence_detection.run_tdg09" [
  docker env (
      and_list [
        mkdir_p dest ;
        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;
         ];
        cmd "tdg09.sh" ~stdout:tdg09_out [
            opt "-tree" ident tmp_tree;
            opt "-alignment"  ident tmp_ali_phy ;
            opt "-threads"  int 1 ;
            opt "-groups"  string "XE ME" ;
        ];
    ]
  )
  ]

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;
          ]
  ]