For a more detailed explanation, see vignette("sub-models").

sub_TN93(pi_tcag, alpha_1, alpha_2, beta)

sub_JC69(lambda)

sub_K80(alpha, beta)

sub_F81(pi_tcag)

sub_HKY85(pi_tcag, alpha, beta)

sub_F84(pi_tcag, beta, kappa)

sub_GTR(pi_tcag, abcdef)

sub_UNREST(Q)

## Arguments

pi_tcag Vector of length 4 indicating the equilibrium distributions of T, C, A, and G respectively. Values must be >= 0, and they are forced to sum to 1. Substitution rate for T <-> C transition. Substitution rate for A <-> G transition. Substitution rate for transversions. Substitution rate for all possible substitutions. Substitution rate for transitions. The transition/transversion rate ratio. A vector of length 6 that contains the off-diagonal elements for the substitution rate matrix. See vignette("sub-models") for how the values are ordered in the matrix. Matrix of substitution rates for "T", "C", "A", and "G", respectively. Item Q[i,j] is the rate of substitution from nucleotide i to nucleotide j. Do not include indel rates here! Values on the diagonal are calculated inside the function so are ignored.

## Value

A sub_model_info object, which is just a wrapper around a list with fields Q and pi_tcag. The former has the rate matrix, and the latter has the equilibrium nucleotide densities for "T", "C", "A", and "G", respectively. Access the rate matrix for a sub_model_info object named x via x$Q and densities via x$pi_tcag.

## Functions

• sub_TN93: TN93 model.

• sub_JC69: JC69 model.

• sub_K80: K80 model.

• sub_F81: F81 model.

• sub_HKY85: HKY85 model.

• sub_F84: F84 model.

• sub_GTR: GTR model.

• sub_UNREST: UNREST model.

create_variants

## Examples

# Same substitution rate for all types:
Q_JC69 <- sub_JC69(lambda = 0.1)

# Transitions 2x more likely than transversions:
Q_K80 <- sub_K80(alpha = 0.2, beta = 0.1)

# Same as above, but incorporating equilibrium frequencies
sub_HKY85(pi_tcag = c(0.1, 0.2, 0.3, 0.4),
alpha = 0.2, beta = 0.1)#> < Substitution information >
#> # Equilibrium densities:
#>    0.1000 0.2000 0.3000 0.4000
#> # Substitution rate matrix:
#>         T    C    A    G
#>    T 0.00 0.04 0.03 0.04
#>    C 0.02 0.00 0.03 0.04
#>    A 0.01 0.02 0.00 0.08
#>    G 0.01 0.02 0.06 0.00
#> (View rate matrix in the "Q" field)
#> (View equil. densities in the "pi_tcag" field)