Learn R Programming

qtl2 (version 0.42)

plot_scan1_heatmap: Heat map of scan1 results with multiple traits

Description

Heat map of multiple scan1 results

Usage

plot_scan1_heatmap(
  x,
  map,
  chr = NULL,
  y = NULL,
  gap = NULL,
  zlim = NULL,
  color_scheme = c("viridis", "gray", "revgray", "heat", "terrain", "topo", "rainbow"),
  col = NULL,
  n_colors = 256,
  swap_axes = FALSE,
  chrlines = NULL,
  rescale_by = c("none", "col", "chr", "both"),
  ...
)

Value

None.

Arguments

x

An object of class "scan1", as output by scan1().

map

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

chr

Selected chromosomes to plot; a vector of character strings.

y

Vector with length equal to ncol(x), defining the y-axis scale of the heat map. (If the multiple LOD scores are for a quantitative variable like time, these are the corresponding times.)

gap

Gap between chromosomes. The default is 1% of the total genome length.

zlim

Z-axis limits (a pair of numbers)

color_scheme

Color scheme for the heatmap (ignored if col is provided).

col

Optional vector of colors for the heatmap.

n_colors

Number of z-axis colors (ignored if col is provided).

swap_axes

If TRUE, put chromosome position on y-axis and lod columns on x-axis (default is to have chromosome position on x-axis and lod columns on y-axis)

chrlines

Color of lines at chromosome breaks (NULL for default choices; NA to skip them).

rescale_by

Rescale the LOD scores by column, chromosome, or both, by subtracting the maximum value. The default is not to rescale.

...

Additional graphics paramaters.

See Also

plot_scan1(), plot_lodpeaks(), graphics::image(); plot_colorscale()

Examples

Run this code
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
map <- insert_pseudomarkers(grav2$gmap, step=1)
probs <- calc_genoprob(grav2, map, error_prob=0.002)
out <- scan1(probs, grav2$pheno)
plot_scan1_heatmap(out, map)

# make the y-axis quantitative
y <- grav2$phenocovar$time
plot_scan1_heatmap(out, map, y=y, ylab=colnames(grav2$phenocovar))

# plot with colors white -> darkslateblue, and with color scale
col <- colorRampPalette(c("white", "darkslateblue"))(256)
zlim <- c(0, maxlod(out))
layout(cbind(1,2), width=c(3,1))
plot_scan1_heatmap(out, map, y=y, ylab=colnames(grav2$phenocovar),
                   col=col, zlim=zlim)
plot_colorscale(col=col, zlim=zlim)

Run the code above in your browser using DataLab