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
.
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.
- a_col
Name of the column indicating ancestry.
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.