Learn R Programming

pedmut (version 0.8.0)

adjustRate: Adjust the overall mutation rate of a model

Description

Adjusts the overall mutation rate of a model by scaling the off-diagonal matrix entries.

Usage

adjustRate(mutmat, newrate, afreq = NULL, rate = NULL)

Value

A new mutation matrix with the adjusted rate.

Arguments

mutmat

A mutation matrix with nonzero mutation overall rate.

newrate

The new overall mutation rate.

afreq

The allele frequencies. Extracted from the mutation matrix if not provided.

rate

The current overall mutation rate. Calculated from the input if not provided.

Details

The adjusted matrix is calculated as a * M + (1-a) * I, where M is the original matrix, a = newrate/rate, and I is the identity matrix.

The maximum allowed value of newrate (to avoid negative values in the adjusted matrix) is rate/(1 - m)), where m is the smallest diagonal element in the original matrix.

See Also

mutRate()

Examples

Run this code
m = mutationMatrix("equal", afreq = c(a=0.2, b=0.3, c=0.5), rate = 0.2)
m
adjustRate(m, 0.4)

Run the code above in your browser using DataLab