PolyGenius
Contents

visualize$genome$cumulativeWeight

Cumulative PRS-weight track

Renders a cumulative-weight PolyGeniusGenomeSignal as a binned area track: per display bin, the summed |beta| the model library places there. The weighted counterpart to the visualize$genome$reuse model count. Bar height is only comparable within one comparable library, as compute$genome$cumulativeWeight() sets out.

Usage

visualize.genome.cumulativeWeight(
  signal,
  binwidth = 1e+07,
  reduce = c("bin", "window"),
  window = NULL,
  palette = NULL,
  height = 1.5,
  theme = c("polygenius", "none")
)

Arguments

ArgumentDescription
signalA PolyGeniusGenomeSignal with metadata$statistic == "cumulative.weight", from [compute$genome$cumulativeWeight()](/reference/compute-genome-cumulativeweight/); any other statistic aborts, naming the producer to call. Reads chr, position and value from $results.
binwidthNumeric scalar (base pairs), default 1e7 (10 Mb). Display bin width. Superseded under a region = zoom on the stack, which re-bins to about 50 bins across the visible window.
reduceOne of "bin" (default), "window". "bin" sums variants in disjoint bins; "window" sums overlapping windows, each variant contributing to every bin within +/- window/2, clipped to its chromosome. "window" is a moving sum, so it raises the absolute y-height by roughly window/binwidth.
windowNumeric scalar (base pairs), or NULL (default). Smoothing width for reduce = "window"; NULL uses three times the display bin width.
paletteCharacter vector of two or more colours, a single colour or role/hue name, or NULL (default). Bars alternate by chromosome in a two-tone, as the Manhattan track does. NULL uses the package colour plus neutral grey; a single colour replaces the primary tone; two or more colours (e.g. c("#045669", "#822B2A")) set both chromosome shades, first two used.
heightNumeric scalar, default 1.5. Relative panel height when stacked.
themeOne 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), with build taken from signal$metadata$build. Binning runs at render, so a region = zoom re-bins the visible window. Prints as a standalone plot; stack it with visualize$genome$stack.

Examples

sig <- compute$genome$cumulativeWeight(models)
visualize$genome$cumulativeWeight(sig, binwidth = 5e6)

See Also

Aliases: visualize.genome.cumulativeWeight, visualize$genome$cumulativeWeight, visualize_genome_cumulativeWeight