Rev Language Reference


fnFMutSel0 - The FMutSel0 model

Constructs a rate matrix from 61 scaled selection coefficients w[i] and a 4x4 nucleotide mutation rate matrix mu(i,j). In the original paper the nucleotide mutation rate matrix is a GTR rate matrix. The FMutSel0 model is a restriction of the FMutSel model that constrains all codons for the same amino acid to have the same scaled selection coefficient. The function fnMutSelAA differs from fnFMutSel0 by taking a codon mutation rate matrix. 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

fnFMutSel0(RateMatrix submodel, Real[] fitnesses, RealPos omega)

Arguments

submodel : RateMatrix (pass by const reference)
Nucleotide mutation rate matrix.
fitnesses : Real[] (pass by const reference)
Scaled selection coefficients 2Ns for 20 amino acids.
omega : RealPos (pass by const reference)
The dN / dS rate ratio.

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))
omega ~ dnUniform(0,1)
# The FMutSel0 model from Yang and Nielsen (2008)
Q1 := fnFMutSel0(fnGTR(er, nuc_pi), F, omega)

# The same -- fMutSel0 = GTR(er,nuc_pi) + X3 + MutSel(F) + dNdS(omega)
Q2 := fndNdS( fnMutSelAA( fnX3( fnGTR(er, nuc_pi)), F), omega)

See Also