View source: R/recomb_map_simplify_chr.R
recomb_map_simplify_chr | R Documentation |
Given an input recombination map, this function iteratively removes rows that can be interpolated to less than a given error tol
.
This is a heuristic that works very well in practice, resulting in average interpolation errors well below tol
, and maximum final errors no greater than 3 * tol
in our internal benchmarks (expected in extremely concave or convex regions of the map; final errors are rarely above tol
with few exceptions).
recomb_map_simplify_chr(map, tol = 0.1)
map |
A tibble with two columns: |
tol |
Tolerance of interpolation errors, in cM. |
This function reduces recombination map sizes drastically, in order to include them in packages, and also makes linear interpolation faster. This simplification operation can be justified as the precision of many existing maps is both limited and overstated, and a high accuracy is not needed for simulations with many other approximations in place.
The recombination map with rows (positions) removed (if they are interpolated with errors below tol
in most cases).
recomb_map_fix_ends_chr()
to shift and extrapolate recombination map to ends of chromosome.
library(tibble) # create a toy recombination map to simplify # in this case all middle rows can be interpolated from the ends with practically no error map <- tibble( pos = c( 1L, 1e6L, 2e6L, 3e6L ), posg = c( 0.0, 1.0, 2.0, 3.0 ) ) # simplify map! map_simple <- recomb_map_simplify_chr( map ) # inspect map_simple
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.