plot_coef: Plot QTL effects along chromosome

Description Usage Arguments Details Hidden graphics parameters See Also Examples

View source: R/plot_coef.R

Description

Plot estimated QTL effects along a chromosomes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_coef(x, map, columns = NULL, col = NULL, scan1_output = NULL,
  add = FALSE, gap = 25, top_panel_prop = 0.65, legend = NULL, ...)

plot_coefCC(x, map, columns = 1:8, scan1_output = NULL, add = FALSE,
  gap = 25, top_panel_prop = 0.65, legend = NULL, ...)

## S3 method for class 'scan1coef'
plot(x, map, columns = 1, col = NULL,
  scan1_output = NULL, add = FALSE, gap = 25, top_panel_prop = 0.65,
  legend = NULL, ...)

Arguments

x

Estimated QTL effects ("coefficients") as obtained from qtl2scan::scan1coef().

map

A list of vectors of marker positions, as produced by qtl2geno::insert_pseudomarkers().

columns

Vector of columns to plot

col

Vector of colors, same length as columns. If NULL, some default choices are made.

scan1_output

If provided, we make a two-panel plot with coefficients on top and LOD scores below. Should have just one LOD score column; if multiple, only the first is used.

add

If TRUE, add to current plot (must have same map and chromosomes).

gap

Gap between chromosomes.

top_panel_prop

If scan1_output provided, this gives the proportion of the plot that is devoted to the top panel.

legend

Location of legend, such as "bottomleft" or "topright" (NULL for no legend)

...

Additional graphics parameters.

Details

plot_coefCC() is the same as plot_coef(), but forcing columns=1:8 and using the Collaborative Cross colors, CCcolors.

Hidden graphics parameters

A number of graphics parameters can be passed via .... For example, bgcolor to control the background color, and things like ylab and ylim. These are not included as formal parameters in order to avoid cluttering the function definition.

In the case that scan1_output is provided, col, ylab, and ylim all control the panel with estimated QTL effects, while col_lod, ylab_lod, and ylim_lod control the LOD curve panel.

If legend is indicated so that a legend is shown, legend_lab controls the labels in the legend, and legend_ncol indicates the number of columns in the legend.

See Also

CCcolors, plot_scan1(), plot_snpasso()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# load qtl2geno package for data and genoprob calculation
library(qtl2geno)

# read data
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2geno"))

# insert pseudomarkers into map
map <- insert_pseudomarkers(iron$gmap, step=1)

# calculate genotype probabilities
probs <- calc_genoprob(iron, map, error_prob=0.002)

# grab phenotypes and covariates; ensure that covariates have names attribute
pheno <- iron$pheno[,1]
covar <- match(iron$covar$sex, c("f", "m")) # make numeric
names(covar) <- rownames(iron$covar)

# calculate coefficients for chromosome 7
library(qtl2scan)
coef <- scan1coef(probs[,7], pheno, addcovar=covar)

# plot QTL effects (note the need to subset the map object, for chromosome 7)
plot(coef, map[7], columns=1:3, col=c("slateblue", "violetred", "green3"))

rqtl/qtl2plot documentation built on May 28, 2019, 2:36 a.m.