PolyGenius
Contents

visualize$genome$coverage

Genomic coverage by the model library (distinct models per bin)

Companion coverage track to visualize$genome$effects: per genomic bin, the number of distinct models contributing a variant there. A bin that is dense here and split in effect direction in the Miami above is a candidate for antagonistic pleiotropy.

Usage

visualize.genome.coverage(
  models,
  min.models = 1,
  binwidth = 1e+07,
  reduce = c("bin", "window"),
  window = NULL,
  palette = NULL,
  chr.colors = NULL,
  height = 0.6,
  theme = c("polygenius", "none")
)

Arguments

ArgumentDescription
modelsA 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.modelsNumeric scalar, default 1. Minimum number of models a variant must appear in to be counted; below 1 aborts, as does a value no variant reaches.
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" counts distinct models per disjoint bin; "window" counts over overlapping windows, each variant's model counted in every bin within +/- window/2, clipped to its chromosome. A model is never double-counted within one bin.
windowNumeric scalar (base pairs), or NULL (default). Smoothing width for reduce = "window"; NULL uses three times the display bin width.
paletteBar fill, and the flat-versus-gradient switch. NULL (default, the package colour) or a single colour (name or hex) draws flat bars alternating by chromosome in a two-tone of that colour and neutral grey, as the Manhattan track does, so stacked tracks line up. Two or more colours (e.g. c("lightgrey", "darkgreen")) or a colorRampPalette-style ramp function instead fills the bars with a gradient keyed to the models-per-bin count, denser bins at the high end of the ramp. Anything else aborts.
chr.colorsCharacter vector of two colours, or NULL (default). Overrides the chromosome two-tone in flat mode (e.g. c("#045669", "#822B2A")), since palette is taken by the flat-versus-gradient choice. Ignored in gradient mode.
heightNumeric scalar, default 0.6. Relative panel height when stacked, sizing it as a thin context rail under the signal tracks.
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), build being the PGS library's resolved genome build. Binning happens at render, so a region = zoom re-bins the visible window rather than cropping whole-genome bins. Prints as a standalone plot and composes with neither + nor draw(); stack it with visualize$genome$stack.

Examples

visualize$genome$coverage(models, binwidth = 5e6)
visualize$genome$coverage(models, palette = c("lightgrey", "darkgreen"))

See Also

Aliases: visualize.genome.coverage, visualize$genome$coverage, visualize_genome_coverage