Last updated: 2026-08-22
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 c87957a. 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/figure/
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/
Untracked files:
Untracked: analysis/dynamic_eQTL_real_cl.rmd
Untracked: analysis/nonlinear_dynamic_eQTL_real_cl.Rmd
Untracked: analysis/revision_enhancer_enrichment_cl.rmd
Untracked: analysis/revision_internal_evaluation_grid_mc_sensitivity.rmd
Untracked: analysis/revision_internal_evaluation_grid_mc_sensitivity_middle_4_11.rmd
Untracked: analysis/revision_internal_fash_cl_manuscript_impact.rmd
Untracked: analysis/revision_internal_fash_discovery_variant_count.rmd
Untracked: analysis/revision_internal_fash_linear_real_data_ablation.rmd
Untracked: analysis/revision_internal_fashr_correlated_observation_model.rmd
Untracked: analysis/revision_internal_matched_fash_linear_real_data.rmd
Untracked: analysis/revision_internal_matched_fash_linear_real_data_cl.rmd
Untracked: analysis/revision_internal_r1_normality_assumption.rmd
Untracked: analysis/revision_internal_small_m_clean_working_null_sensitivity.rmd
Untracked: analysis/revision_internal_small_m_matched_null_eb_sensitivity.rmd
Untracked: analysis/revision_internal_twenty_variant_per_gene_refit.rmd
Untracked: apps/
Untracked: code/02_dyn_lfsr.R
Untracked: code/02_dyn_lfsr.sbatch
Untracked: code/revision_simulations/appendix_b/
Untracked: code/revision_simulations/internal/cl_pc_real_data_pages/
Untracked: code/revision_simulations/internal/covariance_estimation/run_design_propagated_null_correlation.R
Untracked: code/revision_simulations/internal/covariance_estimation/run_multigene_null_beta_covariance_exploration.R
Untracked: code/revision_simulations/internal/early_window_sensitivity/
Untracked: code/revision_simulations/internal/evaluation_grid_sensitivity/
Untracked: code/revision_simulations/internal/fash_cl_manuscript_impact/
Untracked: code/revision_simulations/internal/fash_discovery_variant_count/
Untracked: code/revision_simulations/internal/fash_linear_real_data_ablation/
Untracked: code/revision_simulations/internal/fash_strober_enhancer_comparison_cl/
Untracked: code/revision_simulations/internal/matched_fash_linear_real_data/
Untracked: code/revision_simulations/internal/matched_fash_linear_real_data_cl/
Untracked: code/revision_simulations/internal/r0_linear_iwp_power_mechanism/
Untracked: code/revision_simulations/internal/r0_linear_summary_statistic/
Untracked: code/revision_simulations/internal/r1_known_truth_genotype_permutation/
Untracked: code/revision_simulations/internal/r1_linear_truth_composition/
Untracked: code/revision_simulations/internal/r1_normality_assumption/
Untracked: code/revision_simulations/internal/residual_correlation_fash/
Untracked: code/revision_simulations/internal/selected_signal_genotype_permutation/
Untracked: code/revision_simulations/r1_r2_fashr0143/
Untracked: code/revision_simulations/r5_one_variant_per_gene/
Untracked: code/revision_simulations/shared/build_real_genotype_one_per_gene_cache.R
Untracked: code/revision_simulations/shared/real_genotype_one_per_gene.R
Untracked: code/revision_simulations/shared/test_linear_mixture_fash.R
Untracked: code/revision_simulations/shared/test_real_genotype_one_per_gene.R
Untracked: code/revision_simulations/shared/validate_r1_r2_linear_mixture_pairing.R
Untracked: code/revision_simulations/shared/validate_r1_r2_real_genotype_pairing.R
Untracked: figure/
Unstaged changes:
Modified: analysis/appendixB.rmd
Modified: analysis/dynamic_eQTL_real.rmd
Modified: analysis/index.Rmd
Modified: analysis/nonlinear_dynamic_eQTL_real.Rmd
Modified: analysis/revision_balanced_variant_thinning.rmd
Modified: analysis/revision_combined_spiky_genotype_simulation.rmd
Modified: analysis/revision_enhancer_enrichment.rmd
Modified: analysis/revision_functional_testing_simulation.rmd
Modified: analysis/revision_genotype_level_simulation.rmd
Modified: code/revision_simulations/README.md
Modified: code/revision_simulations/internal/covariance_estimation/run_global_pca_factor_visualization.R
Modified: code/revision_simulations/internal/fash_strober_enhancer_comparison/enrichment_api.R
Modified: code/revision_simulations/internal/fash_strober_enhancer_comparison/reporting.R
Modified: code/revision_simulations/internal/fash_strober_enhancer_comparison/run_fash_strober_enhancer_comparison.R
Modified: code/revision_simulations/r1_random_bspline/reporting.R
Modified: code/revision_simulations/r1_random_bspline/run_random_bspline_mc_replication.R
Modified: code/revision_simulations/r2_spiky_transient/reporting.R
Modified: code/revision_simulations/r2_spiky_transient/run_combined_spiky_genotype_simulation.R
Modified: code/revision_simulations/r2_spiky_transient/run_spiky_transient_mc_replication.R
Modified: code/revision_simulations/r3_functional_testing/reporting.R
Modified: code/revision_simulations/r3_functional_testing/run_matched_functional_testing_mc_replication.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_genotype_level_simulation.rmd) and HTML
(docs/revision_genotype_level_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 | 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 |
This real-genotype simulation uses random cubic B-spline dynamic effects as a non-IWP data-generating mechanism. It is the broad, smoothly varying baseline; the separate spiky transient analysis examines sharply localized effects.
The FASH-IWP1 and FASH-linear rows were recomputed on the same five
fixed simulation seeds with fashr 0.1.43 at RemoteSha
bf223df75da6e41ae48607a56b4cd12d7c3b24e7. The targeted
result family completed at 2026-08-22 06:47:48 UTC. The
direct-interaction permutation tests were not rerun: their rows come
from the unchanged formal historical cache. Before combining the rows,
the report verifies every retained SHA-256 digest and requires exact
selected-pair/genotype agreement plus numerical agreement of the
simulated inputs to 1e-12.
knitr::kable(
result_provenance_table,
align = "l",
caption = paste(
"Table R1.1: Computation source and validation status for each result",
"component in the refreshed page."
)
)
| Result component | Retained source | Software provenance | Status |
|---|---|---|---|
| FASH-IWP1 and FASH-linear, Raw and BF | Targeted R1/R2 0.1.43 cache | fashr 0.1.43 @ bf223df75da6 | Recomputed on Midway3 |
| Direct linear and quadratic interaction eFDR | Historical R1 formal cache | Historical direct LRT/eFDR cache; unchanged | Reused; not rerun |
| Representative seed-12345 simulation | Historical R1 formal cache | Numerically paired to the retained 0.1.43 payload | Strict pairing check passed |
For donor \(i\), variant \(j\), and time \(t\), expression is generated as
\[ 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.
The resulting design has one locus-level unit per gene and an empirical
MAF distribution; a variant tested for 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"]]
)
knitr::kable(
genotype_provenance_table,
align = "l",
caption = "Table R1.2: Provenance and selection rule for the real-genotype simulation design."
)
| Artifact | File | Size (bytes) | MD5 |
|---|---|---|---|
| YRI genotype VCF | YRI_genotype.vcf.gz | 118,088,371 | 4f9eb383ce3512d867b42ab806d451a8 |
| Paper gene-variant summary | eqtl_summary.rds | 93,591,244 | 23e7f6a0093309059424207872dfa1e0 |
| Shared genotype cache | genotype_samples.rds | 2,788,231 | 37a620ab8a99aeb16d2b977d0bbc2099 |
knitr::kable(
genotype_sampling_table,
align = "l",
caption = paste(
"Table R1.3: 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 simulated dataset has 19 donors, 16
time points, 6,362 gene-level units, and five PC-like
covariates. The classes are fixed at:
For a dynamic variant,
\[ \beta_j(t) = \mu_j + h_j(t), \qquad \mu_j \sim N(0,1), \qquad h_j(t) = \sum_{k=1}^{6} b_{jk} B_k(t), \qquad b_{jk} \stackrel{\mathrm{iid}}{\sim} N(0,1). \]
Only the time-varying deviation \(h_j(t)\) is mean-centered over the observed
times and scaled to have maximum absolute value 2. The
independent \(\mu_j\) is the genetic
main effect, so the final trajectory is not constrained to be centered
at zero. With exact integer class counts, the true dynamic-null
proportion is \(\pi_0 = 5090/6362 =\)
0.8001.
class_probs <- c(
dynamic_bspline = 0.20,
constant = 0.40,
zero = 0.40
)
effect_sim <- simulate_variant_effect_curves(
n_variants = 6362,
time_grid = 0:15,
class_probs = class_probs,
dynamic_amplitude = 2,
bspline_df = 6,
bspline_coefficient_sd = 1,
constant_sd = 1,
dynamic_main_effect_sd = 1,
exact_class_counts = TRUE,
seed = component_seeds[["functional_truth"]],
scenario = "r1_real_genotype_one_per_gene_random_bspline_main_effect_dynamic_eqtl"
)
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 = 10
)
expression_sim <- simulate_eqtl_expression_from_genotypes(
G = G,
beta_matrix = effect_sim$beta_matrix,
time_grid = 0:15,
covariates = covariates,
expression_noise_sd = 1,
covariate_effect_sd = 0.5,
intercept_sd = 0,
seed = component_seeds[["expression"]]
)
At each time point, the genetic effect and its standard error are
estimated from Y ~ G + PC1 + PC2 + PC3 + PC4 + PC5. The
real-data-like t-statistic standard-error correction uses
\[ \mathrm{df} = 19 - 7 = 12, \]
corresponding to the intercept, genotype, and five covariates. All methods use the same per-time estimates and corrected standard errors.
eqtl_summary <- estimate_eqtl_summaries_from_genotypes(
G = G,
expression = expression_sim$expression,
covariates = covariates,
apply_t_se_correction = TRUE
)
datasets <- make_fash_datasets_from_eqtl_summary(
beta_hat = eqtl_summary$beta_hat,
se = eqtl_summary$se,
true_beta = effect_sim$beta_matrix,
time_grid = 0:15,
unit_info = effect_sim$unit_info,
scenario = "r1_real_genotype_one_per_gene_random_bspline_main_effect_dynamic_eqtl"
)
common_sd_grid <- default_revision_grid()
common_pred_step <- 1
common_penalty <- 10
fash_iwp1_raw <- fashr::fash(
Y = "y",
smooth_var = "x",
S = "sd",
data_list = datasets,
order = 1,
grid = common_sd_grid,
num_basis = 20,
pred_step = common_pred_step,
penalty = common_penalty,
num_cores = 4,
verbose = FALSE
)
fash_iwp1_bf <- fashr::BF_update(fash_iwp1_raw, plot = FALSE)
fash_linear_raw <- fit_linear_mixture_fash(
datasets = datasets,
grid = common_sd_grid,
pred_step = common_pred_step,
penalty = common_penalty
)
fash_linear_bf <- BF_update_linear_mixture_fash(fash_linear_raw)
The reported curves and tables average five independently simulated
datasets with seeds 12345, 22345,
32345, 42345, and 52345. The full
seed-12345 object is used only to display representative
trajectories.
Truth labels are reassigned within empirical-MAF deciles so that dynamic, constant, and zero-effect units have closely matched MAF distributions.
knitr::kable(
truth_maf_balance_table,
align = "l",
caption = "Table R1.4: Empirical MAF balance across truth classes for each simulation seed."
)
| Truth class | Units per seed | Mean MAF across seeds | Maximum absolute MAF SMD |
|---|---|---|---|
| Dynamic | 1,272 | 0.270 | 0.0010 |
| Constant | 2,545 | 0.270 | 0.0034 |
| Zero | 2,545 | 0.270 | 0.0031 |
The panels show three zero-effect variants, three constant eQTLs, and three random B-spline dynamic eQTLs. Points are per-time genetic effect estimates, bars show two corrected standard errors, and red lines are the true effects.
plot_genotype_eqtl_examples(
out,
classes = c("zero", "constant", "dynamic_bspline"),
n_per_class = 3,
seed = 1,
true_curve_n = 500
)
Figure R1.1: Representative zero-effect, constant-effect, and random B-spline dynamic eQTLs from seed 12345. Points are estimated genetic effects, vertical bars span two corrected standard errors, and red curves are the true effects.
| Version | Author | Date |
|---|---|---|
| c87957a | Ziang Zhang | 2026-08-10 |
This comparison aligns the exact null, scale grid,
pred_step, and null-favoring penalty.
FASH-IWP1 uses the first-order IWP alternative. For
FASH-linear, let \(h=1\)
and \(z(t)=\{t-\min(t)\}/h\). Its prior
is
\[ \beta_j(t)=a_j+\theta_j z(t), \qquad \theta_j\sim\pi_0\delta_0+ \sum_{k=1}^{K}\pi_k N(0,\tau_k^2). \]
The zero-grid component is the same unrestricted constant null used
by IWP1. For each positive component, \(\tau_k\) is the prior SD of the linear
departure at \(\min(t)+h\). The
complete grid is one exact zero plus 51 positive values from \(\exp(-5)\) to 1; all weights
are estimated jointly with penalty = 10. IWP1 uses the same
numerical grid for its one-step predictive SD. This matches the one-step
marginal scale while leaving the linear and IWP covariance shapes
different.
The BF update does not retain the raw penalized non-null weights.
Following fashr::BF_update(), it re-fits an unpenalized
full-grid mixture, normalizes the positive-grid weights to define the
conditional alternative, collapses that alternative into a Bayes factor,
and then updates the total null weight. The table below summarizes both
the number of active positive-grid components and their conditional RMS
pred-step SD.
The table reports the fitted prior weight on each method’s constant component. The true finite-simulation dynamic-null proportion is \(\pi_0 = 5090/6362 =\) 0.8001.
knitr::kable(
pi0_table,
align = "l",
caption = paste(
"Table R1.5: Estimated dynamic-null proportions and linear-mixture prior",
"diagnostics across five random B-spline simulation replicates."
)
)
| Method | Fit | Mean estimated pi0 (95% MC CI) | Active non-null components: mean [range] | Alternative RMS pred-step SD: mean [range] |
|---|---|---|---|---|
| FASH-IWP1 | Raw | 0.764 [0.730, 0.798] | — | — |
| FASH-IWP1 | BF-corrected | 0.837 [0.835, 0.839] | — | — |
| FASH-linear | Raw | 0.794 [0.786, 0.801] | 2.0 [2, 2] | 0.105 [0.103, 0.109] |
| FASH-linear | BF-corrected | 0.912 [0.909, 0.915] | 2.0 [2, 2] | 0.105 [0.103, 0.109] |
knitr::kable(
fash_table,
align = "l",
caption = paste(
"Table R1.6: Monte Carlo power and empirical FDR at alpha 0.05 for IWP",
"and linear FASH under random B-spline effects."
)
)
| Method | Mean discoveries | Power (95% MC CI) | Empirical FDR: E[FDP] (95% MC CI) |
|---|---|---|---|
| FASH-IWP1-Raw | 1263.0 | 0.940 [0.929, 0.952] | 0.053 [0.045, 0.061] |
| FASH-IWP1-BF | 1230.0 | 0.931 [0.920, 0.942] | 0.038 [0.033, 0.042] |
| FASH-linear-Raw | 698.0 | 0.520 [0.501, 0.539] | 0.052 [0.040, 0.064] |
| FASH-linear-BF | 615.8 | 0.472 [0.457, 0.487] | 0.025 [0.017, 0.033] |
plot_mc_alpha_curves(
fash_alpha,
metric = "power",
title = "IWP versus linear FASH: Monte Carlo power",
subtitle = "Five seeds; real YRI genotypes; N = 19, J = 6362 genes",
style_profile = "combined"
)
Figure R1.2: Monte Carlo power across nominal alpha for IWP and linear FASH under random B-spline effects. Curves identify the raw and BF-updated methods shown in the in-figure legend; uncertainty summarizes five simulation seeds.
| Version | Author | Date |
|---|---|---|
| c87957a | Ziang Zhang | 2026-08-10 |
plot_mc_alpha_curves(
fash_alpha,
metric = "fdr",
title = "IWP versus linear FASH: Monte Carlo empirical FDR",
subtitle = "Five seeds; real YRI genotypes; N = 19, J = 6362 genes",
legend_position = "topleft",
style_profile = "combined"
)
Figure R1.3: Monte Carlo empirical FDR across nominal alpha for IWP and linear FASH under random B-spline effects. Curves identify methods in the in-figure legend, and the diagonal reference marks equality between empirical FDR and nominal alpha.
| Version | Author | Date |
|---|---|---|
| c87957a | Ziang Zhang | 2026-08-10 |
At \(\alpha = 0.05\), IWP-Raw and IWP-BF have mean power 0.940 and 0.931, compared with 0.520 and 0.472 for the corresponding linear fits. Their empirical FDR estimates are 0.053 and 0.038 for IWP-Raw and IWP-BF, and 0.052 and 0.025 for linear-Raw and linear-BF. These values are paired across the same five simulated datasets; they are pilot empirical-FDR summaries rather than a claim of general calibration.
The direct baselines fit individual-level expression using linear or
linear-plus-quadratic genotype-by-time interactions and use
permutation-based eFDR. To make this comparison favorable to the direct
methods, their eFDR calculation is supplied with the true \(\pi_0 = 5090/6362\) and uses
B = 100 donor-level permutations per replicate.
Only the IWP FASH rows in this section were recomputed with
fashr 0.1.43. The direct linear and quadratic rows are read
unchanged from the historical formal cache after the report confirms
that its simulated genotype, covariates, truth, and expression agree
with the retained 0.1.43 payload.
out <- add_direct_interaction_efdr_results_to_genotype_output(
out = out,
n_permutations = 100,
alpha = 0.05,
seed = seed + 10000L,
lambda = 0.5,
pi0_method = "conservative",
true_pi0 = 5090 / 6362,
include_true_pi0 = TRUE,
permute_covariates_with_expression = TRUE,
num_cores = 4,
overwrite = TRUE,
verbose = FALSE
)
knitr::kable(
direct_table,
align = "l",
caption = paste(
"Table R1.7: Monte Carlo power and empirical FDR at alpha 0.05 for IWP",
"FASH and direct interaction tests under random B-spline effects."
)
)
| Method | Mean discoveries | Power (95% MC CI) | Empirical FDR: E[FDP] (95% MC CI) |
|---|---|---|---|
| FASH-IWP1-Raw | 1263.0 | 0.940 [0.929, 0.952] | 0.053 [0.045, 0.061] |
| FASH-IWP1-BF | 1230.0 | 0.931 [0.920, 0.942] | 0.038 [0.033, 0.042] |
| Direct-linear-LRT-eFDR-true-pi0 | 654.6 | 0.508 [0.494, 0.522] | 0.012 [0.008, 0.017] |
| Direct-quadratic-LRT-eFDR-true-pi0 | 1009.8 | 0.788 [0.771, 0.804] | 0.008 [0.006, 0.009] |
plot_mc_alpha_curves(
direct_alpha,
metric = "power",
title = "IWP FASH versus direct interaction: Monte Carlo power",
subtitle = "Five seeds; direct eFDR uses true pi0 = 0.8001 and B = 100 permutations",
style_profile = "combined"
)
Figure R1.4: Monte Carlo power across nominal alpha for IWP FASH and direct linear or quadratic interaction tests. The in-figure legend identifies methods; direct-test eFDR uses the true pi0 and 100 donor-level permutations.
| Version | Author | Date |
|---|---|---|
| c87957a | Ziang Zhang | 2026-08-10 |
plot_mc_alpha_curves(
direct_alpha,
metric = "fdr",
title = "IWP FASH versus direct interaction: Monte Carlo empirical FDR",
subtitle = "Five seeds; direct eFDR uses true pi0 = 0.8001 and B = 100 permutations",
legend_position = "bottomright",
style_profile = "combined"
)
Figure R1.5: Monte Carlo empirical FDR across nominal alpha for IWP FASH and direct interaction tests. The in-figure legend identifies methods, and the diagonal reference marks equality between empirical FDR and nominal alpha.
| Version | Author | Date |
|---|---|---|
| c87957a | Ziang Zhang | 2026-08-10 |
At \(\alpha = 0.05\), IWP-BF has mean power 0.931, compared with 0.508 for the direct linear test and 0.788 for the direct quadratic test. IWP-BF has the highest power while maintaining mean empirical FDR 0.038. The direct tests are more conservative but less powerful, even with the true null proportion supplied.
For broad random B-spline effects, the tables and curves above compare IWP and linear covariance shapes after matching their exact null, one-step SD grid, and null-favoring penalty. R1 and R2 are exactly paired on their sampled gene-variant units and real genotype matrices for every seed; only their simulated effect geometries differ. The separate spiky transient page applies the same comparison to sharply localized one-, two-, and three-peak effects.
The R1 simulation driver uses the shared simulation functions. Real-genotype selection, dosage extraction, validation, and MAF-balanced truth assignment are implemented in the shared real-genotype helper, and the versioned input cache is created by the shared cache builder. The page-specific cache validation and formatting are in R1 reporting code. The shared 0.1.43 reporting overlay validates the completed targeted cache and combines its FASH rows with only the direct rows from the historical cache. The following command regenerates the full historical-style Monte Carlo cache, including direct tests. It is shown for reproducibility but is intentionally not evaluated during workflowr builds; the displayed FASH rows read the separate targeted 0.1.43 cache.
The full Monte Carlo cache can be regenerated with:
Rscript --vanilla \
code/revision_simulations/shared/build_real_genotype_one_per_gene_cache.R
Rscript --vanilla \
code/revision_simulations/r1_random_bspline/run_random_bspline_mc_replication.R \
--J 6362 \
--n-donors 19 \
--n-covariates 5 \
--noise-sd 1 \
--dynamic-main-effect-sd 1 \
--efdr-permutations 100 \
--seed-list 12345,22345,32345,42345,52345 \
--genotype-cache output/revision_simulations/shared/real_genotype_one_per_gene_J6362_pilot5/genotype_samples.rds \
--output-id r1_real_genotype_one_per_gene_J6362_random_bspline_main_effect_linear_mixture_predstep1_penalty10_pilot5 \
--num-cores 4
After the formal R1-R3 caches have been generated, exact pairing of every sampled gene-variant unit and genotype matrix is validated with:
Rscript --vanilla \
code/revision_simulations/shared/validate_r1_r2_real_genotype_pairing.R \
--r1-output-id r1_real_genotype_one_per_gene_J6362_random_bspline_main_effect_linear_mixture_predstep1_penalty10_pilot5 \
--r2-output-id r2_real_genotype_one_per_gene_J6362_timed_cosine_one_two_three_peak_main_effect_linear_mixture_predstep1_penalty10_pilot5 \
--r3-output-id r3_real_genotype_one_per_gene_J6362_matched_functional_relative_clearance_main_effect_pilot5
The report requires a successful
summary/real_genotype_pairing_validation.csv artifact and
will stop if the R1/R2/R3 genotype designs are not exactly paired.
The recomputed FASH result family is stored under:
output/revision_simulations/mc/r1_r2_fashr0143/
The unchanged historical full fit and direct-interaction results are stored under:
output/revision_simulations/mc/r1_real_genotype_one_per_gene_J6362_random_bspline_main_effect_linear_mixture_predstep1_penalty10_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