Description Usage Arguments Details Value Examples
View source: R/general_cline_eqn.R
A flexible function to evaluate hybrid zone genetic cline equations, with or without introgression tails.
1 2 3 |
transectDist |
The position(s) at which to evaluate the cline equation. Must be a numeric vector. |
decrease |
Is the cline decreasing in frequency? |
center |
The location of the cline center, in the same distance units as
|
width |
The width of the cline, in the same distance units as
|
pmin, pmax |
Optional. The minimum and maximum allele frequency values in
the tails of the cline. Default values are |
deltaL, tauL |
Optional delta and tau parameters which describe the left
exponential introgression tail. Must supply both to generate a tail. Default is
|
deltaR, tauR |
Optional delta and tau parameters which describe the right
exponential introgression tail. Must supply both to generate a tail. Default is
|
This function evaluates hybrid zone cline equations of the general form:
p = (e^(4*((x-center))/(width))/((1+ e^(4*((x-center))/(wwidth)))
Where center is the center of the cline, width is the width of the cline, x is the distance along the transect, and p is the expected frequency of the allele.
This function can also include introgression tails by specifying delta and tau paramters. For the left introgression tail, when x ≤ (center - δ):
p = 1/(1 + e^(4(δ)/(w)))*\exp((4τ(x-c+δ)/width)/(1+e^(-4(δ)/(w))))
For the right introgression tail, when x ≥ (center + δ):
p = 1- 1/(1 + e^(4(δ)/(w)))*\exp((-4τ(x-c-δ)/width)/(1+e^(-4(δ)/(w))))
The above equations all describe an increasing cline with minimum and maximum values of 0 and 1. This equation can be rescaled for other minima and maxima:
p' = p_{min} + (p_{max} - p_{min})*p
And for clines which decrease in frequency:
p' = p_{min} + (p_{max} - p_{min})*(1-p)
The function will automatically use the appropriate equation based on arguments supplied by the user.
The result of evaluating a cline equation with the specified parameters at the specified distance(s) (that is, p' in the notation of the equations above). A numeric vector equal in length to the transectDist argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# Calculate the allele frequency at x = 100 for an increasing cline
# with a center at x = 125, a width of 40, and no tails.
general_cline_eqn(transectDist = 100, decrease = F,
center = 125, width = 40)
# Calculate the allele frequency at x = 84 and x = 100 for a decreasing cline
# with a center at 76, a width of 22, and a right tail
# with deltaR = 7.5, tauR = 0.45.
general_cline_eqn(transectDist = c(84,100), decrease = TRUE,
center = 76, width = 22,
deltaR = 7.5, tauR = .45)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.