PolyGenius
Contents

visualize$models$top.variants

Most-reused variants

Bar chart of the variants that appear in the most models, most-reused first. Each bar is labelled with the full harmonized identifier chr:position:ea:nea, effect allele first, so it can be looked up directly in an external tool. The subtitle states the genome build; no table is returned.

Usage

visualize.models.top.variants(
  models,
  top.n = 25,
  palette = NULL,
  axis = c("y", "x"),
  theme = c("polygenius", "none")
)

Arguments

ArgumentDescription
modelsA PGSLibrary or a single PGS. Any other class, or an empty PGS library, aborts. A set spanning two genome builds is refused by the backbone accessor.
top.nNumeric scalar, default 25. Number of top variants to show; fewer bars are drawn when fewer variants are carried by any model.
paletteBar fill: NULL (default) or a single colour (name or hex, e.g. "darkgreen") fills every bar flat; two or more colours (e.g. c("lightgrey", "darkgreen")) or a colorRampPalette-style ramp function fills them with a gradient keyed to bar height, taller bars at the high end of the ramp. Anything else aborts. See [visualize](/reference/visualize/).
axisOne of "y" (default), "x". Which axis the variants sit on: "y" draws horizontal bars with variant labels down the y-axis, "x" draws vertical bars with variant labels along the x-axis.
themeOne 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, so it composes with +. Under a gradient palette the bars are coloured by reuse count; under a flat one they share a single fill.

Examples

visualize$models$top.variants(models, top.n = 30)
visualize$models$top.variants(models, axis = "x")

See Also

visualize$models$reuse for the reuse distribution these are the tail of; visualize$genome$reuse to place them on the genome.

Other visualize-models: visualize.models.reuse(), visualize.models.sizes(), visualize.models.uniqueness()

Aliases: visualize.models.top.variants, visualize$models$top.variants, visualize_models_top_variants