fast_qq: A fast version of a quantile-quantile plot

View source: R/fast_qq.R

fast_qqR Documentation

A fast version of a quantile-quantile plot

Description

This is a very fast plotting function for quantile-quantile (QQ) plots using ggplot2 and scattermore functionalities.

Usage

fast_qq(
  pvalue,
  speed = "fast",
  pointsize = 1.2,
  linecolor = "deeppink",
  ci_color = "steelblue",
  ci_alpha = 0.3,
  conf.alpha = 0.05,
  confint = T,
  log10 = T,
  inflation_method = "median",
  title = "QQ-plot"
)

Arguments

pvalue

A numeric vector of pvalues.

speed

The speed option. Fast and ultrafast use scattermore functionality

pointsize

Only when using the 'fast' option you can increase pointsize. Default is 1.2

linecolor

Color of the abline of the theoretical and sample distributions.

ci_color

Color fof the confidence interval

ci_alpha

Alpha value (e.g. transparency) of the confidence's fill color

conf.alpha

Alpha level of the confidence interval. Default value = 0.05

confint

Print a confident interval. Default = TRUE

log10

Should the pvalues -log10 tranformed? Default = TRUE

inflation_method

Method to calculate the genomic inflation factor. choices = c("median","regression"). The "median" method is the most common way to estimate lambda. The regression method is adapted from the GenABEL package.

title

A title added to the plot

Value

A ggplot2 object/plot

Examples

data("gwas_data")
head(gwas_data)
fast_qq(gwas_data$pvalue, inflation_method = "reg")
fast_qq(gwas_data$pvalue, inflation_method = "med")

roman-tremmel/ggfastman documentation built on Feb. 20, 2024, 11:59 a.m.