plotQTLStats: Plots different paramaters for QTL identification

Description Usage Arguments Value Examples

View source: R/plotting_functions.R

Description

A wrapper for ggplot to plot genome wide distribution of parameters used to identify QTL.

Usage

1
2
3
plotQTLStats(SNPset, subset = NULL, var = "nSNPs",
  scaleChroms = TRUE, line = TRUE, plotThreshold = FALSE,
  plotIntervals = FALSE, q = 0.05, ...)

Arguments

SNPset

a data frame with SNPs and genotype fields as imported by ImportFromGATK and after running runGprimeAnalysis or runQTLseqAnalysis

subset

a vector of chromosome names for use in quick plotting of chromosomes of interest. Defaults to NULL and will plot all chromosomes in the SNPset

var

character. The paramater for plotting. Must be one of: "nSNPs", "deltaSNP", "Gprime", "negLog10Pval"

scaleChroms

boolean. if TRUE (default) then chromosome facets will be scaled to relative chromosome sizes. If FALSE all facets will be equal sizes. This is basically a convenience argument for setting both scales and shape as "free_x" in ggplot2::facet_grid.

line

boolean. If TRUE will plot line graph. If FALSE will plot points. Plotting points will take more time.

plotThreshold

boolean. Should we plot the False Discovery Rate threshold (FDR). Only plots line if var is "Gprime" or "negLogPval".

plotIntervals

boolean. Whether or not to plot the two-sided Takagi confidence intervals in "deltaSNP" plots.

q

numeric. The q-value to use as the FDR threshold. If too low, no line will be drawn and a warning will be given.

...

arguments to pass to ggplot2::geom_line or ggplot2::geom_point for changing colors etc.

Value

Plots a ggplot graph for all chromosomes or those requested in subset. By setting var to "nSNPs" the distribution of SNPs used to calculate G' will be plotted. "deltaSNP" will plot a tri-cube weighted delta SNP-index for each SNP. "Gprime" will plot the tri-cube weighted G' value. Setting "negLogPval" will plot the -log10 of the p-value at each SNP. In "Gprime" and "negLogPval" plots, a genome wide FDR threshold of q can be drawn by setting "plotThreshold" to TRUE. The defualt is a red line. If you would like to plot a different line we suggest setting "plotThreshold" to FALSE and manually adding a line using ggplot2::geom_hline.

Examples

1
p <- plotQTLstats(df_filt_6Mb, var = "Gprime", plotThreshold = TRUE, q = 0.01, subset = c("Chr3","Chr4"))

bmansfeld/QTLseqr documentation built on Jan. 24, 2020, 3:56 p.m.