Step 2 of HEART. Given target-only p-values \(p_{tar,j}\) and decorrelated p-values \(p_{de,j}\) for \(J\) variants (typically genome-wide), this function
estimates the four-group proportions (
heart_pi_estimate()),estimates the tail parameters \((\alpha_1, C_1)\) from \(p_{tar}\) and \((\alpha_2, C_2)\) from \(p_{de}\) (
heart_tail_estimate()),computes the HEART statistic \(T_j\) (
heart_statistic()),estimates its composite null distribution (
heart_null_cdf()), andreturns HEART p-values, FDR q-values and FWER-adjusted p-values.
Arguments
- p_tar, p_de
Target-only and decorrelated p-values (same length).
- alpha
Nominal FDR / FWER level used for the
reject_*columns.- snp
Optional variant identifiers.
- par
Optional list of model parameters (
pi00,pi01,pi10,alpha1,alpha2,C1,C2, and optionallypi11) to bypass estimation.- tail_k, pi0_cap, alpha_bounds, C_bounds
Passed to
heart_tail_estimate().- lambdas
Passed to
heart_pi_estimate().- p_min
P-values are bounded below by
p_minto avoidlog(0).- exact, n_exact, n_grid
Passed to
heart_null_cdf().
Value
An object of class "heart": a list with
resultsdata.frame with
snp,p_tar,p_de,log_T,p_heart,q_heart,padj_fwer,reject_fdr,reject_fwer.parEstimated parameters.
alpha,n_testsLevel and number of valid tests.
Details
The FDR procedure rejects \(\{j: T_j \le \hat t_\alpha\}\) with
\(\hat t_\alpha = \sup\{t: \hat N(t)/\bar F(t) \le \alpha\}\); equivalently
q_heart <= alpha. The FWER procedure rejects
\(\{j: \hat N(T_j) \le \alpha/J\}\); equivalently padj_fwer <= alpha.
The per-variant HEART p-value is \(\hat F_0(T_j)\), the estimated
composite-null CDF evaluated at the observed statistic, which can be used
e.g. for Manhattan plots with a genome-wide threshold.
The parameters must be estimated from all variants jointly; when variants
are analysed in chunks with heart_assoc(), combine the chunks before
calling heart_test().
Examples
sim <- heart_simulate(n_tar = 1500, n_src = 6000, J = 1000, seed = 1)
fit <- heart_assoc(sim$Y, sim$G, sim$D, sim$X)
res <- heart_test(fit$p_tar, fit$p_de_pooled, snp = fit$snp)
res
#> HEART: Heterogeneity-aware Empowerment via Adaptive Robust Transfer
#> tests: 1000
#> four-group proportions: pi00 = 0.8100, pi01 = 0.0750, pi10 = 0.1150, pi11 = 0.0000
#> tail parameters: alpha1 = 0.401, C1 = 1.014, alpha2 = 0.095, C2 = 1.020
#> discoveries at level 0.05: FDR = 6, FWER = 2 (target-only BH = 2, Bonferroni = 0)