--- title: "GO Enrichment Analysis (2024-04-08)" author: "Young June Kim" date: "4/8/2024" output: html_document --- As a first step, we need to load the required R packages ```{r} # Load libraries library(tidyverse) library(DESeq2) library(apeglm) library(EnhancedVolcano) library(tidyverse) library(homologene) # load the mouse gene annotations library(org.Mm.eg.db) library(clusterProfiler) library(AnnotationDbi) library(DescTools) library(ggtree) library(rlang) install.packages("rlang") BiocManager::install("AnnotationDbi") BiocManager::install("ggtree") BiocManager::install("enrichplot") BiocManager::install("clusterProfiler") ``` We will focus our analysis first on the rhythmic genes for males and females, from the MetaCycle results. For this .rmd file, we will perform GO enrichment for the male and female rhythmic genes. ```{r} # Load the metaCycle files containing the rhythmic genes male_metaCycle <- read.csv("~/Circadian_Rhythms/metaout_20231106/meta2d_DESeq2_normalized_male_counts_20231106.csv") female_metaCycle <- read.csv("~/Circadian_Rhythms/metaout_20231106/meta2d_DESeq2_normalized_female_counts_20231106.csv") # Load the male and female rhythmic genes male_cycling_BH.Q <- male_metaCycle %>% filter(meta2d_BH.Q < 0.05) %>% pull(CycID) female_cycling_BH.Q <- female_metaCycle %>% filter(meta2d_BH.Q < 0.05) %>% pull(CycID) # Find the common genes that cycle between males and females common_cycling_BH.Q <- intersect(male_cycling_BH.Q, female_cycling_BH.Q) ```