Contents
visualize$associations$landscape
Association landscape across trait groups
One point per PRS-level association, grouped along the x-axis by group.by
and placed at the -\log_{10} of the p-value column pval names. The
PGS-wide association scan's counterpart to a Manhattan plot, with trait
groups in place of chromosomes.
Usage
visualize.associations.landscape(
associations,
group.by,
pval = adj.pval,
statistic = c("neglog10p", "signed.neglog10p"),
threshold = 0.05,
label.top = NULL,
outcome = NULL,
palette = NULL,
trans = NULL,
theme = c("polygenius", "none")
)Arguments
| Argument | Description |
|---|---|
associations | A PolyGeniusAssociation of PRS-level rows, from [associate$regression](/reference/associate-regression/) or a [associate$meta](/reference/associate-meta/) over one. A schema that does not declare the "landscape" plot aborts, as does a meta whose source.schema does not declare it (a single-variant or mediation meta). |
group.by | Unquoted expression giving each row's group, e.g. group.of[predictor]. Must resolve to one value per row of $results. Group order follows its factor levels when it is a factor, otherwise first appearance. |
pval | Unquoted expression for the p-value column, default adj.pval. |
statistic | One of "neglog10p" (default), "signed.neglog10p". Height: -\log_{10}(p), or that value signed by estimate so risk and protective associations separate above and below zero. |
threshold | Numeric scalar, default 0.05, or NULL for no line. A dashed line at -\log_{10}(threshold), mirrored below zero when signed. |
label.top | Integer scalar, or NULL (default). Label the rows with the largest absolute height by predictor, qualified by outcome when more than one outcome is drawn. |
outcome | Character vector, or NULL (default, every outcome). Outcomes to draw, matched against the outcome column. |
palette | Group colours: a palette-system or hue name, a vector of colours, or NULL (default) for the package categorical palette. Above 30 groups the first two colours of a vector are used as the two tones. |
trans | One of "sqrt", "log10", or NULL (default, a linear axis). Y-axis transform, to spread the rows near the threshold instead of letting a few strong associations flatten them. "log10" is scales::pseudo_log_trans(), symmetric about zero, with ticks at powers of ten. "sqrt" needs non-negative heights, so it refuses a signed statistic. |
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
Only term.type == "main" rows are drawn when the table carries that column.
group.by and pval are evaluated against $results before any row is
dropped, so an expression such as group.of[predictor] may use a lookup
vector from the calling environment.
The plot reads pval as given. It never adjusts a p-value, so the threshold
line is only as meaningful as the column it is drawn against: with the
default adj.pval, threshold = 0.05 is an FDR cut. Rows whose height is
not finite are dropped; a p-value that underflowed to zero is dropped with a
warning, and the rendered subtitle gives the count. Points are jittered within their group by a seeded
position_jitter(), so repeated renders place them identically.
Up to 30 groups are coloured from the categorical palette. Beyond that, groups alternate between two tones, as chromosomes do on a Manhattan track.
Examples
assoc <- structure(list(results = data.frame(
schema = "glm", predictor = c("PRS.AD", "PRS.T2D", "PRS.LDL"),
outcome = "dementia", term.type = "main", estimate = c(0.4, 0.05, -0.1),
pval = c(1e-8, 0.3, 0.01), adj.pval = c(3e-8, 0.3, 0.015))),
class = c("PolyGeniusAssociation", "list"))
group.of <- c(PRS.AD = "neuro", PRS.T2D = "metabolic", PRS.LDL = "metabolic")
visualize$associations$landscape(assoc, group.by = group.of[predictor],
statistic = "signed.neglog10p")See Also
visualize$associations$heatmap for the same rows as an outcome-by-model grid.
Other visualize-associations:
visualize.associations.forest(),
visualize.associations.heatmap(),
visualize.associations.survival(),
visualize.associations.variants.qq()