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
nonhomogeneous = general
nonhomogeneous.number_of_models = 1
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
item ["simulated_sequences.fna"] fna ;
let main ~outdir ?np ?mem ~preview_mode () =
let derive ~tree_dir ~trees ~preview = 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 ~outdir ~np ~mem:(`GB mem) repo
let command =
let open Command.Let_syntax in
......@@ -13,13 +27,15 @@ let command =
~summary:"Run simulation pipeline"
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"
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