Learn R Programming

jaatha (version 2.7.0)

dm.addMutationRateHeterogenity: Allows the mutation rate on different sites within one locus to vary according to a Gamma Distribution.

Description

This function adds a Gamma distributed rate heterogeneity as implemented in 'seq-gen' to the model.

Usage

dm.addMutationRateHeterogenity(dm, min.alpha, max.alpha, fixed.alpha,
  par.new = T, new.par.name = "alpha", parameter, categories.number)

Arguments

dm
The demographic model to which the rate heterogeneity should be added.
min.alpha
If you want to estimate the rate heterogeneity, this will be used as the smallest possible value.
max.alpha
Same as min.growth.rate, but the largest possible value.
fixed.alpha
If specified, the growth rate will not be estimated, but assumed to have the given value.
par.new
If 'TRUE' a new parameter will be created using the arguments 'min.alpha' and 'max.alpha' or 'fixed.alpha'. It will be named 'new.par.name' If 'FALSE' the argument 'parameter' will be evaluated instead.
new.par.name
Name for the new parameter. occurs. See dm.addSpeciationEvent for more information.
parameter
Instead of creating a new parameter, you can also set the mutation rate to an expression based on existing parameters. For example setting this to "alpha" will use a parameter with name alpha that you have previously created. You can also use R expression
categories.number
If this is set, a fixed number of categories will be used to model the gamma distribution instead of drawing every parameter seperately (see text).

Value

  • The demographic model with a size change.

Details

"The [...] model of rate heterogeneity assigns different rates to different sites according to a gamma distribution (Yang, 1993). The distribution is scaled such that the mean rate for all the sites is 1 but the user must supply a parameter which describes its shape. A low value for this parameter (<1.0) simulates="" a="" large="" degree="" of="" site-specific="" rate="" heterogeneity="" and="" as="" this="" value="" increases="" the="" simulated="" data="" becomes="" more="" rate-homogeneous.="" can="" be="" performed="" continuous="" model,="" i.e.="" every="" site="" has="" different="" sampled="" from="" gamma="" distribution="" given="" shape,="" or="" discrete="" each="" falls="" into="" one="" n="" categories="" approximating="" distribution.="" for="" review="" its="" implications="" phylogenetic="" analyses,="" see="" yang="" (1996)."="" [from="" seq-gen="" homepage="" http:="" bioweb2.pasteur.fr="" docs="" ]<="" p="">

The Parameter in this text will be referred to as 'alpha'. Simulation a model with rate heterogeneity requires that 'seq-gen' is installed on your system.

Examples

Run this code
# A model with one smaller population
dm <- dm.createThetaTauModel(c(20,37), 88)
dm <- dm.setMutationModel(dm, "HKY")
dm <- dm.addMutationRateHeterogenity(dm, 0.1, 5, new.par.name="alpha")

Run the code above in your browser using DataLab