Learn R Programming

gap (version 1.5-1)

mhtplot2: Manhattan plot with annotations

Description

To generate Manhattan plot with annotations. The function is generic and for instance could be used for genomewide p values or any random variable that is uniformly distributed. By default, a log10-transformation is applied. Note that with real chromosomal positions, it is also appropriate to plot and some but not all chromosomes.

Usage

mhtplot2(data, control = mht.control(), hcontrol = hmht.control(), ...)

Value

The plot is shown on or saved to the appropriate device.

Arguments

data

a data frame with three columns representing chromosome, position and p values.

control

A control function named mht.control() with the following arguments.

  • type a flag with value "p" or "l" indicating if points or lines are to be drawn.

  • usepos a flag to use real chromosomal positions as composed to ordinal positions with default value FALSE

  • logscale a flag to indicate if p value is to be log-transformed with default value TRUE

  • base the base of the logarithm with default value 10

  • cutoffs the cut-offs where horizontal line(s) are drawn with default value NULL

  • colors the color for different chromosome(s), and random if unspecified with default values NULL

  • labels labels for the ticks on x-axis with default value NULL

  • srt degree to which labels are rotated with default value of 45

  • gap gap between chromosomes with default value NULL

  • cex cex for the data points

  • yline Margin line position

  • xline Margin line position

hcontrol

A control function named hmht.control() with the following arguments.

  • data chunk of data to be highlighted with default value NULL

  • colors colors for annotated genes

  • yoffset offset above the data point showing most significant p value with default value 0.5

  • cex shrinkage factor for data points with default value 1.5

  • boxed if the label for the highlited region with default value FALSE

...

other options in compatible with the R plot function.

Author

Jing Hua Zhao

Details

It is possible to specify options such as xlab, ylim and font family when the plot is requested for data in other context.

To maintain back compatibility options as in mhtplot are used. The positions of the horizontal labels are now in the middle rather than at the beginning of their bands in the plot.

References

den Hoed M, et al. (2013). Heart rate-associated loci and their effects on cardiac conduction and rhythm disorders. Nat Genet 45:621-631.