msd.ml 1.32 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_msd
7

Philippe Veber's avatar
Philippe Veber committed
8
let msd ?(descr="") ~e ~(faa : aminoacid_fasta file) ~(tree_sc : _ file) : [`msd] directory =
Carine Rey's avatar
Carine Rey committed
9 10
  let map_table = dest // "map.tsv" in
  let tree_nw = dest // "tree.nw" in
11
  let out = dest // "out.tsv" in
Carine Rey's avatar
Carine Rey committed
12
  let fa_tmp = tmp // "out.tsv" in
Philippe Veber's avatar
Philippe Veber committed
13
  Workflow.shell ~descr:("convergence_detection.run_msd."^descr) ~img [
14
    mkdir_p dest;
Carine Rey's avatar
Carine Rey committed
15
    mkdir_p tmp;
16
    (*./msd -t 1 -o <nom fichier de sortie> -e 0.05 <phylogénie Newick> <table caractère convergent> <fichier de simulation fasta> *)
Philippe Veber's avatar
Philippe Veber committed
17
    cmd "python" [
18 19 20 21 22
      file_dump (string Scripts.parse_input_msd) ;
      opt "-i" dep tree_sc;
      opt "-o" ident tree_nw;
      opt "-m" ident map_table;
    ];
Philippe Veber's avatar
Philippe Veber committed
23
    cmd "cp" [
Carine Rey's avatar
Carine Rey committed
24 25 26
      dep faa;
      ident fa_tmp
    ];
Philippe Veber's avatar
Philippe Veber committed
27
    cmd "cat" [
Carine Rey's avatar
Carine Rey committed
28 29
      ident fa_tmp
    ];
Philippe Veber's avatar
Philippe Veber committed
30
    cmd "grep" [
Carine Rey's avatar
Carine Rey committed
31 32 33 34
      string "-c";
      string "\">\"";
      ident fa_tmp
    ];
Philippe Veber's avatar
Philippe Veber committed
35
    cmd "msd" [
36 37
      opt "-t" int 1;
      opt "-o"  ident out ;
38
      opt "-e" float e ;
Carine Rey's avatar
Carine Rey committed
39
      ident tree_nw;
40
      ident map_table;
Carine Rey's avatar
Carine Rey committed
41
      ident fa_tmp;
42 43 44
    ];
  ]

45
let results run_msd : cpt file =
Philippe Veber's avatar
Philippe Veber committed
46 47
  Workflow.shell ~descr:"convergence_detection.parse_msd" ~img [
    cmd "python" [
48
      file_dump (string Scripts.parse_output_msd) ;
Philippe Veber's avatar
Philippe Veber committed
49
      opt "-i" dep (Workflow.select run_msd ["out.tsv"]);
50 51 52
      opt "-o" ident dest;
    ];
  ]