| plot_ras_scan | R Documentation |
Produces two diagnostic plots for one chromosome: the RAS scan profile with detected changepoints marked, and a dual-axis overlay of the profile with Davies test significance at each candidate position.
plot_ras_scan(
x,
y,
detection.result,
this_chrom,
save.directory,
p.threshold = 8,
device = "pdf",
y_cap = NULL,
min_display_p = 1,
xlim = NULL,
min_signal = 2.5
)
x |
Numeric vector. SNP position index grid from the scan
( |
y |
Numeric vector. Averaged |
detection.result |
List. Output from |
this_chrom |
Integer. Chromosome number used in output file names and panel titles. |
save.directory |
Character. Directory path for saved files. Ignored
when |
p.threshold |
Numeric. Significance reference line drawn on both plots
(on the |
device |
Character. Output device: |
y_cap |
Numeric or |
min_display_p |
Numeric. Minimum |
xlim |
Numeric vector of length 2, or |
min_signal |
Numeric. Low-signal colour boundary on the
|
Plot 1 — Scan profile. The scan line is drawn segment-by-segment
with colour determined by the local -\log_{10}(p) value:
Red (#d73027): \ge p.threshold
Orange (#fc8d59): \ge p.threshold / 2
Yellow (#fee090): \ge min_signal
Blue (#91bfdb): below min_signal
Detected changepoints (tau_hats) are marked with vertical dashed
red lines, shaded bands, and labelled with their position and Davies
-\log_{10}(p). Left and right slope lines (dark green and purple)
are overlaid at each changepoint; their half-width is fixed at 2.5\
the total x-range. When y_cap is set, positions above the cap are
shown as arrows with their true value annotated.
Plot 2 — Dual-axis overlay. The scan profile (left y-axis, blue
line) is overlaid with triangle markers showing the Davies
-\log_{10}(p) for each candidate (right y-axis, coloured by whether
it exceeds p.threshold). Vertical dashed segments connect markers
to the baseline.
Output files are named:
chr-<chrom>-cp-plot.<ext> and
chr-<chrom>-cp-p-values-plot.<ext>.
Invisibly returns NULL. Called for its side effect of writing plot
files or rendering to the active graphics device.
plot_ras_zoom_regions for zoomed panels around each
changepoint.
ras which calls this function automatically.
ras_validate whose output is passed as
detection.result.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.