bppsuite.ml 1.13 KB
Newer Older
LANORE Vincent's avatar
LANORE Vincent committed
1
open Bistro.EDSL
Carine Rey's avatar
Carine Rey committed
2
open Bistro.Std
LANORE Vincent's avatar
LANORE Vincent committed
3
open Core
Carine Rey's avatar
Carine Rey committed
4
open File_formats
LANORE Vincent's avatar
LANORE Vincent committed
5 6


Carine Rey's avatar
Carine Rey committed
7
let env = docker_image ~account:"carinerey" ~name:"bppsuite:06182018" ()
LANORE Vincent's avatar
LANORE Vincent committed
8 9 10 11

let assign k v =
  seq ~sep:"=" [ string k ; v ]

12

Carine Rey's avatar
Carine Rey committed
13
let conf_file_bppseqgen ~tree ~nb_sites ~config =
LANORE Vincent's avatar
LANORE Vincent committed
14 15 16 17
  seq ~sep:"\n" [
    assign "input.tree.file" (dep tree) ;
    assign "output.sequence.file" dest ;
    assign "number_of_sites" (int nb_sites) ;
Carine Rey's avatar
Carine Rey committed
18
    string config ;
LANORE Vincent's avatar
LANORE Vincent committed
19 20
  ]

Carine Rey's avatar
Carine Rey committed
21
let bppseqgen ~nb_sites ~tree ~config : nucleotide_fasta workflow =
Carine Rey's avatar
Carine Rey committed
22
  workflow ~descr:"bppsuite.bppseqgen" [
LANORE Vincent's avatar
LANORE Vincent committed
23
    cmd "bppseqgen" ~env [
Carine Rey's avatar
Carine Rey committed
24
      assign "param" (file_dump (conf_file_bppseqgen ~tree ~nb_sites ~config)) ;
Carine Rey's avatar
Carine Rey committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    ]
  ]


let conf_file_bppseqman ~fna =
  seq ~sep:"\n" [
    assign "input.sequence.file" (dep fna) ;
    assign "output.sequence.file" dest ;
    string {|alphabet=Codon(letter=DNA)
             genetic_code = Standard
             input.alignment = true
             sequence.manip = Translate
           |}
  ]

let fna2faa ~(fna:nucleotide_fasta workflow) : aminoacid_fasta workflow =
  workflow ~descr:"bppsuite.fna2faa" [
    cmd "bppseqman" ~env [
      assign "param" (file_dump (conf_file_bppseqman ~fna)) ;
LANORE Vincent's avatar
LANORE Vincent committed
44 45
    ]
  ]