plot_ras_zoom_regions: Zoom-In Plots Around Each Detected Changepoint

View source: R/plot.R

plot_ras_zoom_regionsR Documentation

Zoom-In Plots Around Each Detected Changepoint

Description

Generates a multi-panel figure with one panel per detected changepoint, each showing a zoomed view of the RAS scan profile centred on that position.

Usage

plot_ras_zoom_regions(
  x,
  y,
  detection.result,
  this_chrom,
  save.directory,
  p.threshold = 8,
  device = "pdf",
  zoom_half_width = 3000,
  ncol = 3,
  min_signal = 2.5
)

Arguments

x

Numeric vector. SNP position index grid used in the scan.

y

Numeric vector. Averaged -\log_{10}(p)-value profile.

detection.result

List. Output from ras_validate, the same object passed to plot_ras_scan.

this_chrom

Integer. Chromosome number used in file names and panel titles.

save.directory

Character. Directory for output files. Ignored when device = "screen".

p.threshold

Numeric. Significance reference line drawn on each panel (on the -\log_{10} scale). Default 8.

device

Character. "pdf" (default), "png", or "screen".

zoom_half_width

Numeric. Half-width of each zoom window in the same units as x. Default 3000.

ncol

Integer. Number of columns in the panel grid. Default 3.

min_signal

Numeric. Low-signal colour boundary on the -\log_{10} scale; also drawn as a grey reference line on each panel. Default 2.5.

Details

Each panel shows a [\tau - \texttt{zoom\_half\_width},\; \tau + \texttt{zoom\_half\_width}] window around changepoint \tau. The scan line is drawn in blue with colour-coded overlays for regions above the significance thresholds (min_signal, p.threshold / 2, p.threshold). Left and right slope lines are plotted in dark green and purple respectively, with their horizontal extent scaled to span approximately 45\ zoom_half_width).

If detection.result$tau_hats is empty the function returns invisibly with a message. Blank panels are added to complete the grid if the number of changepoints is not a multiple of ncol.

The output file is named chr-<chrom>-zoom.<ext>.

Value

Invisibly returns NULL. Called for its side effect of writing a multi-panel plot file or rendering to the active graphics device.

See Also

plot_ras_scan for the full-chromosome overview plots. ras which calls this function automatically.


RAS documentation built on July 24, 2026, 5:06 p.m.