Commit bcc0415c authored by Philippe Veber's avatar Philippe Veber
Browse files

added signature for simulation_dataset

parent e336f30c
...@@ -4,14 +4,10 @@ open Reviewphiltrans ...@@ -4,14 +4,10 @@ open Reviewphiltrans
let main ~n_h0 ~n_ha ~seed:i () = let main ~n_h0 ~n_ha ~seed:i () =
let open Simulation_dataset in let open Simulation_dataset in
let sim = let sim =
Bppseqgen_mixed { bppseqgen_mixed_simulation
tree = `NHX "example/trees_analyses/cyp_coding.Chrysithr_root.nhx" ; ~tree:(NHX "example/trees_analyses/cyp_coding.Chrysithr_root.nhx")
profiles = "example/aa_fitness/263SelectedProfiles.tsv" ; ~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
n_h0 ; ~n_h0 ~n_ha ~ne_s:4. ~seed:i ()
n_ha ;
ne_s = 4. ;
seed = i ;
}
in in
let w = benchmark sim in let w = benchmark sim in
Bistro_engine.Scheduler.simple_eval_exn ~np:4 ~mem:(`GB 4) (Bistro.Workflow.path w) Bistro_engine.Scheduler.simple_eval_exn ~np:4 ~mem:(`GB 4) (Bistro.Workflow.path w)
......
...@@ -6,7 +6,13 @@ let calc_fixed_seed ~(str:string) (seed:int) : int = ...@@ -6,7 +6,13 @@ let calc_fixed_seed ~(str:string) (seed:int) : int =
let str_hash = Hashtbl.hash str in let str_hash = Hashtbl.hash str in
Hashtbl.hash (str_hash + seed) Hashtbl.hash (str_hash + seed)
type tree = [`NHX of string | `Pair_tree of float * float * int] type tree =
| NHX of string
| Pair_tree of {
npairs : int ;
branch_length1 : float ;
branch_length2 : float ;
}
type t = type t =
| Bppseqgen_simulation of { | Bppseqgen_simulation of {
...@@ -67,10 +73,10 @@ let convdet_simulation ?(branch_factor = 1.) ?(ne_s = 1., 1.) ?(gBGC = 0., 0.) ? ...@@ -67,10 +73,10 @@ let convdet_simulation ?(branch_factor = 1.) ?(ne_s = 1., 1.) ?(gBGC = 0., 0.) ?
} }
let prefix_of_tree = function let prefix_of_tree = function
| `NHX path -> | NHX path ->
Caml.Filename.chop_extension path Caml.Filename.chop_extension path
| `Pair_tree (bl1, bl2, np) -> | Pair_tree { branch_length1 ; branch_length2 ; npairs } ->
sprintf "pair_tree(bl1=%g,bl2=%g,np=%d)" bl1 bl2 np sprintf "pair_tree(bl1=%g,bl2=%g,np=%d)" branch_length1 branch_length2 npairs
let tree_prefix = function let tree_prefix = function
| Bppseqgen_simulation { tree ; _ } | Bppseqgen_simulation { tree ; _ }
...@@ -83,18 +89,13 @@ let tree ~branch_length_unit:_ = function ...@@ -83,18 +89,13 @@ let tree ~branch_length_unit:_ = function
| Bppseqgen_mixed { tree ; _ } | Bppseqgen_mixed { tree ; _ }
| Convdet_simulation { tree ; _ } -> | Convdet_simulation { tree ; _ } ->
match tree with match tree with
| `NHX path -> | NHX path ->
Workflow.input path Workflow.input path
| `Pair_tree (branch_length1, | Pair_tree { branch_length1 ;
branch_length2, branch_length2 ;
npairs) -> npairs } ->
Simulator.pair_tree ~branch_length1 ~branch_length2 ~npairs Simulator.pair_tree ~branch_length1 ~branch_length2 ~npairs
let tree_dataset sim =
Tree_dataset.prepare
~descr:("simulated_data." ^ (tree_prefix sim))
(tree ~branch_length_unit:`Nucleotide sim)
let seed = function let seed = function
| Bppseqgen_mixed s -> s.seed | Bppseqgen_mixed s -> s.seed
| Bppseqgen_simulation s -> s.seed | Bppseqgen_simulation s -> s.seed
...@@ -227,7 +228,7 @@ let explore_params ~(f: param_t -> _) = ...@@ -227,7 +228,7 @@ let explore_params ~(f: param_t -> _) =
let simu_of_param ?n_h0:(n_h0=50) (p: param_t) = let simu_of_param ?n_h0:(n_h0=50) (p: param_t) =
let bf, gbgc = p in let bf, gbgc = p in
convdet_simulation convdet_simulation
~tree:(`NHX "example/trees_analyses/C4AmaranthaceaePolyroot.nhx") ~tree:(NHX "example/trees_analyses/C4AmaranthaceaePolyroot.nhx")
~profiles:"example/aa_fitness/263SelectedProfiles.tsv" ~profiles:"example/aa_fitness/263SelectedProfiles.tsv"
~branch_factor:bf ~branch_factor:bf
~gBGC:(match gbgc with ~gBGC:(match gbgc with
......
open Bistro
type tree =
| NHX of string
| Pair_tree of {
npairs : int ;
branch_length1 : float ;
branch_length2 : float ;
}
type t
val bppseqgen_mixed_simulation :
?ne_s:float ->
?seed:int ->
tree:tree -> profiles:string -> n_h0:int -> n_ha:int -> unit -> t
val bppseqgen_simulation :
hyp:Convergence_hypothesis.t ->
tree:tree -> profiles:string -> nb_sites:int -> seed:int -> t
val convdet_simulation :
?branch_factor:float ->
?ne_s:float * float ->
?gBGC:float * float ->
?seed:int ->
tree:tree -> profiles:string -> n_h0:int -> n_ha:int -> unit -> t
include Detection_pipeline.Query with type t := t
include Detection_pipeline.S with type query := t
val alignment_plot : t -> svg file
val multinomial_benchmark : t -> pdf file
val benchmark :
?mode:[`fast | `full] ->
t ->
svg file
val benchmark2 : t -> pdf file
(** stuff for gbgc SBME paper *)
type gBGC_t = Global of float | Convergent of float * float
type param_t
val explore_params : f:(param_t -> 'a) -> ((float * gBGC_t) * 'a) list
val simu_of_param : ?n_h0:int -> param_t -> t
val filter_results : f:('a -> bool) -> (param_t * 'a) list -> (param_t * 'a) list
type record_t
val record_of_simu : t -> record_t workflow
val realistic_result : record_t -> bool
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