Learn R Programming

GWASinspector (version 1.4.3)

manhattan.plot: Creates the Manhattan plot

Description

A function to generate Manhattan plots.

Usage

manhattan.plot(dataset, chr, pvalue, position, fileName,
  plot.title = "Manhattan Plot", plot.subtitle = "",
  p.threshold = 0.01, sig.threshold.log = -log10(5 * 10^-8),
  beta = NULL, std.error = NULL, check.columns = TRUE)

Arguments

dataset

Data frame or data table containing the below columns

chr

Name of chromosome column

pvalue

Name of P-value column

position

Name of position column

fileName

Full name and path of file to be saved (file extension should be 'png'). e.g. <U+201C>c:/users/researcher/study/man_plot.png<U+201D>

plot.title

Title of the plot, default value is 'Manhattan plot'

plot.subtitle

Subtitle of the plot

p.threshold

Threshold for plotting variants (i.e. p-values > 0.01 will not be plotted). Setting a higher threshold will significantly increase plotting time

sig.threshold.log

The -log10 transformed significance threshold, used for plotting a threshold line (e.g. 8 = 10^-8)

beta

(optional) Name of the effect-size column

std.error

(optional) Name of the standard error column

check.columns

Whether to check input columns for invalid values

Value

Generates and saves a Manhattan plot for the provided data.

Examples

Run this code
# NOT RUN {
input.data = read.table(gzfile(system.file("extdata", "demo.txt.gz", package = "GWASinspector")),
                        header = TRUE,
                        stringsAsFactors = FALSE,
                        fill = TRUE)
tmpPlotFile = paste(tempfile(),'png',sep = '.')
manhattan.plot(dataset = input.data, chr = 'CHR', pvalue = 'PVALUE', position = 'POSITION',
         plot.title = 'Manhattan plot', plot.subtitle = 'This data is fabricated!',
         fileName = tmpPlotFile , p.threshold = '0.5')

# }

Run the code above in your browser using DataLab