View source: R/interpPositions.R
interpPositions | R Documentation |
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.
interpPositions(oldpositions, oldmap, newmap)
oldpositions |
A data frame with two columns: |
oldmap |
An object of class |
newmap |
An object of class |
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.
The input data frame, oldpositions
, with an additional
column newpos
with the interpolated positions along
newmap
.
Karl W Broman, broman@wisc.edu
shiftmap
, rescalemap
, pull.map
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.