EWAS_plots: Manhattan and Quantile-Quantile plots for EWAS results files

View source: R/script_v12-3_package.R

EWAS_plotsR Documentation

Manhattan and Quantile-Quantile plots for EWAS results files

Description

This function is used by EWAS_QC to generate quantile-quantile (QQ) and Manhattan plots. It can also be called by users. Note that it does not generate the histogram or volcano plot - this is done by EWAS_QC itself.

Usage

  EWAS_plots(dataset,
             plot_QQ = TRUE,
             plot_Man = TRUE,
             plot_cutoff_p = 0.05,
             plot_QQ_bands = FALSE,
             high_quality_plots = FALSE,
             save_name = "dataset",
             header_translations)

Arguments

dataset

either a vector of p-values, or a data frame containing the columns CHR (chromosome number), MAPINFO (base-pair position), and P_VAL (p-value). If different columnnames are used, the header_translations argument can be used to translate these. CHR and MAPINFO are only required for generating a Manhattan plot. Note that, unlike EWAS_QC, this function does not accept filenames, only data frames or vectors.

plot_QQ, plot_Man

logicals determining whether a QQ and Manhattan plot are made.

plot_cutoff_p

numeric: the threshold of p-values to be shown in the QQ and Manhattan plots. Higher (less significant) p-values are excluded from the plot. The default setting is 0.05, which excludes 95% of data-points. It's NOT recommended to increase the value above 0.05, as this may dramatically increase running time and memory usage.

plot_QQ_bands

logical, if TRUE, probability bands are added to the QQ plot.

high_quality_plots

logical. Setting this to TRUE will save the graphs as high-resolution tiff images.

save_name

character string, the name used for the plot files (do not add an extension: EWAS_plots will do this automatically).

header_translations

a table that translates the column names of dataset to the standard names. See translate_header for details.

Details

EWAS_plots is a fairly straightforward function. It accepts a data table or a vector of p-values, and generates QQ and (when chromosome and position data are included) Manhattan plots from these.

Value

EWAS_plots' most important output are the two graphs. However, it also returns a single, invisible, numeric value, representing the lambda calculated over the p-values.


QCEWAS documentation built on Feb. 16, 2023, 10:30 p.m.