qqplot.pvalues {milorGWAS}R Documentation

Stratified QQ-plot of p-values

Description

Draws a QQ plot of p-values

Usage

qqplot.pvalues(
  p,
  snp.cat,
  col.cat,
  col.abline = "red",
  CB = TRUE,
  col.CB = "gray80",
  CB.level = 0.95,
  thinning = TRUE,
  ...
)

Arguments

p

vector of p-values, or a data.frame with a column named p

snp.cat

(optional) A factor giving the SNP categories.

col.cat

(optional) A vector of colors used to plot the SNP categories.

col.abline

Color of the line of slope 1. Set to NA to suppress.

CB

Logical. If TRUE, a confidence band is included in the plot.

col.CB

The color of the confidence band.

CB.level

The level of the confidence band.

thinning

Logical. If TRUE, not all points are displayed.

...

Graphical parameters to be passed to plot and points

Details

This function draws a QQ plot of p-values, stratified by categories. If the parameter snp.cat is missing, the function falls back on gaston::qqplot.pvalues.

Value

Returns a 'NULL'

See Also

SNP.category, qqplot.pvalues (in gaston)

Examples

# a random vector of categories
ca <- sample(c("A","B","C"), 1e6, TRUE, c(0.05, 0.9, 0.05))
# a vector of p-values, with different distribution depending on the strata
p <- runif(1e6)**ifelse(ca == "A", .8, ifelse(ca == "B", 1, 1.2))
qqplot.pvalues(p, ca)


[Package milorGWAS version 0.7 Index]