Learn R Programming

qtl (version 1.70)

interpPositions: 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)

Value

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

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.

Author

Karl W Broman, broman@wisc.edu

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.

See Also

shiftmap, rescalemap, pull.map

Examples

Run this code
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)

Run the code above in your browser using DataLab