This function performs a formal interaction analysis on bulk expression data to identify genes whose expression is significantly modulated by the interaction between sex and a given phenotype/condition. It uses a linear model with a multiplicative interaction term (`phenotype * sex`).
sex_interaction_analysis_bulk(
x,
phenotype,
gender,
phenotype_labels = c("WT", "TG"),
sex_labels = c("F", "M")
)A data frame with differential expression statistics for the interaction term, including logFC, t-statistic, P-value, and adjusted P-value.
A numeric matrix of expression data (features x samples).
A character or factor vector indicating the condition for each sample.
A character or factor vector indicating the sex for each sample.
Character vector. Labels for phenotype groups (default: c("WT", "TG")).
Character vector. Labels for sexes (default: c("F", "M")).
This function constructs a design matrix that includes a formal interaction term between the phenotype and sex (e.g., `~ phenotype * sex`). It then uses `limma` to test for genes where the effect of the phenotype differs significantly between sexes. This is a statistically rigorous approach to identify sex-modulated genes.