tamuri.ml 1.52 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
14
  Workflow.shell ~descr:("convergence_detection.run_tdg09."^descr) [
Philippe Veber's avatar
Philippe Veber committed
15
    within_container img (
16 17
      and_list [
        mkdir_p dest ;
Carine Rey's avatar
Carine Rey committed
18 19 20
        mkdir_p tmp ;
        cd tmp ;

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;
27
        ];
Carine Rey's avatar
Carine Rey committed
28 29 30 31

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

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

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