Commit 592fee23 authored by Carine Rey's avatar Carine Rey
Browse files

fix error reprodcucibility

parent c84d0c5f
......@@ -17,11 +17,12 @@ let bash_script args code =
seq ~sep:"\n" [ prelude ; string code ]
let diffsel_add_iterations_script ~chainname ~ali ~tree =
let diffsel_add_iterations_script ~chainname ~ali ~tree ~seed =
let vars = [
"CHAIN", chainname ;
"ALI", ali ;
"TREE", tree ;
"SEED", int seed ;
]
in
bash_script vars {|
......@@ -57,7 +58,7 @@ echo end_it=$end_it
#
#cat new_iterations.txt > $CHAIN.iterations
/diffsel/_build/diffsel -t $TREE -d $ALI -ncond 2 -x 1 $end_it $CHAIN
/diffsel/_build/diffsel -t $TREE -d $ALI -ncond 2 -x 1 $end_it $CHAIN -seed $SEED
|}
......@@ -70,6 +71,10 @@ let diffsel ~(phy_n:nucleotide_phylip workflow) ~(tree: _ workflow) ~(w_every:in
let dest_ali = dest // "myrun.ali" in
let chainname_tmp = tmp // "myrun_tmp" in
let chainname = dest // "myrun" in
let seed = match seed with
| Some s -> s
| None -> (Random.int Int.max_value)
in
let n_cycles = if (n_cycles > 200) then 20 else n_cycles in
let script_r = tmp // "DiffselMCMCConvergenceAnalysis.Rmd" in
(*_build/diffsel -t data/samhd1.tree -d data/samhd1.ali -ncond 3 -x 1 10000 myrun*)
......@@ -89,10 +94,10 @@ let diffsel ~(phy_n:nucleotide_phylip workflow) ~(tree: _ workflow) ~(w_every:in
opt "-d" ident tmp_ali ;
opt "-ncond" int 2 ;
opt "-x" seq [ int w_every; string " "; int n_cycles];
option (opt "-seed" int) seed ;
opt "-seed" int seed ;
ident chainname_tmp ;
];
cmd "bash" [(file_dump (diffsel_add_iterations_script ~chainname ~ali:tmp_ali ~tree:tmp_tree ))];
cmd "bash" [(file_dump (diffsel_add_iterations_script ~chainname ~ali:tmp_ali ~tree:tmp_tree ~seed))];
]
)
]
......
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