an object of class
AssocTestResultRanges,
GenotypeMatrix, or GRanges
y
a character string, GRanges object, or factor
cutoff
significance threshold
which
a character string specifying which p-values to plot;
if “p.value” (default), raw p-values are plotted.
Other options are “p.value.adj” (adjusted p-values),
“p.value.resampled” (resampled p-values), and
“p.value.resampled.adj” (adjusted resampled p-values).
If the requested column is not present in the input object x,
the function stops with an error message.
showEmpty
if FALSE (default), p-values of regions that
did not contain any variants are omitted from the plot.
as.dots
if TRUE, p-values are
plotted as dots/characters in the center of the genomic region.
If FALSE (default), p-values are plotted as lines stretching
from the starts to the ends of the corresponding genomic regions.
pch
plotting character used to plot a single p-value, ignored
if as.dots=FALSE; see points for details.
col
plotting color(s); see details below
scol
color for plotting significant p-values (i.e. the ones
passing the significance threshold)
lcol
color for plotting the significance threshold line
xlab
x axis label; if NULL (default) or NA,
plot makes an automatic choice
ylab
y axis label; if NULL (default) or NA,
plot makes an automatic choice
ylim
y axis limits; if NULL (default) or NA,
plot makes an automatic choice; if user-specified,
ylim must be a two-element numeric vector with the first
element being 0 and the second element being a positive value.
lwd
line thickness; in Manhattan plots, this parameter
corresponds to the thickness of the significance threshold line.
When plotting genotype matrices along with continuous traits, this
is the thickness of the line that corresponds to the trait.
cex
scaling factor for plotting p-values; see
points for details.
labRow,labCol
row and column labels; set to NA to switch
labels off; if NULL, rows are labeled by sample names
(rownames(x)) and columns are labeled by variant names
(names(variantInfo(x))).
cexXaxs,cexYaxs
scaling factors for axes labels
ccol
color of the line that plots the continuous trait along
with a genotype matrix
srt
rotation angle of text labels on horizontal axis
(see text for details); ignored if standard numerical
ticks and labels are used.
adj
adjustment of text labels on horizontal axis
(see text for details); ignored if standard numerical
ticks and labels are used.
alongGenome
plot along the genome or per region (default); see
details below.
type
type of plot; see plot.default for
details. Additionally, the type “r” is available (default)
which plots horizontal lines along the regions of x.
frame.plot
whether or not to frame the plotting area (see
plot; default: TRUE)
...
all other arguments are passed to
plot.
Details
If plot is called for an
AssocTestResultRanges
object without specifying the second argument y,
a so-called Manhattan plot is produced. The x axis corresponds to the
genome on which the AssocTestResultRangesx is based and the y axis shows absolute values of
log-transformed p-values. The which argument determines
which p-value is plotted, i.e. raw p-values, adjusted p-values,
resampled p-values, or adjusted resampled p-values. The cutoff
argument allows for setting a significance threshold above which
p-values are plotted in a different color (see above).
The optional y argument can be used for two purposes: (1) if it is
a character vector containing chromosome names (sequence names), it
can be used for specifying a subset of one or more chromosomes to be
plotted. (2) if y is a GRanges object of length
1 (if longer, plot stops with an error), only the genomic
region corresponding to y is plotted.
The col argument serves for specifying the color for plotting
insignificant p-values (i.e. the ones
above the significance threshold); if the number of colors is
smaller than the number of chromosomes, the vector is recycled.
If col is a single color, all insignificant p-values are
plotted in the same color. If col has two elements (like the
default value), the insignificant p-values of different chromosomes
are plotted with alternating colors. It is also possible to produce
density plots of p-values by using semi-transparent colors (see,
e.g., rgb or hsv for information on how
to use the alpha channel).
If plot is called for a GenotypeMatrix
object x and no y argument, the matrix is visualized in
a heatmap-like fashion, where two major alleles are displayed in white,
two minor alleles are displayed in the color passed as col
argument, and the heterozygotous case (one minor, one major) is
displayed in the color passed as col argument, but with 50%
transparency. The arguments cexYaxs and cexXaxs can be
used to change the scaling of the axis labels.
If plot is called for a GenotypeMatrix
object x and a factor y, then the factor y is
interpreted as a binary trait. In this case, the rows of the genotype
matrix x are reordered such that rows/samples with the same
label are plotted next to each other. Each such group can be plotted in a
different color. For this purpose, a vector of colors can be passed
as col argument.
If plot is called for a GenotypeMatrix
object x and a numeric vector y, then the vector y is
interpreted as a continuous trait. In this case, the rows of the genotype
matrix x are reordered according to the trait vector y
and the genotype matrix is plotted as described above. The trait
y is superimposed in the plot in color ccol and with
line width lwd. If the null model has been trained with
covariates, it also makes sense to plot the genotype against the
null model residuals, since these are exactly the values that the
genotypes were tested against.
If plot is called for a GRanges
object x and a character string y, then plot
checks whether x has a metadata column named y.
If it exists, this column is plotted against the regions in
x. If alongGenome is FALSE (which is the
default), the regions
in x are arranged along the horizontal plot axis
with equal widths and in the same order as contained in x.
If the regions in x are named, then the names are used as
axis labels and the argument cexXaxs can be used to scale the
font size of the names. If alongGenome is TRUE,
the metadata column is plotted against genomic positions. The knots
of the curves are then positioned at the positions given in the
GRanges object x. For types “s”,
“S”, “l”, “p”, “b”, “c”, and
“h”, knots are placed in the middle of the genomic regions
contained in x if they are longer than one base. For type
“r”, regions are plotted as lines exactly stretching between
the start and end coordinates of each region in x.
Value
returns an invisible numeric vector of length 2 containing the
y axis limits