Rev Language Reference


fnMutSelAA - Add mutation-selection balance to a rate matrix – fitnesses on amino acids

Constructs a rate matrix from scaled selection coefficients w[i] and mutation rate matrix mu(i,j). fnMutSelAA takes 20 scaled selection coefficients, one for each amino acid. This differs from fnMutSel, which takes 61 scaled selection coefficients, one for each codon. fnMutSelAA assumes that codons for the same amino acid have the same fitness. A substitution from allele i -> j can be decomposed into (1) all individuals initially have state i (2) a single individual mutates from i -> j, at rate mu(i,j) (3) the allele j goes to fixation Then the substitution rate Q is then given by Q(i,j) = mu(i,j) * Pr(j goes to fixation | i was fixed previously). The probability of fixation is determined by scaled selection coefficients: F[i] = 2*N*s[i] and the initial frequency 1/N of allele j.

Usage

fnMutSelAA(RateMatrix submodel, Real[] fitnesses)

Arguments

submodel : RateMatrix (pass by const reference)
Codon rate matrix.
fitnesses : Real[] (pass by const reference)
Amino acid fitnesses.

Return Type

Example

er ~ dnDirichlet( v(1,1,1,1,1,1) )
nuc_pi ~ dnDirichlet( rep(2.0, 4) )
F ~ dnIID(20, dnNormal(0,1))
Q := fnMutSelAA(fnX3(fnGTR(er, nuc_pi)), F)

See Also