This function identifies truly sex-specific and sex-dimorphic genes by analyzing differential expression results from both sexes.
identify_sex_specific_genes(
male_results,
female_results,
target_fdr = 0.05,
exclude_fdr = 0.5
)A data frame with identified genes categorized as: - male-specific: significant in males, not significant in females - female-specific: significant in females, not significant in males - sex-dimorphic: significant in both sexes with opposite effects - sex-shared: significant in both sexes with same direction Including columns for gene IDs, logFC values, and FDR values for both sexes.
Data frame of differential expression results for males (from differential_expression).
Data frame of differential expression results for females (from differential_expression).
Numeric. FDR threshold for significant differential expression (default: 0.05).
Numeric. FDR threshold for excluding effects in the opposite sex (default: 0.5).
This function implements a two-step approach to identify sex-specific effects: 1. Identifies genes significantly affected in one sex (target_fdr) 2. Confirms lack of effect in the other sex (exclude_fdr) Additionally identifies genes with opposite (dimorphic) or same (shared) effects in both sexes.