msd.ml 1.34 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 13
  let fa_tmp = tmp // "out.tsv" in
  Workflow.shell ~descr:("convergence_detection.run_msd."^descr) [
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" ~img [
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;
    ];
Carine Rey's avatar
Carine Rey committed
23 24 25 26 27 28 29 30 31 32 33 34
    cmd "cp" ~img [
      dep faa;
      ident fa_tmp
    ];
    cmd "cat" ~img [
      ident fa_tmp
    ];
    cmd "grep" ~img [
      string "-c";
      string "\">\"";
      ident fa_tmp
    ];
Philippe Veber's avatar
Philippe Veber committed
35
    cmd "msd" ~img [
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
    ];
  ]

Philippe Veber's avatar
Philippe Veber committed
45
let results run_msd : text file =
Philippe Veber's avatar
Philippe Veber committed
46 47
  Workflow.shell ~descr:"convergence_detection.parse_msd" [
    cmd "python" ~img [
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;
    ];
  ]