qqPlot | R Documentation |
Generates a Quantile-Quantile plot for -log10 p-values from genome wide association tests.
qqPlot(pval, truncate = FALSE, ylim = NULL, thinThreshold = NULL, ci=TRUE, ...)
pval |
Vector of p-values |
truncate |
Either a logical value indicating whether the y-axis should be truncted to the same range as the x-axis, or a numeric value indicating where to truncate the y-axis. See details. |
ylim |
Limits for the y axis. Ignored if |
thinThreshold |
if not |
ci |
logical indicator for whether to add confidence intervals to plots? |
... |
Other parameters to be passed directly to |
The function generates a Quantile-Quantile plot of p-values on a -log10
scale, with the option of truncating the y-axis to the range of the
x-axis (0, -log10(1/length(pval))
. If the y-axis is truncated,
then points off the top of the plot are denoted by triangles at the upper edge.
The 95% confidence interval is shaded in gray.
If truncate is set to a numeric value, then ylim
is set to c(0, truncate)
only if the value of truncate is bigger than the maximum -log10(pval)
. (Use the ylim
argument if alternatve behavior is desired.)
If requested with thinThreshold
, points with p-values < -log10(thinThreshold)
are thinned before plotting. All points with -log10(pval) >= thinThreshold
plus 10,000 points with -log10(pval) < thinThreshold
(randomly selected in uniformly-spaced bins of -log10(pval)) are displayed.
Cathy Laurie, Matthew P. Conomos, Adrienne Stilp
pvals <- seq(0, 1, 0.001)
qqPlot(pvals)
qqPlot(pvals, thinThreshold=2)
qqPlot(pvals, truncate=TRUE)
qqPlot(pvals, truncate=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.