Learn R Programming

jaatha (version 2.7.0)

dm.addRecombination: Adds recombination events to a demographic model

Description

This function add the assumption to the model that recombination events may occur within each locus. The corresponding parameter - usually name rho - equals 4*N0*r, where r is the probability that a recombination event within the locus will occur in one generation. Even when using an infinite sites mutation model, this assumes an finite locus length which is given by the 'seq.length' parameter of the demographic model.

Usage

dm.addRecombination(dm, lower.range, upper.range, fixed.value, par.new = T,
  new.par.name = "rho", parameter, group = 0, variance = 0)

Arguments

dm
The demographic model to which recombination events should be added.
lower.range
If you want to estimate the recombination rate (see note
upper.range
Same as lower.range, but the largest possible value.
fixed.value
If specified, the mutation 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 'lower.range' and 'upper.range' or 'fixed.value'. It will be named 'new.par.name'. If 'FALSE' the argument 'parameter' will be evaluated instead.
new.par.name
The name for the new parameter.
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 "rho" will use an parameter with name theta that you have previously created. You can also use R expression
group
Group of loci for with this feature is added. 0 means that the feature applies to all groups, and 1 is the default group. Set to 1 or an greater integer to set this feature only for the corresponding group of loci.
variance
Set to a value different from 0 to introduce variation in the the parameter value for different loci. The variation follows a gamma distribution with mean equal to the value provided as parameter, and variance as given here. Can also be set t

Value

  • The demographic model with recombination

Details

Please note that it does not make sense to estimate recombination rates with Jaatha because it assumes unlinked loci.

Examples

Run this code
dm <- dm.createDemographicModel(c(25,25), 100)
dm <- dm.addSpeciationEvent(dm, 0.01, 5)
dm <- dm.addRecombination(dm, fixed=20)
dm <- dm.addMutation(dm, 1, 20)

Run the code above in your browser using DataLab