Last updated: 2026-08-26

Checks: 6 1

Knit directory: coderepo-local/

This reproducible R Markdown analysis was created with workflowr (version 1.7.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20251109) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version e77a71e. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    Rplots.pdf
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/site_libs/
    Ignored:    code/.DS_Store
    Ignored:    code/.Rhistory
    Ignored:    code/revision_simulations/.DS_Store
    Ignored:    data/appendixB/
    Ignored:    data/dynamic_eQTL_real/
    Ignored:    data/revision_simulations/
    Ignored:    data/toy_example/
    Ignored:    output/dynamic_eQTL_real/
    Ignored:    output/pdf/
    Ignored:    output/playwright/
    Ignored:    output/revision_simulations/
    Ignored:    scripts/

Untracked files:
    Untracked:  analysis/revision_internal_fash_knockoff.rmd
    Untracked:  analysis/revision_internal_fash_temporal_class_enhancer_enrichment.rmd
    Untracked:  analysis/revision_internal_three_likelihood_comparison.rmd
    Untracked:  code/03_nonlindyn_lfsr.R
    Untracked:  code/03_nonlindyn_lfsr.sbatch
    Untracked:  code/revision_simulations/internal/evaluation_grid_sensitivity/reporting.R
    Untracked:  code/revision_simulations/internal/evaluation_grid_sensitivity/test_reporting.R
    Untracked:  code/revision_simulations/internal/fash_knockoff/reporting.R
    Untracked:  code/revision_simulations/internal/fash_knockoff/test_reporting.R
    Untracked:  code/revision_simulations/internal/fash_temporal_class_enhancer_enrichment/
    Untracked:  code/revision_simulations/internal/per_unit_expression_correlation/
    Untracked:  code/revision_simulations/r1_r2_fashr0143/source_snapshots/
    Untracked:  code/revision_simulations/r3_functional_testing/test_rendered_pages.R
    Untracked:  code/revision_simulations/r3_functional_testing/test_reporting.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/21_r3_center_aligned_relative_location_paired_core.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/21_r3_center_aligned_relative_location_paired_fashr0143.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/21_r3_center_aligned_relative_location_paired_fashr0143.sbatch
    Untracked:  code/revision_simulations/r3_r4_fashr0143/22_r3_full_universe_functional_core.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/22_r3_full_universe_functional_fashr0143.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/22_r3_full_universe_functional_fashr0143.sbatch
    Untracked:  code/revision_simulations/r3_r4_fashr0143/source_snapshots/r3_center_aligned_relative_location_paired_driver.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/source_snapshots/r3_center_aligned_relative_location_paired_simulation_functions.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/source_snapshots/r3_full_universe_functional_driver.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/source_snapshots/r3_full_universe_functional_simulation_functions.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/test_r3_center_aligned_relative_location_paired.R
    Untracked:  code/revision_simulations/r3_r4_fashr0143/test_r3_full_universe_functional.R
    Untracked:  code/revision_simulations/r4_correlated_errors/compute_full_model_residual_correlation.R
    Untracked:  code/revision_simulations/r4_correlated_errors/compute_pc_residual_expression_correlation.R

