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

lumpedMatrix

Combine alleles in a mutation matrix


Description

Reduce a mutation matrix by combining a set of alleles into one "lump", if this can be done without distorting the mutation process of the remaining alleles. Such "allele lumping" can give dramatic efficiency improvements in likelihood computations with multi-allelic markers, in cases where only some of the alleles are observed in the pedigree.

Usage

lumpedMatrix(mutmat, lump, afreq = attr(mutmat, "afreq"))

Arguments

mutmat

A mutationModel object

lump

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

afreq

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

Value

A reduced mutation model. If the original matrix has dimensions n*n, the result will be k*k, where k = n - length(lump) + 1.

Examples

m = mutationMatrix("eq", alleles = 1:10, rate = 0.1)
afreq = rep(1/100, 100)

# Suppose only alleles 1 and 2 are observed.
# The lumped model is then equivalent to `m`:
mLump = lumpedMatrix(m, afreq = afreq, lump = 3:10)
mLump

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.