plotGprimeDist: Plots Gprime distribution

Description Usage Arguments Value See Also Examples

View source: R/plotting_functions.R

Description

Plots a ggplot histogram of the distribution of Gprime with a log normal distribution overlay

Usage

1
2
plotGprimeDist(SNPset, outlierFilter = c("deltaSNP", "Hampel"),
  filterThreshold = 0.1, binwidth = 0.5)

Arguments

SNPset

a data frame with SNPs and genotype fields as imported by ImportFromGATK and after running GetPrimeStats

outlierFilter

one of either "deltaSNP" or "Hampel". Method for filtering outlier (ie QTL) regions for p-value estimation

filterThreshold

The absolute delta SNP index to use to filter out putative QTL (default = 0.1)

binwidth

The binwidth for the histogram. Recomended and default = 0.5

Value

Plots a ggplot histogram of the G' value distribution. The raw data as well as the filtered G' values (excluding putatitve QTL) are plotted. It will then overlay an estimated log normal distribution with the same mean and variance as the null G' distribution. This will allow to verify if after filtering your G' value appear to be close to log normally and thus can be used to estimate p-values using the non-parametric estimation method described in Magwene et al. (2011). Breifly, using the natural log of Gprime a median absolute deviation (MAD) is calculated. The Gprime set is trimmed to exclude outlier regions (i.e. QTL) based on Hampel's rule. An estimation of the mode of the trimmed set is calculated using the mlv function from the package modeest. Finally, the mean and variance of the set are estimated using the median and mode are estimated and used to plot the log normal distribution.

See Also

getPvals for how p-values are calculated.

Examples

1
plotGprimedist(df_filt_6Mb, outlierFilter = "deltaSNP")

bmansfeld/QTLseqR documentation built on Jan. 25, 2020, 8:52 p.m.