convertPos {ibdsim2} | R Documentation |
Conversion of genetic map positions
Description
Convert between physical position (in megabases) and genetic position (centiMorgan) given a chromosome map. Linear extrapolation is used to convert positions between map points.
Usage
convertPos(
chrom = NULL,
Mb = NULL,
cM = NULL,
map = "decode19",
sex = c("average", "male", "female")
)
Arguments
chrom |
(Optional) A vector of chromosome labels. |
Mb |
A vector of physical positions (in Mb), or NULL. |
cM |
A vector of genetic positions (in cM), or NULL. |
map |
A |
sex |
Either "average", "male" or "female". |
Value
A vector of the same length as the input.
Examples
# Chromosome 1 of the built-in recombination map
map = loadMap(chrom = 1)[[1]]
head(map$male)
# Conversion Mb -> cM
phys = 1:5
gen = convertPos(Mb = phys, map = map, sex = "male")
gen
# Convert back (note the first position, which was outside of map)
convertPos(cM = gen, map = map, sex = "male")
[Package ibdsim2 version 2.0.0 Index]