Learn R Programming

qtl2 (version 0.42)

plot_cistrans: cis-trans plot for eQTL results

Description

Scatterplot of gene location vs QTL location to display eQTL/pQTL results

Usage

plot_cistrans(
  peaks,
  map,
  pheno_pos,
  gap = 0,
  cis_window = 1,
  pch = 21,
  col = "slateblue",
  bg = "slateblue",
  cex = 0.8,
  pch_cis = 21,
  col_cis = "violetred",
  bg_cis = "violetred",
  cex_cis = 0.8,
  pty = "s",
  bgcolor = "gray90",
  altbgcolor = "gray80",
  ...
)

Value

Invisibly returns a data frame with peaks merged with pheno_pos, with an additional column cis that indicates which QTL appear to be cis (vs trans).

Arguments

peaks

Data frame of QTL results, as output by find_peaks() Should contain columns lodcolumn, chr, and pos.

map

Marker map, as a list of chromosomes, each being a vector of positions; used to get chromosome names and start/end

pheno_pos

Data frame with chromosome, position, and name of the phenotypes in peaks. Should contain columns pheno, chr, and pos.

gap

Gap between chromosomes in the plot

cis_window

Window size that defines cis-QTL (on same chromosome, and position of gene within this distance of QTL position)

pch

Point type for "trans" points

col

Point color for "trans" points

bg

Background color for "trans" points

cex

Character expansion size for "trans" points

pch_cis

Point type for "cis" points

col_cis

Point color for "cis" points

bg_cis

Background color for "cis" points

cex_cis

Character expansion size for "cis" points

pty

Plot type; the default "s" forces a square plot; use "m" to use the maximal plotting region.

bgcolor

Background color for chromosome rectangles

altbgcolor

Alternate background color for chromosome rectangles

...

Additional graphics arguments passed to graphics::points()

See Also

plot_scan1(), find_peaks(), plot_lodpeaks()

Examples

Run this code
if (FALSE) {
# download example pQTL results (from Keele et al. 2026, https://doi.org/10.1016/j.xgen.2025.101069)
# contains qtl, map, and pheno_pos
url <- "https://kbroman.org/qtl2/assets/sampledata/pqtl_data.RData"
tempfile <- file.path(tempdir(), basename(url))
download.file(url, tempfile)
load(tempfile)
unlink(tempfile)

plot_cistrans(qtl, map, pheno_pos, cis_window=5)
}

Run the code above in your browser using DataLab