Contents
visualize$genome$prs
PRS-level association across the genome (lane heatmap track)
Genome track relating each model's variants to its PRS-level association with
outcome. Every model is one horizontal lane, tiled where that model has
variants and filled, constant along the lane, by that model's association
strength.
Usage
visualize.genome.prs(
associations,
models,
outcome = NULL,
statistic = c("neglog10p", "estimate"),
order = c("strength", "input"),
binwidth = 1e+07,
reduce = c("bin", "window"),
window = NULL,
palette = NULL,
max.labels = 30,
max.lanes = 200,
raster = FALSE,
raster.args = list(),
height = 3,
theme = c("polygenius", "none")
)Arguments
| Argument | Description |
|---|---|
associations | A PolyGeniusAssociation (e.g. from [associate$regression](/reference/associate-regression/)) holding PRS-level results. |
models | A PGSLibrary or a PGS, the models scored in associations. Supplies each model's variant positions; a mixed-build input aborts. |
outcome | Character scalar, or NULL (default). Outcome to plot, matched against the outcome column. Required when associations holds several. |
statistic | One of "neglog10p" (default), "estimate". Lane fill: -log10(pval), or the effect estimate on its native scale. |
order | One of "strength" (default), "input". Lane order top to bottom: strongest first, or the PGS library's own order. |
binwidth | Numeric scalar (base pairs), default 1e7. Width of the genomic bins the lanes are drawn in. |
reduce | One of "bin" (default), "window". "bin" marks each variant's single bin; "window" widens each model's footprint over every bin within +/- window/2, clipped to the variant's chromosome. |
window | Numeric scalar (base pairs), or NULL (default). Smoothing width for reduce = "window"; NULL uses three times the region-aware display bin width. Unused when reduce = "bin". |
palette | Fill ramp: a palette-system or hue name, a vector of two or more colors, a ramp function, or NULL (default) for a sequential purple ramp with "neglog10p" and a zero-centered diverging ramp with "estimate". |
max.labels | Numeric scalar, default 30. Model names appear on the y-axis only up to this many drawn lanes; above it they are hidden. |
max.lanes | Positive numeric scalar, default 200. Budget on the individually drawn lanes, see Lane budget. A non-numeric, NA or below-1 value aborts. |
raster | Logical scalar, default FALSE. Draws the tiles through ggrastr::rasterise(), which pays off for many-model heatmaps; without ggrastr it warns and falls back to geom_tile(). |
raster.args | Named list, default list(). Extra arguments for ggrastr::rasterise() (e.g. dpi), merged after the dpi = 300 default. |
height | Numeric scalar, default 3. Relative panel height when stacked. |
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 PolyGeniusGenomeTrack. Prints as a standalone plot; stack with
visualize$genome$stack.
Details
Association strength is read from associations$results, which must carry the
columns predictor, outcome, term.type, pval and estimate; variant
coordinates come from models, joined on the model name (predictor). Only
term.type == "main" rows are read, and where a model has several the
smallest-pval row wins. Models with no matching association row, and
association rows with no matching model, are dropped with a note; no overlap
at all aborts, as does a table with no finite strength. The optional
effect.scale column only labels the legend.
Lane budget
At most max.lanes models get a row of their own: the strongest by
|statistic|, regardless of order. The rest are pooled into one bottom lane
labelled "Remaining N models", shaded by a single neutral ink whose alpha
encodes how many pooled models place a variant in that bin. That alpha is a
model density, not an association strength, so it never shares the fill scale.
The rendered subtitle says when this fired.
Examples
assoc <- associate$regression(data, outcomes = dementia, predictors = everything())
visualize$genome$prs(assoc, models, outcome = "dementia")See Also
visualize$genome$stack to compose it with other tracks, visualize$associations$forest for the same associations without a genome axis.
Other visualize-genome:
visualize.genome.attribution(),
visualize.genome.concordance(),
visualize.genome.convergence(),
visualize.genome.coverage(),
visualize.genome.cumulativeWeight(),
visualize.genome.effects(),
visualize.genome.loci(),
visualize.genome.manhattan(),
visualize.genome.overview(),
visualize.genome.reuse(),
visualize.genome.stack()