Commit 7c6504f0 authored by LANORE Vincent's avatar LANORE Vincent
Browse files

Added bppseqgen to pipeline.

parent aa70eef1
open Bistro.EDSL
open Core
let env = docker_image ~account:"carinerey" ~name:"bppsuite" ()
let assign k v =
seq ~sep:"=" [ string k ; v ]
let conf_file ~tree ~nb_sites =
seq ~sep:"\n" [
assign "input.tree.file" (dep tree) ;
assign "output.sequence.file" dest ;
assign "model1" (string "Codon_AAFit(model=K80, fitness=FromModel(model=LGL08_CAT_C1(nbCat=10)))") ;
assign "number_of_sites" (int nb_sites) ;
string {|alphabet=Codon(letter=DNA)
genetic_code = Standard
input.tree.format=Nhx
nonhomogeneous = general
nonhomogeneous.number_of_models = 1
model1.nodes_id=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77
nonhomogeneous.root_freq=Fixed()
rate_distribution=Constant()
output.internal.sequences=no
|}
]
let bppseqgen ~tree ~nb_sites = workflow ~descr:"bppsuite.bppseqgen" [
cmd "bppseqgen" ~env [
assign "param" (file_dump (conf_file ~tree ~nb_sites)) ;
]
]
open Core
open Bistro_utils
open Bistro.EDSL
let repo () = Repo.[
let derive_from_tree ~tree_dir ~tree ~preview =
let tree = input (Filename.concat tree_dir tree) in
let nb_sites = if preview then 10 else 100 in
let fna = Bppsuite.bppseqgen ~tree ~nb_sites in
Repo.[
item ["simulated_sequences.fna"] fna ;
]
let main ~outdir ?np ?mem ~preview_mode () =
()
let derive ~tree_dir ~trees ~preview =
List.map trees ~f:(fun tree ->
let id = Filename.chop_extension tree in
Repo.shift id (derive_from_tree ~tree_dir ~tree ~preview))
|> List.concat
let main ~outdir ?(np = 2) ?(mem = 2) ~tree_dir ~preview () =
let trees = Array.to_list @@ Sys.readdir tree_dir in
let repo = derive ~tree_dir ~trees ~preview in
Repo.build ~outdir ~np ~mem:(`GB mem) repo
let command =
let open Command.Let_syntax in
......@@ -13,13 +27,15 @@ let command =
~summary:"Run simulation pipeline"
[%map_open
let outdir =
flag "--outdir" (optional string) ~doc:"PATH Output directory"
and preview_mode =
flag "--preview-mode" (optional int) ~doc:"INT If present, only consider K million reads"
flag "--outdir" (required string) ~doc:"PATH Output directory"
and preview =
flag "--preview-mode" no_arg ~doc:" Preview mode"
and np =
flag "--np" (optional int) ~doc:"INT Number of available processors"
and mem =
flag "--mem" (optional int) ~doc:"INT Available memory (in GB)"
and tree_dir =
flag "--tree-dir" (required string) ~doc:"PATH Path to tree directory"
in
main ~outdir ?np ?mem ~preview_mode
main ~outdir ?np ?mem ~tree_dir ~preview
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment