mutsel_simulator_cpg.mli 1.34 KB
Newer Older
1 2
open Phylogenetics

3
module NSCodon = Codon.Universal_genetic_code.NS
4

5
module Evolution_model : sig
6 7 8 9 10 11
  type context_CpG = {
    lh: Nucleotide.repr option;
    rh: Nucleotide.repr option;
  }

  type param = {
Louis Duchemin's avatar
Louis Duchemin committed
12
    mutsel: Mutsel.param;
13 14 15 16 17 18 19 20
    rate_CpG: float;
    context_CpG: context_CpG;
  }

  val rate_matrix : param -> NSCodon.matrix

  val stationary_distribution:  param -> NSCodon.vector

Louis Duchemin's avatar
Louis Duchemin committed
21 22 23 24
  val flanking_codons: NSCodon.t array -> int -> NSCodon.t option * NSCodon.t option

  val context_CpG_of_codons: ?left_codon:NSCodon.t -> ?right_codon:NSCodon.t -> unit -> context_CpG

25
  val make_param: 
Louis Duchemin's avatar
Louis Duchemin committed
26
    mutsel:Mutsel.param -> 
27
    rate_CpG:float -> 
Louis Duchemin's avatar
Louis Duchemin committed
28
    NSCodon.t array -> int -> param
29

Louis Duchemin's avatar
Louis Duchemin committed
30
  val flat_param: rate_CpG:float -> NSCodon.t array -> int -> param
31

Louis Duchemin's avatar
Louis Duchemin committed
32 33 34
  val random_param: 
    alpha_nucleotide:float -> alpha_fitness:float -> rate_CpG:float -> 
    NSCodon.t array -> int -> param
35

36
  val dinucleotide_ratios: NSCodon.t array -> float array array
37 38
end

39 40
module Make(BI: Simulator.Branch_info) : sig
  include module type of Simulator.Make(NSCodon)(Evolution_model)(BI)
41 42 43 44 45 46 47

  val sequence_gillespie_direct :
    Gsl.Rng.t ->
    ('a, 'b, BI.t) Tree.t ->
    root:NSCodon.t array ->
    param:(NSCodon.t array -> int -> BI.t -> Evolution_model.param) ->
    (NSCodon.t array, NSCodon.t array, BI.t) Tree.t
Philippe Veber's avatar
Philippe Veber committed
48
end
Louis Duchemin's avatar
Louis Duchemin committed
49

50
val demo : int -> rate_CpG:float -> branch_length:float -> unit