Contents
visualize$associations$variants.qq
Single-variant association QQ plot
Quantile-quantile plot of a GWAS scan from
associate$singleVariant: observed against expected
-\log_{10}(p) under the null, with the 1:1 reference line and the
genomic-inflation factor \lambda_{GC} annotated.
Usage
visualize.associations.variants.qq(
results,
outcome = NULL,
stratum = NULL,
genotype = NULL,
thin = TRUE,
palette = NULL,
point.size = 0.7,
point.alpha = 0.7,
theme = c("polygenius", "none")
)Arguments
| Argument | Description |
|---|---|
results | A PolyGeniusAssociation with schema "single.variant", or "meta" over one, or a plain data frame of single-variant rows. Any other schema aborts. |
outcome | Character scalar, or NULL (default). Phenotype to plot, matched against the outcome column; required only when the result holds more than one phenotype. |
stratum | Character scalar, or NULL (default). Stratum to plot, matched against the stratum column; required only when the result holds more than one stratum. |
genotype | Character scalar, or NULL (default). Genotype dataset to plot, matched against the genotype column; required only when the result spans more than one genotype dataset. |
thin | Logical scalar, default TRUE. Grid-deduplicates the dense bulk below -\log_{10}(p) = 2 to two decimal places once the scan exceeds 1e5 rows, keeping every tail point. Display only, so it never moves \lambda_{GC}. |
palette | Point color: a role or hue name, a single color, a vector of two or more colors, a ramp function, or NULL (default) for the package categorical line color. |
point.size | Numeric scalar, default 0.7. Point size. |
point.alpha | Numeric scalar in [0, 1], default 0.7. Point opacity. |
theme | One of "polygenius" (default), "none". Plot theme. "none" gives a bare theme_minimal() to style yourself; palette colors are applied either way. |
Value
A ggplot object.
Details
P-values are read from the first of pval, p, p.value or pvalue present
in the result table, matched case-insensitively and ignoring a leading #.
Non-finite values and values outside (0, 1] are dropped, and the plot aborts
when none remain.
\lambda_{GC} is not computed here for a PolyGeniusAssociation: it is
read from the per-row lambda.gc column of the selected scan, otherwise from
the single-row $diagnostics$genomic.inflation, and the plot aborts when
neither is present. A plain data frame, for which no engine ever ran, is the
only input for which the qchisq() formula is evaluated, over the full
unthinned p-value vector.
Examples
gwas <- associate$singleVariant(data, phenotypes = dementia)
visualize$associations$variants.qq(gwas, outcome = "dementia")