Commit 1a98f301 authored by Philippe Veber's avatar Philippe Veber
Browse files

bppsuite: fixed random seed usage

parent aa74ed23
......@@ -56,16 +56,16 @@ let conf_file_bppseqgen_multi_profiles ~tree ~profile_f ~ne_c ~ne_a ~config ~nb_
assign "NE_1" (float ne_a) ;
assign "NE_C" (float ne_c) ;
assign "NE_T" (float ne_c) ;
assign "seed" (int 1) ;
]
@ config
)
let bppseqgen_multi_profiles_script ~config ~out ~profile_c =
let bppseqgen_multi_profiles_script ~config ~out ~profile_c ~seed =
let vars = [
"FINAL_OUT", ident out ;
"PARAM", config ;
"PROFILE_C", ident profile_c ;
"RANDOM", int seed ;
]
in
bash_script vars {|
......@@ -77,7 +77,9 @@ let bppseqgen_multi_profiles_script ~config ~out ~profile_c =
COL_M1=`echo $line | cut -f 1 -d " "`
COL_M2=`echo $line | cut -f 2 -d " "`
echo "i: $i" "COL_M1: $COL_M1" "COL_M2: $COL_M2"
bppseqgen param=$PARAM i=$i COL_M1=$COL_M1 COL_M2=$COL_M2 output.sequence.file=out_int_"$i".fa
SEED=${RANDOM}
echo seed=${SEED}
bppseqgen param=$PARAM i=$i COL_M1=$COL_M1 COL_M2=$COL_M2 output.sequence.file=out_int_"$i".fa seed=${SEED}
done < "$PROFILE_C"
cp $PROFILE_C $FINAL_OUT.info
......@@ -88,7 +90,7 @@ let bppseqgen_multi_profiles_script ~config ~out ~profile_c =
|}
let bppseqgen_multi_profiles ?(descr="") ~profile_f ~profile_c ~nb_sites ~tree ~config ~ne_c ~ne_a : bppseqgen_multi_profiles directory workflow =
let bppseqgen_multi_profiles ?(descr="") ~profile_f ~profile_c ~nb_sites ~tree ~config ~ne_c ~ne_a ~seed : bppseqgen_multi_profiles directory workflow =
let nb_sites_per_profile = 1 in
(* let nb_combis = Pervasives.(nb_sites / nb_sites_per_profile) in *)
let config_f = dest // "config.bpp" in
......@@ -106,7 +108,7 @@ let bppseqgen_multi_profiles ?(descr="") ~profile_f ~profile_c ~nb_sites ~tree ~
dep profile_c
];*)
cmd "cat" ~stdout:config_f [(file_dump (conf_file_bppseqgen_multi_profiles ~tree ~profile_f ~config ~ne_c ~ne_a ~nb_sites_per_profile))];
cmd "bash" [(file_dump (bppseqgen_multi_profiles_script ~config:config_f ~out ~profile_c:profile_c_ok))];
cmd "bash" [(file_dump (bppseqgen_multi_profiles_script ~config:config_f ~out ~profile_c:profile_c_ok ~seed))];
]
)
]
......
......@@ -20,6 +20,7 @@ val bppseqgen_multi_profiles :
config:Bistro.Template.t list ->
ne_c: float ->
ne_a: float ->
seed:int ->
bppseqgen_multi_profiles directory workflow
val bppseqgen_multi_profiles_get_fa :
......
......@@ -110,7 +110,7 @@ let derive_from_model ~model ~input_tree ~tree_dataset ~tree_prefix ~profile ~pr
in
let profile_f = profile.profile_f in
let profile_c = profile.profile_c in
let run_fna = Bppsuite.bppseqgen_multi_profiles ~descr ~nb_sites ~tree ~config:config_p ~profile_f ~profile_c ~ne_c ~ne_a in
let run_fna = Bppsuite.bppseqgen_multi_profiles ~descr ~nb_sites ~tree ~config:config_p ~profile_f ~profile_c ~ne_c ~ne_a ~seed:(Random.int Int.max_value) in
let fna = Bppsuite.bppseqgen_multi_profiles_get_fa run_fna in
let fna_infos = Some (Bppsuite.bppseqgen_multi_profiles_get_info run_fna) in
......
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