Unstaged changes:
    Modified:   analysis/dynamic_eQTL_real.rmd
    Modified:   analysis/dynamic_eQTL_real_cl.rmd
    Modified:   analysis/dynamic_eQTL_real_full.rmd
    Modified:   analysis/index.Rmd
    Modified:   analysis/nonlinear_dynamic_eQTL_real.Rmd
    Modified:   analysis/nonlinear_dynamic_eQTL_real_cl.Rmd
    Modified:   analysis/nonlinear_dynamic_eQTL_real_full.rmd
    Modified:   analysis/revision_combined_spiky_genotype_simulation.rmd
    Modified:   analysis/revision_correlated_error_simulation.rmd
    Modified:   analysis/revision_functional_testing_simulation.rmd
    Modified:   analysis/revision_genotype_level_simulation.rmd
    Modified:   analysis/revision_internal_evaluation_grid_mc_sensitivity.rmd
    Deleted:    code/02_dyn.R
    Modified:   code/02_dyn_lfsr.R
    Modified:   code/02_dyn_lfsr.sbatch
    Deleted:    code/03_nonlindyn.R
    Modified:   code/revision_simulations/README.md
    Modified:   code/revision_simulations/internal/evaluation_grid_sensitivity/run_all_category_baseline_discovery_sensitivity.R
    Modified:   code/revision_simulations/internal/evaluation_grid_sensitivity/test_all_category_baseline_discovery_sensitivity.R
    Modified:   code/revision_simulations/internal/fash_knockoff/plot_lfdr_histograms.R
    Modified:   code/revision_simulations/internal/fash_knockoff/plot_w_boxplot_by_discovery.R
    Modified:   code/revision_simulations/r1_r2_fashr0143/reporting_overlay.R
    Modified:   code/revision_simulations/r3_functional_testing/reporting.R
    Modified:   code/revision_simulations/r4_correlated_errors/reporting.R
    Modified:   code/revision_simulations/r4_correlated_errors/test_unit_specific_residual_permutation_helpers.R
    Modified:   code/revision_simulations/r4_correlated_errors/unit_specific_residual_permutation_helpers.R
    Modified:   code/revision_simulations/shared/simulation_functions.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/revision_functional_testing_simulation.rmd) and HTML (docs/revision_functional_testing_simulation.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 09f63bc Ziang Zhang 2026-08-24 Sync revision analyses and rendered pages
html 09f63bc Ziang Zhang 2026-08-24 Sync revision analyses and rendered pages
Rmd c87957a Ziang Zhang 2026-08-10 Add revision analyses: R1-R6 reviewer-facing pages and internal studies
html c87957a Ziang Zhang 2026-08-10 Add revision analyses: R1-R6 reviewer-facing pages and internal studies

Overview

This simulation evaluates FASH functional testing directly over all 6,362 simulated units. It uses two non-IWP truth mechanisms matched on sample size, variant classes, genetic main effects, functional labels, and analysis.

Results are read from a completed five-seed Midway3 cache generated with fashr 0.1.43 at Git SHA bf223df75da6e41ae48607a56b4cd12d7c3b24e7.

For donor \(i\), variant \(j\), and time \(t\),

\[ Y_{ijt} = \alpha_{jt} + G_{ij}\beta_j(t) + X_i^T\gamma_{jt} + \epsilon_{ijt}, \qquad \epsilon_{ijt}\sim N(0,1). \]

The genotype matrix is taken from the real YRI data used in the manuscript. For each simulation seed, one tested cis variant is sampled uniformly from each of the 6,362 tested genes, and its observed dosage vector is retained for the same 19 donors. A tested variant assigned to multiple genes may therefore appear more than once. R1, R2, R3A, and R3B use the exact same sampled gene-variant pairs and genotype matrix for a given seed.

The five columns of \(X\) remain simulated independently from \(N(0,1)\) and are standardized across donors. Independently for each covariate, gene, and time, \(\gamma_{kjt}\sim N(0,0.5^2)\). The current simulation sets \(\alpha_{jt}=0\); each fitted regression still includes an intercept. Effect trajectories, covariates, covariate effects, and expression noise remain simulated.

seed <- 12345
component_seeds <- revision_component_seeds(seed)

genotype_cache <- readRDS(
  "output/revision_simulations/shared/real_genotype_one_per_gene_J6362_pilot5/genotype_samples.rds"
)
genotype_sample <- genotype_cache$samples[[as.character(seed)]]
G <- genotype_sample$G
covariates <- simulate_covariate_matrix(
  n_donors = 19,
  n_covariates = 5,
  seed = component_seeds[["covariates"]]
)

Real-genotype design

knitr::kable(
  genotype_sampling_table,
  align = "l",
  caption = paste(
    "Table 1. Per-seed genotype sampling summary. Repeated assignments",
    "refer to the same tested variant selected for more than one gene."
  )
)
Table 1. Per-seed genotype sampling summary. Repeated assignments refer to the same tested variant selected for more than one gene.
Seed Genes Unique rsIDs Repeated cross-gene assignments MAF range Median MAF
12345 6,362 6,345 17 0.101-0.500 0.254
22345 6,362 6,342 20 0.100-0.500 0.243
32345 6,362 6,338 24 0.100-0.500 0.251
42345 6,362 6,333 29 0.100-0.500 0.239
52345 6,362 6,338 24 0.100-0.500 0.257

Each replicate contains 19 donors, 16 time points, five PC-like covariates, 1,272 dynamic eQTLs, 2,545 constant eQTLs, and 2,545 zero-effect units. Truth classes are assigned within empirical-MAF deciles so that the dynamic, constant, and zero-effect groups have closely matched MAF distributions.

knitr::kable(
  truth_maf_balance_table,
  align = "l",
  caption = "Table 2. Empirical MAF balance across truth classes over five simulation seeds."
)
Table 2. Empirical MAF balance across truth classes over five simulation seeds.
Truth class Units per seed Mean MAF across seeds Maximum absolute MAF SMD
Dynamic 1,272 0.270 0.001
Constant 2,545 0.270 0.003
Zero 2,545 0.270 0.003

For every dynamic candidate,

\[ \beta_j(t)=\mu_j+h_j(t), \qquad \mu_j\sim N(0,1). \]

The 1,272 dynamic eQTLs are divided exactly across six preassigned truth cells (212 per cell): early, middle, or late crossed with switch or non-switch. Each candidate draws a new \(\mu_j\) from \(N(0,1)\); rejection sampling retains it only when the final trajectory \(\mu_j+h_j(t)\) satisfies its assigned cell.

R3A: broad random B-spline effects

The deviation \(h_j(t)\) is a cubic B-spline with six iid \(N(0,1)\) coefficients. It is centered over the 16 observed times and scaled to maximum absolute value 2 before adding \(\mu_j\).

R3B: compact raised-cosine effects

The deviation \(h_j(t)\) contains one, two, or three compact raised-cosine peaks with half-width 1.5. Primary peak centers are sampled from 1.5–2.5 for Early, 4.5–10.5 for Middle, and 12.5–13.5 for Late. Secondary peak centers use the same three aligned ranges, their amplitudes are random, and the deviation is scaled to centered RMS 0.9 before adding \(\mu_j\). As in R3A, the final dense-grid trajectory must satisfy its assigned functional label and clearance margin.

Truth definitions

Early, middle, and late use the same supremum-contrast functionals as the manuscript, with the revised temporal partition defined exactly as Early \(t\leq 3\), Middle \(3<t<12\), and Late \(t\geq 12\). On the dense evaluation grid seq(0, 15, by = 0.1), the Middle functional therefore uses the 89 points from 3.1 through 11.9; times 3 and 12 belong only to Early and Late, respectively. These are continuous-time definitions. The simulation evaluates their dense-grid analogues. Writing \(R_j=\sup_t\beta_j(t)-\inf_t\beta_j(t)\), the scale-adaptive location margin is

\[ m_j=\max(0.1,\,0.1R_j). \]

The assigned Early, Middle, or Late contrast must be at least \(m_j\), and both competing location contrasts must be at most \(-m_j\). Thus the same relative clearance rule is applied symmetrically to all three location categories.

For the switch threshold \(c=0.25\),

\[ T_{\mathrm{switch}}\{\beta\} = \min\left[ \sup_t\{\beta(t):\beta(t)>0\}, \sup_t\{|\beta(t)|:\beta(t)<0\} \right]-c. \]

A switch truth must have \(T_{\mathrm{switch}}\geq 0.1\); equivalently, it has both a positive and a negative effect of magnitude at least 0.35. A non-switch truth remains the same sign over the full dense grid. Its clearance from zero must satisfy

\[ \min_t|\beta_j(t)|\geq\max(0.1,\,0.1R_j). \]

Thus, a larger-amplitude non-switch curve must remain proportionally farther from zero. These margins make the simulation labels unambiguous.

truth_mechanism <- "random_bspline" # Use "raised_cosine" for R3B.
scenario <- paste0(
  if (truth_mechanism == "random_bspline") "r3a_" else "r3b_",
  "real_genotype_one_per_gene_matched_functional_",
  truth_mechanism,
  "_open_middle_3_12_center_aligned_equal_cells_",
  paste0(
    "relative_location_clearance_full_universe_",
    "paired_posterior_main_effect"
  )
)
time_grid <- 0:15
evaluation_grid <- seq(0, 15, by = 0.1)
class_probs <- c(
  dynamic_bspline = 0.20,
  constant = 0.40,
  zero = 0.40
)

effect_sim <- simulate_matched_functional_effect_set(
  n_variants = 6362,
  truth_mechanism = truth_mechanism,
  time_grid = time_grid,
  evaluation_grid = evaluation_grid,
  class_probs = class_probs,
  dynamic_main_effect_sd = 1,
  constant_sd = 1,
  bspline_amplitude = 2,
  bspline_df = 6,
  bspline_coefficient_sd = 1,
  cosine_width_half = 1.5,
  cosine_spike_counts = 1:3,
  cosine_relative_amplitude_range = c(0.35, 0.75),
  cosine_target_centered_rms = 0.9,
  cosine_center_ranges = list(
    early = c(1.5, 2.5),
    middle = c(4.5, 10.5),
    late = c(12.5, 13.5)
  ),
  switch_threshold = 0.25,
  middle_window = c(3, 12),
  middle_boundary = "open",
  location_truth_margin = 0.10,
  location_truth_min_range_fraction = 0.10,
  switch_truth_margin = 0.10,
  non_switch_min_abs = 0.10,
  non_switch_min_range_fraction = 0.10,
  temporal_category_probs = setNames(
    rep(1 / 3, 3),
    c("early", "middle", "late")
  ),
  exact_class_counts = TRUE,
  seed = seed,
  class_seed = component_seeds[["classes"]],
  constant_seed = component_seeds[["constant_effects"]],
  shape_seed = component_seeds[["functional_truth"]],
  scenario = scenario
)
effect_sim <- reassign_effect_simulation_by_maf(
  effect_sim = effect_sim,
  maf = genotype_sample$variant_info$observed_maf,
  class_probs = class_probs,
  seed = component_seeds[["classes"]],
  n_strata = 10L
)
expression_sim <- simulate_eqtl_expression_from_genotypes(
  G = G,
  beta_matrix = effect_sim$beta_matrix,
  time_grid = time_grid,
  covariates = covariates,
  expression_noise_sd = 1,
  covariate_effect_sd = 0.5,
  intercept_sd = 0,
  seed = component_seeds[["expression"]]
)

At each observed time, the genetic effect and standard error are estimated from Y ~ G + PC1 + PC2 + PC3 + PC4 + PC5. The t-statistic correction uses df = 19 - 7 = 12; FASH is fit to these estimates and corrected standard errors.

Example truth curves

Two examples are shown for each of the six functional truth cells. Points and bars are the per-time estimates and two corrected standard errors used by FASH; orange lines are the continuous truths. Shading marks the target timing window.

R3A examples

plot_truth_examples(
  example_curves$random_bspline,
  mechanism_labels[["random_bspline"]]
)
Figure 1. Representative broad random B-spline truth curves for each functional target and timing cell. Points and bars show estimated effects and two corrected standard errors, orange lines are continuous truths, and shading marks the target timing window.

Figure 1. Representative broad random B-spline truth curves for each functional target and timing cell. Points and bars show estimated effects and two corrected standard errors, orange lines are continuous truths, and shading marks the target timing window.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

R3B examples

plot_truth_examples(
  example_curves$raised_cosine,
  mechanism_labels[["raised_cosine"]]
)
Figure 2. Representative compact raised-cosine truth curves for each functional target and timing cell. Points and bars show estimated effects and two corrected standard errors, orange lines are continuous truths, and shading marks the target timing window.

Figure 2. Representative compact raised-cosine truth curves for each functional target and timing cell. Points and bars show estimated effects and two corrected standard errors, orange lines are continuous truths, and shading marks the target timing window.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

Inference procedure

At each nominal level \(\alpha\), the same procedure is applied to FASH-IWP1-Raw and FASH-IWP1-BF:

  1. Evaluate the early, middle, late, and switch functionals from posterior samples for every simulated unit.
  2. Compute the functional lfsr for each unit and target.
  3. Rank the lfsr values and call variants whose cumulative FSR is at most \(\alpha\).

Power is the fraction of true positive functionals that are called. Empirical FSR is the fraction of functional calls whose known true functional is non-positive. Curves show five-replication Monte Carlo means over the complete saved alpha grid from 0.005 through 0.20. Power panels show Raw and BF; empirical-FSR panels show BF only. BF ribbons are pointwise minima and maxima across five replications.

out <- run_genotype_level_dynamic_eqtl_simulation(
  G = G,
  time_grid = time_grid,
  covariates = covariates,
  class_probs = class_probs,
  expression_noise_sd = 1,
  covariate_effect_sd = 0.5,
  intercept_sd = 0,
  dynamic_main_effect_sd = 1,
  alpha = 0.05,
  seed = seed,
  num_cores = 4,
  num_basis = 20,
  scenario = scenario,
  save_outputs = FALSE,
  effect_sim = effect_sim,
  expression_sim = expression_sim
)

true_functionals <- effect_sim$true_functionals[
  , c("early", "middle", "late", "switch"), drop = FALSE
]
true_dynamic <- out$unit_info$effect_class == "dynamic_bspline"
functional_posterior_seed <- component_seeds[["functional_posterior"]]

raw_results <- evaluate_fash_functional_testing(
  fit = out$fash_fits$fash_iwp1_raw,
  true_functionals = true_functionals,
  evaluation_grid = evaluation_grid,
  alpha_grid = seq(0.005, 0.20, by = 0.005),
  method = "FASH-IWP1-Raw",
  switch_threshold = 0.25,
  middle_window = c(3, 12),
  middle_boundary = "open",
  true_dynamic = true_dynamic,
  candidate_scope = "full_universe",
  num_cores = 4,
  seed = functional_posterior_seed
)
bf_results <- evaluate_fash_functional_testing(
  fit = out$fash_fits$fash_iwp1_bf,
  true_functionals = true_functionals,
  evaluation_grid = evaluation_grid,
  alpha_grid = seq(0.005, 0.20, by = 0.005),
  method = "FASH-IWP1-BF",
  switch_threshold = 0.25,
  middle_window = c(3, 12),
  middle_boundary = "open",
  true_dynamic = true_dynamic,
  candidate_scope = "full_universe",
  num_cores = 4,
  seed = functional_posterior_seed
)

Raw and BF therefore use common random numbers for posterior functional summaries; their comparison is not perturbed by an avoidable difference in Monte Carlo draws.

R3A: broad random B-spline results

Results at alpha 0.05

knitr::kable(
  r3a_table,
  align = "l",
  caption = paste(
    "Table 3. Functional-testing power and empirical false sign rate at",
    "alpha 0.05 under broad random B-spline truth."
  )
)
Table 3. Functional-testing power and empirical false sign rate at alpha 0.05 under broad random B-spline truth.
Target Method Mean calls Power (95% MC CI) Empirical FSR (95% MC CI)
Early FASH-IWP1-Raw 108.0 0.253 [0.226, 0.280] 0.007 [0.000, 0.016]
Early FASH-IWP1-BF 104.2 0.244 [0.213, 0.275] 0.007 [0.000, 0.017]
Middle FASH-IWP1-Raw 399.6 0.895 [0.866, 0.924] 0.051 [0.044, 0.057]
Middle FASH-IWP1-BF 394.6 0.885 [0.856, 0.914] 0.049 [0.045, 0.054]
Late FASH-IWP1-Raw 111.8 0.263 [0.241, 0.285] 0.003 [0.000, 0.009]
Late FASH-IWP1-BF 106.8 0.251 [0.229, 0.272] 0.004 [0.000, 0.010]
Switch FASH-IWP1-Raw 582.2 0.874 [0.859, 0.888] 0.046 [0.036, 0.055]
Switch FASH-IWP1-BF 571.0 0.866 [0.849, 0.883] 0.036 [0.027, 0.044]

Power as a function of alpha

plot_mc_functional_curve_grid(
  mc_curve = r3a_alpha,
  metric = "power",
  target_order = c("early", "middle", "late", "switch"),
  alpha_reference = 0.05,
  title = "Functional-testing power: broad random B-spline truth",
  x_limits = plot_alpha_limits,
  interval_columns = c(
    "power_replication_min",
    "power_replication_max"
  ),
  interval_methods = "FASH-IWP1-BF"
)
Figure 3. Monte Carlo functional-testing power through nominal alpha 0.20 under broad random B-spline truth. The BF ribbon shows the pointwise minimum and maximum across five replications; Raw is shown without a ribbon.

Figure 3. Monte Carlo functional-testing power through nominal alpha 0.20 under broad random B-spline truth. The BF ribbon shows the pointwise minimum and maximum across five replications; Raw is shown without a ribbon.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

Empirical FSR as a function of alpha

plot_mc_functional_curve_grid(
  mc_curve = r3a_alpha[
    r3a_alpha$method == "FASH-IWP1-BF",
    ,
    drop = FALSE
  ],
  metric = "empirical_fsr",
  target_order = c("early", "middle", "late", "switch"),
  alpha_reference = 0.05,
  title = "Empirical FSR: broad random B-spline truth",
  x_limits = plot_alpha_limits,
  interval_columns = c(
    "empirical_fsr_replication_min",
    "empirical_fsr_replication_max"
  ),
  interval_methods = "FASH-IWP1-BF"
)
Figure 4. BF-adjusted Monte Carlo empirical false sign rate through nominal alpha 0.20 under broad random B-spline truth. The diagonal denotes nominal alpha, and the ribbon shows the pointwise minimum and maximum across five replications.

Figure 4. BF-adjusted Monte Carlo empirical false sign rate through nominal alpha 0.20 under broad random B-spline truth. The diagonal denotes nominal alpha, and the ribbon shows the pointwise minimum and maximum across five replications.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

R3B: compact raised-cosine results

Results at alpha 0.05

knitr::kable(
  r3b_table,
  align = "l",
  caption = paste(
    "Table 4. Functional-testing power and empirical false sign rate at",
    "alpha 0.05 under compact raised-cosine truth."
  )
)
Table 4. Functional-testing power and empirical false sign rate at alpha 0.05 under compact raised-cosine truth.
Target Method Mean calls Power (95% MC CI) Empirical FSR (95% MC CI)
Early FASH-IWP1-Raw 19.0 0.044 [0.031, 0.057] 0.013 [0.000, 0.050]
Early FASH-IWP1-BF 13.8 0.032 [0.017, 0.047] 0.018 [0.000, 0.069]
Middle FASH-IWP1-Raw 35.8 0.082 [0.064, 0.099] 0.034 [0.000, 0.073]
Middle FASH-IWP1-BF 27.4 0.062 [0.046, 0.078] 0.046 [0.000, 0.099]
Late FASH-IWP1-Raw 21.0 0.050 [0.024, 0.075] 0.000 [0.000, 0.000]
Late FASH-IWP1-BF 15.4 0.036 [0.019, 0.053] 0.000 [0.000, 0.000]
Switch FASH-IWP1-Raw 393.4 0.596 [0.559, 0.633] 0.036 [0.025, 0.047]
Switch FASH-IWP1-BF 339.4 0.521 [0.484, 0.558] 0.024 [0.016, 0.032]

Power as a function of alpha

plot_mc_functional_curve_grid(
  mc_curve = r3b_alpha,
  metric = "power",
  target_order = c("early", "middle", "late", "switch"),
  alpha_reference = 0.05,
  title = "Functional-testing power: compact raised-cosine truth",
  x_limits = plot_alpha_limits,
  interval_columns = c(
    "power_replication_min",
    "power_replication_max"
  ),
  interval_methods = "FASH-IWP1-BF"
)
Figure 5. Monte Carlo functional-testing power through nominal alpha 0.20 under compact raised-cosine truth. The BF ribbon shows the pointwise minimum and maximum across five replications; Raw is shown without a ribbon.

Figure 5. Monte Carlo functional-testing power through nominal alpha 0.20 under compact raised-cosine truth. The BF ribbon shows the pointwise minimum and maximum across five replications; Raw is shown without a ribbon.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

Empirical FSR as a function of alpha

plot_mc_functional_curve_grid(
  mc_curve = r3b_alpha[
    r3b_alpha$method == "FASH-IWP1-BF",
    ,
    drop = FALSE
  ],
  metric = "empirical_fsr",
  target_order = c("early", "middle", "late", "switch"),
  alpha_reference = 0.05,
  title = "Empirical FSR: compact raised-cosine truth",
  x_limits = plot_alpha_limits,
  interval_columns = c(
    "empirical_fsr_replication_min",
    "empirical_fsr_replication_max"
  ),
  interval_methods = "FASH-IWP1-BF"
)
Figure 6. BF-adjusted Monte Carlo empirical false sign rate through nominal alpha 0.20 under compact raised-cosine truth. The diagonal denotes nominal alpha, and the ribbon shows the pointwise minimum and maximum across five replications.

Figure 6. BF-adjusted Monte Carlo empirical false sign rate through nominal alpha 0.20 under compact raised-cosine truth. The diagonal denotes nominal alpha, and the ribbon shows the pointwise minimum and maximum across five replications.

Version Author Date
09f63bc Ziang Zhang 2026-08-24
c87957a Ziang Zhang 2026-08-10

Non-dynamic proportion

formal_class_counts <- c(dynamic = 1272L, constant = 2545L, zero = 2545L)
formal_true_pi0 <- sum(formal_class_counts[c("constant", "zero")]) /
  sum(formal_class_counts)

The exact proportion of constant or zero-effect units is \(\pi_0=5090/6362\approx\) 0.8001. The table reports the fitted constant-component weights for the raw and BF-adjusted IWP fits.

knitr::kable(
  pi0_table,
  align = "l",
  caption = paste(
    "Table 5. Estimated non-dynamic proportions for raw and",
    "BF-updated IWP FASH under both functional truth mechanisms."
  )
)
Table 5. Estimated non-dynamic proportions for raw and BF-updated IWP FASH under both functional truth mechanisms.
Mechanism Fit Mean estimated pi0 (95% MC CI)
R3A: broad random B-spline Raw 0.757 [0.713, 0.802]
R3A: broad random B-spline BF-corrected 0.848 [0.846, 0.850]
R3B: compact raised cosine Raw 0.733 [0.697, 0.768]
R3B: compact raised cosine BF-corrected 0.913 [0.911, 0.916]

Reproducibility

The versioned cache was generated by code/revision_simulations/r3_r4_fashr0143/22_r3_full_universe_functional_fashr0143.R using the frozen driver and simulation functions under code/revision_simulations/r3_r4_fashr0143/source_snapshots/. Page-specific cache loading, validation, and formatting are in code/revision_simulations/r3_functional_testing/reporting.R.

From the Midway3 workspace, rerun the simulation with:

sbatch slurm/22_r3_full_universe_functional_fashr0143.sbatch

Routine workflowr builds read the saved cache and do not rerun the simulation:

output/revision_simulations/mc/r3_real_genotype_one_per_gene_J6362_matched_functional_open_middle_3_12_center_aligned_equal_cells_relative_location_clearance_full_universe_paired_posterior_fashr0143_pilot5/

sessionInfo()
R version 4.5.1 (2025-06-13)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.6.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] workflowr_1.7.2

loaded via a namespace (and not attached):
 [1] vctrs_0.7.3       httr_1.4.7        cli_3.6.6         knitr_1.50       
 [5] rlang_1.2.0       xfun_0.55         stringi_1.8.9     otel_0.2.0       
 [9] processx_3.8.6    promises_1.5.0    jsonlite_2.0.0    glue_1.8.1       
[13] rprojroot_2.1.1   git2r_0.36.2      htmltools_0.5.9   httpuv_1.6.16    
[17] ps_1.9.1          sass_0.4.10       rmarkdown_2.30    jquerylib_0.1.4  
[21] tibble_3.3.0      evaluate_1.0.5    fastmap_1.2.0     yaml_2.3.12      
[25] lifecycle_1.0.5   whisker_0.4.1     stringr_1.6.0     compiler_4.5.1   
[29] fs_1.6.6          pkgconfig_2.0.3   Rcpp_1.1.1-1.1    rstudioapi_0.17.1
[33] later_1.4.4       digest_0.6.39     R6_2.6.1          pillar_1.11.1    
[37] callr_3.7.6       magrittr_2.0.5    bslib_0.9.0       tools_4.5.1      
[41] cachem_1.1.0      getPass_0.2-4