Commit 6a2c6eaa authored by Philippe Veber's avatar Philippe Veber
Browse files

added gBGC option in simulator

parent b841e7c4
......@@ -33,6 +33,7 @@ type dataset =
n_h0 : int ;
n_ha : int ;
ne_s : float ;
gBGC : float ;
seed : int ;
}
......@@ -55,13 +56,14 @@ let bppseqgen_simulation ~hyp ~tree ~profiles ~nb_sites ~seed =
seed ;
}
let convdet_simulation ?(branch_factor = 1.) ?(ne_s = 1.) ?(seed = 0) ~tree ~profiles ~n_h0 ~n_ha () =
let convdet_simulation ?(branch_factor = 1.) ?(ne_s = 1.) ?(gBGC = 0.) ?(seed = 0) ~tree ~profiles ~n_h0 ~n_ha () =
Convdet_simulation {
tree ;
profiles ;
n_h0 ;
n_ha ;
ne_s ;
gBGC ;
branch_factor ;
seed : int ;
}
......@@ -122,10 +124,10 @@ let rec nucleotide_alignment = function
let h0 = nucleotide_alignment (Bppseqgen_simulation { hypothesis = H0 (Fixed ne_s) ; profiles ; seed ; nb_sites = n_h0 ; tree }) in
let ha = nucleotide_alignment (Bppseqgen_simulation { hypothesis = HaPC (Fixed ne_s) ; profiles ; seed ; nb_sites = n_ha ; tree }) in
Utils.fasta_cappend h0 ha
| Convdet_simulation { n_h0 ; n_ha ; profiles ; ne_s ; branch_factor ; seed ; _ } as sim ->
| Convdet_simulation { n_h0 ; n_ha ; profiles ; ne_s ; gBGC ; branch_factor ; seed ; _ } as sim ->
let tree = tree sim in
let fitness_profiles = Workflow.input profiles in
Simulator.simulator ~branch_factor ~n_ha ~n_h0 ~ne_s ~tree ~seed ~fitness_profiles ()
Simulator.simulator ~branch_factor ~n_ha ~n_h0 ~ne_s ~gBGC ~tree ~seed ~fitness_profiles ()
let amino_acid_alignment d = Bppsuite.fna2faa (nucleotide_alignment d)
......
open Core_kernel
let%pworkflow simulator ?branch_factor ?seed ~n_h0 ~n_ha ~ne_s ~tree ~fitness_profiles () =
let%pworkflow simulator ?branch_factor ?seed ~n_h0 ~n_ha ~ne_s ~gBGC ~tree ~fitness_profiles () =
let () = Option.iter ~f:Random.init [%param seed] in
let n_h0 = [%param n_h0] in
let n_ha = [%param n_ha] in
......@@ -12,7 +12,7 @@ let%pworkflow simulator ?branch_factor ?seed ~n_h0 ~n_ha ~ne_s ~tree ~fitness_pr
|> Array.map ~f:(Array.map ~f:(( *. ) ne_s)) in
let base_param =
let p = Convdet.Mutsel.random_param ~alpha_nucleotide:10. ~alpha_fitness:0.1 in
{ p with omega = 1. }
{ p with omega = 1. ; gBGC }
in
let random_profile () =
Random.int (Array.length fitness_profiles)
......
......@@ -7,6 +7,7 @@ val simulator :
n_h0:int ->
n_ha:int ->
ne_s:float ->
gBGC:float ->
tree:nhx pworkflow ->
fitness_profiles:#text_file pworkflow ->
unit ->
......
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