Learn R Programming

qtl (version 1.70)

xaxisloc.scanone: Get x-axis locations in scanone plot

Description

Get x-axis locations for given cM positions on given chromosomes in a plot from plot.scanone)

Usage

xaxisloc.scanone(out, thechr, thepos, chr, gap=25)

Value

A numeric vector of x-axis locations.

Arguments

out

An object of class "scanone", as output by scanone. This must be identical to what was used in the call to plot.scanone.

thechr

Chromosome IDs at which x-axis locations are to be determined.

thepos

Chromosome positions at which x-axis locations are to be determined.

chr

Optional vector specifying which chromosomes were plotted. This must be identical to what was used in the call to plot.scanone.

gap

Gap separating chromosomes (in cM). This must be identical to what was used in the call to plot.scanone.

Author

Karl W Broman, broman@wisc.edu

Details

This function allows you to identify the x-axis locations in a plot of genome scan results, produced by plot.scanone. This is useful for adding annotations, such as text or arrows.

The arguments out, chr, and gap must match what was used in the call to plot.scanone.

The arguments thechr and thepos indicate the genomic positions for which x-axis locations are desired. If they both have length > 1, they must have the same length. If one has length > 1 and one has length 1, the one with length 1 is expanded to match.

See Also

plot.scanone, add.threshold

Examples

Run this code
data(hyper)
hyper <- subset(hyper, c(1,4,6,15))
hyper <- calc.genoprob(hyper)
out <- scanone(hyper, method="hk")
plot(out, chr=c(1, 4, 6, 15))

# add arrow and text to indicate peak LOD score
mxout <- max(out)
x <- xaxisloc.scanone(out, mxout$chr, mxout$pos, chr=c(1,4,6,15))
arrows(x+30, mxout$lod, x+5, mxout$lod, len=0.1, col="blue")
text(x+35, mxout$lod, "the peak", col="blue", adj=c(0, 0.5))

Run the code above in your browser using DataLab