Contents
visualize$genome$stack
Stack genome tracks on a shared axis
Compose genome tracks vertically onto one shared genome x-axis. The axis is derived from the union of every track's variants, so tracks align even when they cover different variant sets.
Usage
visualize.genome.stack(
...,
region = NULL,
bands = NULL,
scale = c("window", "genome"),
heights = NULL,
guides = "collect"
)Arguments
| Argument | Description |
|---|---|
... | One or more PolyGeniusGenomeTrack objects from a visualize$genome$* builder, or a single list of them. NULL entries are dropped; no track left, or a non-track argument, aborts naming the offending positions. |
region | A "chr:start-end" string, a list or one-row data frame with chr/start/end, or NULL (default) for the whole genome. Viewport applied uniformly to every track; a chromosome absent from the shared axis aborts. In the string form each bound takes decimals, thousands separators and a case-insensitive kb/Mb suffix: "11:59.9-60.5Mb" and "chr11:59,900,000-60500000" name the same window. |
bands | Intervals to shade through every panel, or NULL (default): a character vector of "chr:start-end" strings, or a data frame with chr, start and end, as [visualize$genome$loci](/reference/visualize-genome-loci/) takes. A band on a chromosome absent from the shared axis is dropped with a warning, and one outside region is dropped silently. |
scale | One of "window" (default), "genome". Whether lane tracks re-bin and re-normalize to the region window, or keep their genome-wide scale; see Details. |
heights | Numeric vector, or NULL (default). Relative panel heights, one per track, top to bottom; a length other than the track count aborts. NULL uses each track's own height. |
guides | Character scalar, default "collect". Passed to patchwork::plot_layout(): "collect" gathers the tracks' legends into one column, "keep" leaves each track's legend in place. |
Value
A patchwork composite, one panel per track in the order supplied. It
is not a plain ggplot: apply a theme to every panel with &, since +
targets only the last one.
Details
Tracks are drawn top to bottom in the order supplied, and only the bottom one
shows the chromosome axis. Each track is re-rendered on the shared axis and
clipped to region before its own display binning runs, so a zoom re-bins the
visible window rather than cropping whole-genome bins. Tracks carrying two
different genome builds are refused; a track whose build is NA -- a
single-variant Manhattan, for instance -- is compatible with any.
Under a zoom, each track re-bins to the window by default (scale = "window"), so a lane heatmap is normalized against what is visible.
scale = "genome" keeps the lane tracks, attribution and prs, at their
genome-wide bin width and colour limits, so a zoom reads on the same scale as
the whole-genome figure. Bar and point tracks are unaffected by scale.
bands are drawn as translucent strips behind the data of every panel, and
change neither axis. Like the loci track, each band is drawn at least 0.3% of
the visible span wide so that a locus narrower than a pixel stays visible;
the widening is display only.
Examples
visualize$genome$stack(
visualize$genome$manhattan(gwas, outcome = "dementia"),
visualize$genome$effects(models),
visualize$genome$coverage(models),
region = "19:44.4-45.5Mb"
)See Also
visualize$genome$overview to compute the
default signals and stack them in one call;
visualize$genome$loci for a labelled interval
track to pair with bands.
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.prs(),
visualize.genome.reuse()