r_from_dist: Reverse mapping function

Description Usage Arguments Value Examples

View source: R/pred_IBD.R

Description

Function to calculate recombination frequencies from distance based on three mapping functions. Morgan's, which assumes a linear relationship between distance and recombination frequency (inaccurate for large distances); Haldane's, the most common function, accounting for possible double recombinations between distant markers; and Kosambi's, which accounts for intereference between nearby recombinations. Kosambi's is used by default, as it tends to be the most biologically accurate.

Usage

1
r_from_dist(d, method = "kosambi")

Arguments

d

numeric, distance vector in cM.

method

character, one of the following: kosambi, haldane, morgan. Partial matching is allowed.

Value

a numeric vector of recombination frequencies.

Examples

1
2
3
4
5
6
7
8
9
d <- 1:100
kos <- r_from_dist(d, method = "k")
hal <- r_from_dist(d, method = "h")
mor <- r_from_dist(d, method = "m")

plot(d,mor,ylim = range(c(kos,hal,mor)),type = "l", col = 1)
points(d,hal,type = "l", col = 2)
points(d, kos, type = "l",col = 3)
legend("topright", legend = c("Morgan","Haldane","Kosambi"),col = 1:3,lty = 1)

Alethere/SmoothDescent documentation built on Jan. 14, 2022, 9:40 p.m.