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

7
let env = Env.env_tdg09
8 9 10 11 12

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

22 23 24 25 26 27
        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;
28
        ];
Carine Rey's avatar
Carine Rey committed
29 30 31 32

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

33 34
        cmd "java" ~stdout:tdg09_out [
          string "-cp /tdg09/tdg09.jar tdg09.Analyse";
35 36 37 38
          opt "-tree" ident tmp_tree;
          opt "-alignment"  ident tmp_ali_phy ;
          opt "-threads"  int 1 ;
          opt "-groups"  string "XE ME" ;
39
        ]
40 41
      ]
    )
42 43 44 45 46 47
  ]

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 [
48 49 50 51
      file_dump (string Scripts.parse_results_tdg09) ;
      opt "-tdg09" dep tdg09_out;
      opt "-o" ident dest;
    ]
52
  ]