segmentsOnMap: Visualize the positions of QTL on a genetic map.

Description Usage Arguments Details Value Examples

Description

segmentsOnMap A basic function to plot QTL confidence intervals. Useful for <20 traits.

Usage

1
2
3
4
5
6
segmentsOnMap(cross, phe, chr, l, h, peaklod = NA, peakcM = NA,
  calcCisResults = NULL, legendPosition = "bottom", legendCex = 0.8,
  col = NULL, palette = highContrastColors, lwd = "byLod",
  leg.lwd = 2, max.lwd = 5, min.lwd = 1, tick.width = NULL,
  leg.inset = 0.01, chrBuffer = c(0.05, 0.15), orderBy = "lod",
  showPeaks = FALSE, ...)

Arguments

cross

The qtl cross object with marker names that need to be changed.

phe

Character or numeric vector indicating the phenotype to be tested

chr

Vector of chromosome ids - will be coerced to numeric

l

The lower confidence interval bound for each qtl

h

The upper confidence interval bound for each qtl

peaklod

Optional - if provided, permits segments width to be weighted by significance.

peakcM

Optional - the position of the peak

calcCisResults

A shortcut that allows results from calcCis to be piped directly into the plotting function. If provided, l, h, chr, phe and peaklod are ignored

legendPosition

Where to place the legend. This is passed to the first argument of the legend function. See legend documentation

legendCex

The character expansion for the legend. This is passed to the cex argument of legend.

col

Optional. A vector of colors for segments

palette

Optional. A color palette with which to draw segment colors

lwd

Either the specification "byLod", where segment weights are calculated from LOD score data, or a numeric vector of length 1 that is passed to segments lwd

leg.lwd

The lineweights of the legend.

max.lwd

If scaling by LOD, what should the maximum lwd be?

min.lwd

If scaling by LOD, what should the minimum lwd be?

tick.width

How wide should the ticks be? Defaults to 1/n chromosomes.

leg.inset

How far should the legend be away from the plot border?

chrBuffer

Numeric vector of length 2, specifying the buffer space between confidence interval segments on the left and right adjacent chromosomes.

orderBy

What data should the segments be stacked by?

showPeaks

Logical, should the QTL peaks be plotted as points?

...

Other arguments passed to segments

Details

Pass output from bayesint, lodint, or another confidence interval estimation program to visualize this.

Value

The plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
library(qtlTools)
data(multitrait)
segmentsOnMap(cross = multitrait, phe = paste0("phe",1:15),
 chr = rep(1,15), l =seq(from = 1, to = 100, length.out = 15),
 h =seq(from = 20, to = 120, length.out = 15))
segmentsOnMap(cross = multitrait, phe = paste0("phe",1:25),
 chr = rep(1,25), l =seq(from = 1, to = 100, length.out = 25),
 h =seq(from = 20, to = 120, length.out = 25))
## Not run: 
# use multitrait data
cross <- multitrait
cross <- calc.genoprob(cross)
phes <- phenames(cross)[1:20]
# Conduct scanone and permutations to get confidence intervals
s1 <- scanone(cross, pheno.col = phes, method = "hk")
perms <- scanone(cross, pheno.col = phes, method = "hk",
   n.perm = 100, verbose=F)
cis<-calcCis(cross, s1.output = s1, perm.output = perms)

# manual construction of the confidence intervals
with(cis, segmentsOnMap(cross, phe = pheno, chr = chr,
   l = lowposition, h = highposition, legendCex = .5,
   peakcM = pos,
   tick.width = .1,  chrBuffer = c(.15,.2)))
with(cis, segmentsOnMap(cross, phe = pheno, chr = chr,
   l = lowposition, h = highposition, legendCex = .5,
   tick.width = .1,  chrBuffer = c(.15,.2)))

# feed calcCis directly into the plot
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5)
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5,
   col = terrain.colors(length(unique(cis$phe))))
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5,
   max.lwd=6, min.lwd=.5)
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5,
   max.lwd=4, min.lwd=2)
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5,
   lwd = 2)
segmentsOnMap(cross, calcCisResults = cis, legendCex = .5,
   palette = rainbow)

## End(Not run)

jtlovell/qtlTools documentation built on May 20, 2019, 3:14 a.m.