plot_skewness: GWAS Skewness vs. Kurtosis Plot

View source: R/plot_skewness.R

plot_skewnessR Documentation

GWAS Skewness vs. Kurtosis Plot

Description

This function generates the skewness vs. kurtosis plot created by QC_series.

Usage

plot_skewness(skewness,
              kurtosis,
              labels = paste("Study", 1:length(skewness)),
              plot_labels = "outliers",
              save_name = "Graph_skewness_kurtosis",
              save_dir = getwd(), ...)

Arguments

skewness, kurtosis

Vectors containing the skewness and kurtosis values of the datasets

labels

vector containing names or other identifiers for the datapoints, to be plotted in the graph. Note: it's best to keep these very short.

plot_labels

character string or logical determining whether the values in labels are plotted next to the data points. The possible settings are: "none" (or FALSE); "all" (or TRUE); and "outliers" for outliers only.

save_name

character string; the filename, without extension, for the graph file.

save_dir

character string; the directory where the graph is saved. Note that R uses forward slash (/) where Windows uses backslash (\).

...

arguments passed to plot.

Details

When running a QC over multiple files, QC_series collects the values of the skewness_HQ and kurtosis_HQ output of QC_GWAS in a table, which is then passed to this function to convert it into a plot. Note that this values are calculated over high-quality SNPs only.

Kurtosis is a measure of how well a distribution matches a Gaussian distribution. A Gaussian distribution has a kurtosis of 0. Negative kurtosis indicates a flatter distribution curve, while positive kurtosis indicates a sharper, thinner curve.

Skewness is a measure of distribution asymmetry. A symmetrical distribution has skewness 0. A positive skewness indicates a long tail towards higher values, while a negative skewness indicates a long tail towards lower values.

Ideally, one expects both the skewness and kurtosis of effect sizes to be close to 0. In practice, these statistics can be hugely variable. QC_series uses only high-quality effect sizes to calculate these values in order to reduce some of the more extreme values. Still, it is recommended that you compare the values to those of other GWAS with the same phenotype, rather than relying on on the label outliers command to identify problems.

Value

An invisible NULL.

See Also

For calculating skewness and kurtosis: calc_kurtosis.

For other plots comparing GWAS results files: plot_precision and plot_distribution.

Examples

  value_S <- c(0.05, -0.27, 0.10, 0.11)
  value_K <- c( 6.7,  10.0, 10.1,  6.6)
  value_labels <- paste("cohort", 1:4)
  
  ## Not run: 
  plot_skewness(skewness = value_S,
                kurtosis = value_K,
                labels = value_labels,
                plot_labels = "outliers",
                save_name = "sample_skewness_kurtosis")
## End(Not run)

QCGWAS documentation built on May 30, 2022, 5:05 p.m.