Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model_properties

Mutation model properties


Description

Functions for checking various properties of a mutation model, including stationarity, reversibility and lumpability.

Usage

isStationary(mutmat, afreq)

isReversible(mutmat, afreq)

isLumpable(mutmat, lump)

alwaysLumpable(mutmat)

Arguments

mutmat

A mutation matrix

afreq

A vector with frequency vector, of the same length as the size of mutmat

lump

A nonempty subset of the colnames of mutmat (i.e. the allele labels)

Value

Each of these functions returns TRUE of FALSE

Examples

# "proportional" models are stationary and reversible
afr = c(0.2, 0.3, 0.5)
m_prop = mutationMatrix(model = "prop", alleles = 1:3, afreq = afr, rate = 0.1)
stopifnot(isStationary(m_prop, afr), isReversible(m_prop, afr))

# "equal" model is stationary and reversible only when freqs are equal
m_eq = mutationMatrix(model = "eq", alleles = 1:3, rate = 0.1)
stopifnot(isStationary(m_eq, rep(1/3, 3)), isReversible(m_eq, rep(1/3, 3)))
stopifnot(!isStationary(m_eq, afr), !isReversible(m_eq, afr))

# "equal" and "proportional" models allow allele lumping
stopifnot(isLumpable(m_eq, lump = 1:2))
stopifnot(isLumpable(m_prop, lump = 1:2))

# In fact lumpable for any allele subset
stopifnot(alwaysLumpable(m_eq), alwaysLumpable(m_prop))

pedmut

Mutation Models for Pedigree Likelihood Computations

v0.2.0
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.