
Plot Per-test Type I Error Rate from Null Simulations
plotSimu.RdVisualizes the per-test type I error rate of differential splicing methods
on simulated null data (DID = 0 for all orthologous splice junctions). For each simulation,
the per-test type I error rate is defined as the proportion of raw
(unadjusted) p-values strictly below alpha. Because no orthologous splice junction has
a true effect, every rejection is a false positive and this proportion
estimates the per-test type I error under the global null.
Usage
plotSimu(
params,
alpha = 0.1,
nbThreads = 1,
methodOrder = c("DESeq2", "limma", "limmaCorr", "phylolmBM", "phylolmOU", "EVE",
"phyloDEBM", "phyloDEOU"),
ncol = 3,
textSize = 22,
breaks = NULL,
returnData = FALSE
)Arguments
- params
data.frame. Simulation results metadata returned by
runSimu, containing columns:modelProcessEvolution model ("BM" or "OU")
lambdaWithin-species correlation (0 to 1)
thalfOU half-life, relative to tree height (between-species correlation)
methodStatistical method name
repReplicate ID
outputResFilePath to TSV file with pval and DID columns
- alpha
Numeric. Significance threshold applied to raw (unadjusted) p-values. Orthologous splice junctions with
pval < alphaare counted as rejections. Under the global null, the expected per-test type I error rate isalpha. Default: 0.1.- nbThreads
Integer. Number of parallel threads for reading result files. Default: 1.
- methodOrder
Character vector. Order in which methods are displayed in facets. Default order groups non-phylogenetic methods first, then phylogenetic methods.
- ncol
Integer. Number of columns in facet layout. Default: 3.
- textSize
Numeric. Base text size for plot theme. Default: 22.
- breaks
Numeric vector. Explicit break points for the colour scale. If
NULL(default), breaks are chosen automatically byggplot2::waiver().- returnData
Logical. If
TRUE, return the per-replicate data.frame instead of a plot. Default:FALSE.
Value
If returnData = FALSE (default), a ggplot2 object
showing a heatmap of the mean per-test type I error rate across lambda
(y-axis) and thalf (x-axis), faceted by method. The nominal level
alpha is used as the lower bound of the colour scale, so cells
below alpha appear white.
If returnData = TRUE, a data.frame with columns:
repReplicate ID
modelProcessEvolution model
lambdaWithin-species correlation (factor)
thalfOU half-life, relative to tree height (factor)
methodStatistical method (factor)
FPNumber of raw p-values < alpha (false positive count)
typeIerrRatePer-test type I error rate: FP / n_junctions, i.e. the proportion of raw p-values below
alphaunder the global null
Details
To quantify false positive inflation induced by phylogenetic dependence, the per-test type I error rate is evaluated using raw p-values under the global null. The question addressed here is fundamentally a model misspecification problem: non-phylogenetic methods ignore the covariance structure induced by shared evolutionary history, so their p-values are not uniform under the null when within- or between-species correlations are strong.
The function performs the following steps:
Reads each simulation result file and counts orthologous splice junctions with raw (unadjusted) p-values strictly below
alphaas false positives (FP). All data are generated under the global null (DID = 0), so every rejection is a false positive.Computes the per-test type I error rate as
typeIerrRate = FP / n_junctionsfor each simulation replicate. Under a well-calibrated test this should equalalpha.Aggregates results by taking the mean per-test type I error rate across replicates for each (lambda, thalf, method) combination.
Generates a heatmap with a log-scaled colour gradient anchored at the nominal level
alpha.
Interpreting the Plot
White/light cells: Per-test type I error rate near or below
alpha— well-calibrated test.Red cells: Per-test type I error rate well above
alpha— inflated type I error.
See also
runSimu to generate the simulation results.