r_from_dist: Reverse mapping function

View source: R/pred_IBD.R

r_from_distR Documentation

Reverse mapping function

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

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

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 May 12, 2024, 5:11 p.m.