Skip to content

06 Diagnostic Plots

songif edited this page Jun 15, 2026 · 4 revisions

Diagnostic Plots

plot_dsge()

Draws the null density curve for each selected pathway with the observed DSGE marked as a red dashed line. The GPD tail region is shown in orange. Requires pathway_dsge(..., return_null = TRUE).

Usage

# Top 9 by significance
plot_dsge(result, n = 9)

# Specific pathways
plot_dsge(result, gs_ids = c("GO:0007156", "GO:0007268"))

# Standardised scale (requires dsge_std = TRUE in pathway_dsge)
plot_dsge(result, n = 9, use_std = TRUE)

# Save to PDF
pdf("top9.pdf", width = 12, height = 10)
plot_dsge(result, n = 9)
dev.off()

Parameters

Parameter Default Description
result (required) Output of pathway_dsge(..., return_null = TRUE)
n 9 Number of top pathways to plot (by p_adj); ignored when gs_ids is set
gs_ids NULL Character vector of pathway IDs to plot, e.g. c("GO:0007156")
col_null "steelblue" Null distribution density curve colour
col_obs "red" Observed DSGE vertical line colour
col_tail "#FFA50040" GPD tail region colour (semi-transparent)
cex_main 0.85 Title font scaling
use_std auto If TRUE, plot standardised null and dsge_std on x-axis; defaults to TRUE when dsge_std column exists

plot_dsge_volcano()

Volcano plot visualisation of DSGE results (p-value vs. DSGE / NDS).

Null Distribution Diagnostic Scripts

The package ships with R scripts for diagnosing null distribution quality:

  • null_density_plot.R: Plots null distribution densities across pathway sizes
  • null_density_std_plot.R: Plots standardised null distributions
  • gpd_diagnostic_plot.R: Assesses GPD fit quality for tail extrapolation

These are located in inst/scripts/ after installation.

Clone this wiki locally