GC_zoom() adds a slider below the clusters to zoom in on part of them.
Drag a handle to change the window, drag the window to move it, click the
track to move the window there, and double-click the slider or use the
reset zoom button of the toolbar (GC_toolbar()) to show everything again.
With the keyboard, the arrow keys move a handle or the window by 1% of the
slider (Shift: 10%), Home and End to the ends.
Usage
GC_zoom(
GC_chart,
show = TRUE,
range = NULL,
mode = NULL,
min = NULL,
update = NULL,
height = NULL,
overview = NULL,
color = NULL,
style = NULL,
windowStyle = NULL,
handleStyle = NULL
)Arguments
- GC_chart
A GC chart object.
- show
Logical, whether to show the slider.
FALSEremoves it.- range
The window shown first, as
c(start, end)in the units ofmode.NULL(default) shows everything. A Shiny app can keep the window the user picked withrange = input$<outputId>_zoom$range(seeGC_events()(zoom = TRUE)). The chart keeps the window the user picked when it is drawn again with the same data, the samerangeandmodeand the sameGC_events()(render_id = ); a newrender_idmarks a new load, which starts atrangeagain.- mode
How the window applies to the clusters:
"relative"(default) zooms every cluster to the same share of its own range, e.g.range = c(0.25, 0.5)for its second quarter, which suits clusters of different genomes."absolute"shows the same base pairs in every cluster, e.g.range = c(12000, 18000), and the slider spans the range of all clusters.- min
The narrowest window, in the units of
mode(default 1% of the slider).- update
"live"(default) draws the chart while the slider moves,"release"when it is let go, for large charts.- height
Height of the slider in pixels (default 24). The clusters make room for it.
- overview
Logical, whether the slider shows the genes of each cluster, one row per cluster, in the colours of their group (default
TRUE).- color
One colour for the genes of the overview instead of their group colours.
- style, windowStyle, handleStyle
Named lists of CSS styles of the slider track, the window and the two handles, e.g.
style = list(backgroundColor = "#eeeeee").
Details
The chart is drawn again for each window: genes, labels, links,
coordinates and annotations follow the window, and parts outside it are
cut off at the edges of the plot area. The axis shows the ticks of the
window. The window of GC_scale()(start, end) is the whole range the
slider covers. Text moved by dragging (GC_events()(drag = TRUE)) keeps
its offset. Saved images leave out the slider and the room it takes.
In Shiny, GC_events()(zoom = TRUE) reports the window, and
GC_zoom_to() sets it from the server.
Examples
GC_chart(ophA_clusters, cluster = "cluster", group = "class",
height = "300px") %>%
GC_labels("name") %>%
GC_zoom(range = c(0.2, 0.6))
# The same base pairs in every cluster
GC_chart(ophA_clusters, cluster = "cluster", group = "class",
height = "300px") %>%
GC_zoom(mode = "absolute", update = "release", height = 30,
handleStyle = list(backgroundColor = "#d9d9d9"))
