interpPositions: Interpolate positions from one map to another

View source: R/interpPositions.R

interpPositionsR Documentation

Interpolate positions from one map to another

Description

On the basis of a pair of marker maps with common markers, take positions along one map and interpolate (or, past the terminal markers on a chromosome, extrapolate) their positions on the second map.

Usage

interpPositions(oldpositions, oldmap, newmap)

Arguments

oldpositions

A data frame with two columns: chr (chromosome identifiers) and pos (positions, along oldmap).

oldmap

An object of class "map"; see sim.map for details.

newmap

An object of class "map", with the same chromosomes and markers as oldmap.

Details

In this explanation, take oldmap and newmap to be the physical and genetic maps, respectively.

We use linear interpolation within each interval, assuming a constant recombination rate within the interval. Past the terminal markers, we use linear extrapolation, using the chromosome-wide average recombination rate.

Value

The input data frame, oldpositions, with an additional column newpos with the interpolated positions along newmap.

Author(s)

Karl W Broman, broman@wisc.edu

See Also

shiftmap, rescalemap, pull.map

Examples

data(hyper)

# hyper genetic map
gmap <- pull.map(hyper)

# a fake physical map, with each chromosome starting at 0.
pmap <- shiftmap(rescalemap(gmap, 2))

# positions on pmap to determine location on gmap
tofind <- data.frame(chr=c(1, 5, 17, "X"), pos=c(220, 20, 105, 10))
rownames(tofind) <- paste("loc", 1:nrow(tofind), sep="")

interpPositions(tofind, pmap, gmap)

qtl documentation built on Sept. 11, 2024, 5:43 p.m.