Computes gene-wise interaction statistics using limma for the difference in group effects
between ancestries (ancestry X minus ancestry Y), matching the logic of
perm_interaction
.
Usage
limma_interaction_effect(
X,
Y,
MX,
MY,
g_col,
a_col,
covariates = NULL,
use_voom = TRUE,
verbose = TRUE
)
Arguments
- X
Expression matrix for ancestry X. Rows = samples, columns = genes.
- Y
Expression matrix for ancestry Y. Rows = samples, columns = genes.
- MX
Metadata for X. Must include group and ancestry columns.
- MY
Metadata for Y. Must include group and ancestry columns.
- g_col
Name of the column indicating group (factor 1).
- a_col
Name of the column indicating ancestry (factor 2).
- covariates
Optional vector of covariate column names to adjust for.
- verbose
Logical, whether to print messages.
Value
A list with:
- summary_stats
A data.frame with gene-level interaction coefficients, p-values, FDR, and confidence intervals.
- fit
The full limma model fit.
- group_levels
Factor levels used for group variable.
- ancestry_levels
Factor levels used for ancestry variable.
- coef
Name of the interaction coefficient extracted.