Contents
visualize$genome$effects
Signed effect sizes at reused loci (Miami track)
Miami-style genome track for exploring candidate pleiotropy across a model
set. Restricted to variants shared by at least min.models models, it draws
one point per (model, variant): the x-position is genomic, the y-position is
the harmonized effect size (positive effects point up, negative down), the
color encodes directional concordance, and the size encodes how many models
carry the variant. Pair it with
visualize$genome$coverage to recover the
models-per-bin companion track.
Usage
visualize.genome.effects(
models,
min.models = 2,
standardize = c("none", "zscore"),
label.top = 0,
palette = NULL,
raster = FALSE,
raster.args = list(),
point.alpha = 0.6,
height = 4,
max.glyphs = 2e+05,
theme = c("polygenius", "none")
)Arguments
| Argument | Description |
|---|---|
models | A PGSLibrary or a single PGS. Any other class, or an empty PGS library, aborts. Variants are allele-harmonized first; strand-ambiguous variants (A/T, C/G) are dropped. |
min.models | Numeric scalar, default 2. Minimum number of models a variant must appear in to be shown; below 2 aborts, as does a value no variant reaches. |
standardize | One of "none" (default), "zscore". Y-axis effect transform: the raw harmonized beta, or a within-model z-score taken over that model's full effect distribution before the min.models restriction. |
label.top | Numeric scalar, default 0 (no labels); NULL is also accepted and means 0. Number of loci annotated in place with their chr:position:ea:nea identifier, ranked by reuse with |effect| breaking ties, each label anchored at the most extreme point of its locus and never on a summary glyph. A negative value aborts. Uses ggrepel when installed, else geom_text() with a warning. |
palette | Character vector of two or more colours, a single colour or role/hue name, a colorRampPalette-style ramp function, or NULL (default). Sequential ramp for the directional-concordance scale. |
raster | Logical scalar, default FALSE. Draw the Miami points with ggrastr::geom_point_rast(), falling back to geom_point() with a warning when ggrastr is absent. |
raster.args | Named list, default list(). Extra arguments forwarded to ggrastr::geom_point_rast(), over a default raster.dpi = 300. |
point.alpha | Numeric scalar in [0, 1], default 0.6. Point alpha. |
height | Numeric scalar, default 4. Relative panel height when stacked. |
max.glyphs | Positive numeric scalar, default 2e5. Render budget on the individually drawn (model, variant) points, counted after min.models; anything else aborts. Above the budget whole loci are dropped lowest-cumulative-|beta| first until the rest fits, and each dropped locus becomes one diamond summary glyph, coloured and sized like the points it replaces. The diamond sits at that locus's effect.spread when the library is one homogeneity stratum -- one GWAS source, one generation rule, one effect scale -- and at a fixed baseline otherwise, carrying only the scale-free directional concordance. Either way a subtitle states how many loci were summarized and why. |
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: the render spec (mark, data, params,
positions, height, label, build), build being the PGS library's
resolved genome build. Its data carries a glyph.kind column, "point"
or "summary", and params$subtitle is set whenever any locus was
summarized. Prints as a standalone plot and composes with neither + nor
draw(); stack it with visualize$genome$stack.
Details
Directional concordance for a variant carried by K models is
|n.pos - n.neg| / K, counting the models with a positive and a negative
harmonized effect: 1 when all agree on direction, 0 on an even split. It
is always read off the raw harmonized effect direction, whatever standardize
is set to.
Effect magnitudes are not comparable across models built from different
traits, phenotype scales or algorithms; after harmonization only the sign is.
standardize = "zscore" is a display transform that also re-centers, so the
y-axis then reads as a variant's effect relative to its own model's mean
rather than as a raw allelic direction.
Examples
visualize$genome$effects(models, min.models = 3, raster = TRUE)
visualize$genome$stack(
visualize$genome$effects(models),
visualize$genome$coverage(models)
)See Also
visualize$genome$coverage for the models-per-bin companion track; visualize$genome$concordance for the same disagreement reduced to one point per variant.
Other visualize-genome:
visualize.genome.attribution(),
visualize.genome.concordance(),
visualize.genome.convergence(),
visualize.genome.coverage(),
visualize.genome.cumulativeWeight(),
visualize.genome.loci(),
visualize.genome.manhattan(),
visualize.genome.overview(),
visualize.genome.prs(),
visualize.genome.reuse(),
visualize.genome.stack()