package phylogenetics

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Mutation-selection model for codons

This module defines a parameterization for the Mutsel evolutionary model for codons, as well as functions to compute the corresponding transition rate matrix and the associated stationary distribution.

References:

module NSCodon_rate_matrix : sig ... end
type param = {
  1. nucleotide_rates : Rate_matrix.Nucleotide.t;
  2. nucleotide_stat_dist : Nucleotide.vector;
  3. omega : float;
  4. scaled_fitness : Amino_acid.vector;
  5. gBGC : float;
  6. pps : float;
}
val random_param : Gsl.Rng.t -> nucleotide_process:Nucleotide_process.t -> alpha:float -> param
val flat_param : unit -> param
val rate_matrix : param -> NSCodon_rate_matrix.t

rate_matrix param computes the rate matrix for codon substitutions based on the given parameter values param. The resulting matrix is a rate matrix, meaning that its off-diagonal elements are positive and its lines sum to 0.

Example:

let param = flat_param () in
let matrix = rate_matrix param in
val stationary_distribution : param -> NSCodon.vector

stationary_distribution param calculates the stationary distribution under parameter value param.

Example:

let param = flat_param () in
let distribution = stationary_distribution param in
val transition_probability_matrix : param -> float -> NSCodon.matrix

transition_probability_matrix param t computes the transition probability matrix for codon substitutions over a specified time period t based on the given parameter values param. The resulting matrix is a probability matrix, meaning that all elements are probabilities and lines sum to 1.

Example:

let param = flat_param () in
let time = 0.1 in
let transition_matrix = transition_probability_matrix param time in
OCaml

Innovation. Community. Security.