Learn R Programming

Kmisc (version 0.5.0)

manhattan_plot: Make a Manhattan Plot

Description

Generates a manhattan plot (a plot of -log10(p-val)) for a set of markers by chromosome and base-pair position.

Usage

manhattan_plot(pval, bp, chr, groups = NULL, cutoff = NULL, xlab = "Chromosome (base-pair position)", ylab = expression(paste(-log[10](italic(p)))), transform = TRUE, cex = 0.5, ...)

Arguments

pval
A vector of p-values.
bp
A vector of base-pair positions, corresponding to the genomic location for which that p-value is associated (typically, the SNP location).
chr
The chromosomal location associated with the p-value.
groups
A groups vector: used if you want to overlay multiple manhattan plots.
cutoff
optional. By default, a Bonferroni cutoff line is drawn on the plot; if you want to plot a custom cut-off line you can specify the cutoff here.
xlab
The label to use for the x axis.
ylab
The label to use for the y axis.
transform
boolean; if TRUE, we compute -log10(pval); otherwise, we use pval as-is, assuming that pval has been transformed accordingly.
cex
Multiplier for the point size.
...
Optional arguments passed to xyplot.

Examples

Run this code
pval <- runif(1E4)
bp <- c(1:5E3, 1:5E3)
chr <- rep(1:22, length.out=1E4)
groups=rep( c("Phenotype 1", "Phenotype 2"), each=5E3 )
manhattan_plot( pval, bp, chr, groups, main="Two Phenotype MH Plot" )
manhattan_plot( pval, bp, chr, main="Manhattan Plot" )

Run the code above in your browser using DataLab