Learn R Programming

XYomics (version 0.1.2)

sex_interaction_analysis_bulk: Perform Sex-Phenotype Interaction Analysis for Bulk Data (Interaction Term)

Description

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`).

Usage

sex_interaction_analysis_bulk(
  x,
  phenotype,
  gender,
  phenotype_labels = c("WT", "TG"),
  sex_labels = c("F", "M")
)

Value

A data frame with differential expression statistics for the interaction term, including logFC, t-statistic, P-value, and adjusted P-value.

Arguments

x

A numeric matrix of expression data (features x samples).

phenotype

A character or factor vector indicating the condition for each sample.

gender

A character or factor vector indicating the sex for each sample.

phenotype_labels

Character vector. Labels for phenotype groups (default: c("WT", "TG")).

sex_labels

Character vector. Labels for sexes (default: c("F", "M")).

Details

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.