manhattanPlot: Manhattan plot for genome wide association tests

Description Usage Arguments Details Author(s) See Also Examples

View source: R/manhattanPlot.R

Description

Generates a manhattan plot of the results of a genome wide association test.

Usage

1
2
3
manhattanPlot(p, chromosome, 
              ylim = NULL, trunc.lines = TRUE,
              signif = 5e-8, thinThreshold=NULL, pointsPerBin=10000, col=NULL, ...)

Arguments

p

A vector of p-values.

chromosome

A vector containing the chromosome for each SNP.

ylim

The limits of the y axis. If NULL, the y axis is (0, log10(length(p)) + 4).

trunc.lines

Logical value indicating whether to show truncation lines.

signif

Genome-wide significance level for plotting horizontal line. If signif=NULL, no line will be drawn.

thinThreshold

if not NULL, -log10(pval) threshold for thinning points.

pointsPerBin

number of points to plot in each bin if thinThreshold is given. Ignored otherwise.

col

vector containing colors of points; defaults to coloring by chromosome using the colorbrewer Dark2 palette with 8 colors

...

Other parameters to be passed directly to plot.

Details

Plots -log10(p) versus chromosome. Point size is scaled so that smaller p values have larger points.

p must have the same length as chromosome and is assumed to be in order of position on each chromosome. Values within each chromosome are evenly spaced along the X axis.

Plot limits are determined as follows: if ylim is provided, any points with -log10(p) > ylim[2] are plotted as triangles at the maximum y value of the plot. A line will be drawn to indicate trunctation (if trunc.lines == TRUE, the default). If ylim == NULL, the maximum y value is defined as log10(length(p)) + 4).

If requested with thinThreshold, points with -log10(pval) < thinThreshold are thinned before plotting. All points with -log10(pval) >= thinThreshold are displayed. P-values with -log10(pval) < thinThreshold are sampled such that pointsPerBin points are randomly selected from 10 bins with uniform spacing in -log10(pval) space.

Author(s)

Cathy Laurie, Adrienne Stilp

See Also

snpCorrelationPlot

Examples

1
2
3
4
5
n <- 1000
pvals <- sample(-log10((1:n)/n), n, replace=TRUE)
chromosome <- c(rep(1,400), rep(2,350), rep("X",200), rep("Y",50))
manhattanPlot(pvals, chromosome, signif=1e-7)
manhattanPlot(pvals, chromosome, thinThreshold=2)

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

GWASTools documentation built on Nov. 8, 2020, 7:49 p.m.