Last updated: 2020-10-15

Checks: 7 0

Knit directory: Blancetal/analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20200217) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 6797660. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/.DS_Store
    Ignored:    data/quaint-results.rda
    Ignored:    output/.DS_Store

Untracked files:
    Untracked:  data/Frey_Cold.txt
    Untracked:  data/Frey_Cold.txt~
    Untracked:  data/schaefer_clusters.csv~
    Untracked:  figures/Supplement_Ve.png
    Untracked:  figures/phist.png
    Untracked:  output/Genenames_0.05.txt

Unstaged changes:
    Modified:   analysis/Environmental_variance.Rmd
    Modified:   analysis/Identifying_quaint.Rmd
    Modified:   analysis/Selection_on_Expression_of_Env_Rsponse_Genes.Rmd
    Modified:   output/all_sigenes_annotate.csv
    Deleted:    output/names_0.05_all.txt

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/Selection_on_expression_of_coexpreession_clusters.Rmd) and HTML (docs/Selection_on_expression_of_coexpreession_clusters.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 6797660 jgblanc 2020-10-15 Added GO terms
html 1982147 jgblanc 2020-10-15 Build site.
Rmd 0e39940 jgblanc 2020-10-15 Added GO terms
html 9cc4fa0 jgblanc 2020-09-30 Build site.
Rmd 3294a81 jgblanc 2020-09-30 new clusters
html 9ede1d4 jgblanc 2020-04-24 Build site.
Rmd 69c5a29 jgblanc 2020-04-24 Finished clusters
html e26e754 jgblanc 2020-04-24 Build site.
Rmd 3a6666a jgblanc 2020-04-24 Finished clusters
Rmd 8298d4d GitHub 2020-04-16 Merge branch ‘master’ into master
Rmd 6b00f47 em 2020-03-27 stuff
Rmd a63fa86 em 2020-03-26 stuff
html 7591f0d jgblanc 2020-03-16 Build site.
Rmd df4fe40 jgblanc 2020-03-16 added more pvals
Rmd 2cb89cd jgblanc 2020-03-13 adding coexpression stuff

Intro

Here is the code to test for expression on coeexpression clusters from Walleey et al.

Code

For this analysis we want to test for selection within specific coexpression modules. We used coexpression modules from Walley et al. (2016) who used weight gene coexpression network analysis (WGCNA) to to group together genes that were similarly expressed in at least 4 tissues in one maize inbred line. Their analysis resulted in 66 co-expression networks. Below we will load their co-expression networks and select all the clusters that have at least 100 genes in them.

modules <- read.delim("../data/Modules.txt",na.strings=c("","NA"), stringsAsFactors = F)
num_genes <- apply(modules, 2, function(x) length(which(!is.na(x))))
num_genes_100 <- which(num_genes >= 100)
modules  <- modules[,num_genes_100]

We now have 51 modules that have at least 100 genes. We will now get the median expression of all the genes that are present in our RNAseq dataset for each module and then test for selection on the median values in each cluster. The code below is similar code used to identify selected genes, we are simply conducting the test on median expression values in each line instead of a single gene expression in each line. Again we test for selection on the first 5 PCs and use the last half of PCs to estimate \(V_a\). Th function will return the p-values from the \(Q_{pc}\) test for all tissues.

cluster_analysis_func <- function(modules) {

alltissues = c('GRoot',"Kern","LMAD26","LMAN26", "L3Tip","GShoot","L3Base")

alltissuemodules = lapply(alltissues, function(mytissue){
  
##get the names of genes we have expression data for in each tissue
exp <- read.table(paste("../data/Raw_expression/",mytissue,".txt", sep="")) #  read in expression level
geneNames = names(exp)

#get the median expression level for each module in this tissue
moduleExpression = apply(modules, 2, function(x){
  olap = x[x %in% geneNames] #get genes in the module tha we have expression data for
  moduleExp = dplyr::select(exp, all_of(olap)) #pull out the expression data for these genes
  medianExp = apply(moduleExp, 1, median)
  return(medianExp)
})

####identify selection in each of these modules
# Read in tissue specific kinship matrix 
myF <- read.table(paste('../data/Kinship_matrices/F_',mytissue,'.txt',sep=""))
## Get Eigen Values and Vectors 
myE <- eigen(myF)
E_vectors <- myE$vectors
E_values <- myE$values
## Testing for selection on first 5 PCs
myM = 1:5
## Using the last 1/2 of PCs to estimate Va
myL = 6:dim(myF)[1]
### test for selection on all modules
moduleSelection <- apply(moduleExpression, 2, function(x){
meanCenteredX = x[-length(x)] - mean(x)
myQpc = calcQpc(myZ = meanCenteredX, myU = E_vectors, myLambdas = E_values, myL = myL, myM = myM)
return(myQpc$pvals)
})
##make a dataframe with info to return
mydf = data.frame(t(moduleSelection))
names(mydf) = c('PC1','PC2','PC3','PC4','PC5')
mydf$module = row.names(mydf)
row.names(mydf) <- NULL
mydflong = tidyr::gather(mydf, 'PC','pval', PC1:PC5)
mydflong$tissue = mytissue
return(mydflong)})

return(alltissuemodules)
}

We have the p-values, let’s calculate the FDR and look for significant p-values.

alltissuemodules = cluster_analysis_func(modules)

#combine all into one list
bigdf <- do.call('rbind', alltissuemodules)

bigdf$fdr <- p.adjust(bigdf$pval, method='fdr') ##calculate an FDR
summary(bigdf$fdr) ##nothing is significant
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.4299  0.9996  0.9996  0.9990  0.9996  0.9996 
kable(bigdf[which.min(bigdf[,3]),])
module PC pval tissue fdr
732 RNA_Root_Meristem PC5 0.0002409 LMAD26 0.4299294

There is no significant selection on coexpression clusters. The lowest FDR is for the “RNA Root Meristem” cluster in adult leaf tissue on PC 5. We can also look at the clusters with with lowest bonferroni corrected p-values

t <- bigdf %>% group_by(PC, tissue) %>% mutate(bonferroni = p.adjust(pval, method='bonferroni')) %>% arrange(bonferroni)
kable(head(t))
module PC pval tissue fdr bonferroni
RNA_Root_Meristem PC5 0.0002409 LMAD26 0.4299294 0.0122837
RNA_FemaleSpikIt_._VegMeristem PC1 0.0012924 Kern 0.7985099 0.0659101
Protein_Germinating_Kernals PC1 0.0017164 Kern 0.7985099 0.0875356
RNA_Root_Cortex_2 PC1 0.0017894 Kern 0.7985099 0.0912583
Protein_EndoCrown.PericarpAl PC1 0.0039731 Kern 0.9996316 0.2026281
RNA_Root_Cortex PC1 0.0053132 Kern 0.9996316 0.2709719

Clusters from Schaefer et al.

ZmRoot Clusters - get clustes with >= 100 genes

clusters <- fread("../data/schaefer_clusters.csv")
clusters <- clusters[,1:4]

dat <- clusters %>% group_by(ZmRoot) %>% mutate(num_genes = n()) %>% filter(num_genes >= 100)
names <- unique(dat$ZmRoot)

gene_list <- list()
max <- nrow(dat[dat$ZmRoot == 1,])
for(i in 1:length(names)) {
  df <- clusters %>% filter(ZmRoot == names[i])
  genes <- c(df$V1, rep(NA, max-nrow(df)))
  gene_list[[i]] <- genes
}

modules <- do.call(cbind, gene_list)

Run analysis and FDR correction

alltissuemodules = cluster_analysis_func(modules)

#combine all into one list
bigdf <- do.call('rbind', alltissuemodules)

bigdf$fdr <- p.adjust(bigdf$pval, method='fdr') ##calculate an FDR
summary(bigdf$fdr) ##nothing is significant
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.4377  0.9951  0.9951  0.9889  0.9951  0.9951 
kable(bigdf[which.min(bigdf[,3]),])
module PC pval tissue fdr
158 4 PC5 0.0011368 LMAD26 0.4376829

Look at lowest p-value clusters

t <- bigdf %>% group_by(PC, tissue) %>% mutate(bonferroni = p.adjust(pval, method='bonferroni')) %>% arrange(bonferroni)
kable(head(t))
module PC pval tissue fdr bonferroni
4 PC5 0.0011368 LMAD26 0.4376829 0.0125052
3 PC5 0.0023537 LMAD26 0.4530808 0.0258903
9 PC1 0.0053389 Kern 0.5741055 0.0587274
8 PC2 0.0063947 LMAD26 0.5741055 0.0703414
9 PC3 0.0074559 LMAN26 0.5741055 0.0820151
11 PC1 0.0186208 Kern 0.9950821 0.2048286

Let’s look at the GO enrichment terms for the most significant clusters (bonferroni p < 0.05)

info <- fread("~/Downloads/GO_clusters.csv")
zmroot <- info %>% filter(Network == "ZmRoot") %>% select(Network, `MCL Cluster`, `GO Term`, `Num Genes common`, `Num GO genes`, `Num MCL Genes`, pval, `GO Term Name`)

# Module 4 
zmroot %>% filter(`MCL Cluster` == "MCL4")
   Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
1:  ZmRoot        MCL4 GO:0006558                4           18           745
2:  ZmRoot        MCL4 GO:1902221                4           18           745
3:  ZmRoot        MCL4 GO:0006559                3           10           745
4:  ZmRoot        MCL4 GO:0009074                3           10           745
5:  ZmRoot        MCL4 GO:1902222                3           10           745
6:  ZmRoot        MCL4 GO:0016841                3           11           745
      pval
1: 0.00181
2: 0.00181
3: 0.00282
4: 0.00282
5: 0.00282
6: 0.00379
                                                                    GO Term Name
1:                                             L-phenylalanine metabolic process
2: erythrose 4-phosphate/phosphoenolpyruvate family amino acid metabolic process
3:                                             L-phenylalanine catabolic process
4:                                  aromatic amino acid family catabolic process
5: erythrose 4-phosphate/phosphoenolpyruvate family amino acid catabolic process
6:                                                        ammonia-lyase activity
# Module 3 
zmroot %>% filter(`MCL Cluster` == "MCL3")
    Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
 1:  ZmRoot        MCL3 GO:0006260               24           56           996
 2:  ZmRoot        MCL3 GO:0000786               37          151           996
 3:  ZmRoot        MCL3 GO:0032993               37          151           996
 4:  ZmRoot        MCL3 GO:0044815               37          151           996
 5:  ZmRoot        MCL3 GO:0006334               37          154           996
 6:  ZmRoot        MCL3 GO:0034728               37          154           996
 7:  ZmRoot        MCL3 GO:0065004               37          154           996
 8:  ZmRoot        MCL3 GO:0071824               37          154           996
 9:  ZmRoot        MCL3 GO:0044427               42          210           996
10:  ZmRoot        MCL3 GO:0003777               25           71           996
11:  ZmRoot        MCL3 GO:0005875               25           71           996
12:  ZmRoot        MCL3 GO:0006325               39          194           996
13:  ZmRoot        MCL3 GO:0007018               26           85           996
14:  ZmRoot        MCL3 GO:0007017               30          120           996
15:  ZmRoot        MCL3 GO:0044430               32          145           996
16:  ZmRoot        MCL3 GO:0034622               41          245           996
17:  ZmRoot        MCL3 GO:0006928               26           99           996
18:  ZmRoot        MCL3 GO:0003774               26          101           996
19:  ZmRoot        MCL3 GO:0006259               41          282           996
20:  ZmRoot        MCL3 GO:0016986               12           20           996
21:  ZmRoot        MCL3 GO:0006270               11           22           996
22:  ZmRoot        MCL3 GO:0034061                9           25           996
23:  ZmRoot        MCL3 GO:0003887                8           23           996
24:  ZmRoot        MCL3 GO:0006352               14           83           996
25:  ZmRoot        MCL3 GO:0000280                5            9           996
26:  ZmRoot        MCL3 GO:0007067                5            9           996
27:  ZmRoot        MCL3 GO:1903047                5            9           996
28:  ZmRoot        MCL3 GO:0009360                4            7           996
29:  ZmRoot        MCL3 GO:0042575                4            7           996
30:  ZmRoot        MCL3 GO:0048285                5           13           996
31:  ZmRoot        MCL3 GO:0032774               14          108           996
32:  ZmRoot        MCL3 GO:0071554               14          108           996
33:  ZmRoot        MCL3 GO:0022402                6           21           996
34:  ZmRoot        MCL3 GO:0016779               16          138           996
35:  ZmRoot        MCL3 GO:0008107                4           14           996
36:  ZmRoot        MCL3 GO:0008417                4           14           996
37:  ZmRoot        MCL3 GO:0031127                4           14           996
38:  ZmRoot        MCL3 GO:0042546                4           15           996
39:  ZmRoot        MCL3 GO:0004990                3            8           996
    Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
        pval                                      GO Term Name
 1: 3.54e-19                                   DNA replication
 2: 4.40e-19                                        nucleosome
 3: 4.40e-19                               protein-DNA complex
 4: 4.40e-19                             DNA packaging complex
 5: 9.00e-19                               nucleosome assembly
 6: 9.00e-19                           nucleosome organization
 7: 9.00e-19                      protein-DNA complex assembly
 8: 9.00e-19          protein-DNA complex subunit organization
 9: 5.92e-18                                  chromosomal part
10: 1.86e-17                        microtubule motor activity
11: 1.86e-17                    microtubule associated complex
12: 7.56e-17                            chromatin organization
13: 2.24e-16                        microtubule-based movement
14: 5.45e-16                         microtubule-based process
15: 2.78e-15                                 cytoskeletal part
16: 9.82e-15          cellular macromolecular complex assembly
17: 1.34e-14         movement of cell or subcellular component
18: 2.26e-14                                    motor activity
19: 1.22e-12                             DNA metabolic process
20: 1.67e-12 obsolete transcription initiation factor activity
21: 2.10e-10                        DNA replication initiation
22: 3.18e-07                           DNA polymerase activity
23: 1.98e-06              DNA-directed DNA polymerase activity
24: 5.60e-06           DNA-templated transcription, initiation
25: 1.18e-05                                  nuclear division
26: 1.18e-05                          mitotic nuclear division
27: 1.18e-05                        mitotic cell cycle process
28: 8.44e-05                        DNA polymerase III complex
29: 8.44e-05                            DNA polymerase complex
30: 1.05e-04                                 organelle fission
31: 1.16e-04                          RNA biosynthetic process
32: 1.16e-04              cell wall organization or biogenesis
33: 1.39e-04                                cell cycle process
34: 1.50e-04                   nucleotidyltransferase activity
35: 1.92e-03 galactoside 2-alpha-L-fucosyltransferase activity
36: 1.92e-03                       fucosyltransferase activity
37: 1.92e-03           alpha-(1,2)-fucosyltransferase activity
38: 2.54e-03                              cell wall biogenesis
39: 3.17e-03                        oxytocin receptor activity
        pval                                      GO Term Name
# Module 9 
zmroot %>% filter(`MCL Cluster` == "MCL9")
   Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
1:  ZmRoot        MCL9 GO:0016706                3            9           204
2:  ZmRoot        MCL9 GO:0000003                5           64           204
3:  ZmRoot        MCL9 GO:0019953                5           64           204
4:  ZmRoot        MCL9 GO:0044703                5           64           204
5:  ZmRoot        MCL9 GO:0022414                5           66           204
6:  ZmRoot        MCL9 GO:0051213                3           28           204
7:  ZmRoot        MCL9 GO:0004470                2           11           204
       pval
1: 4.53e-05
2: 1.90e-04
3: 1.90e-04
4: 1.90e-04
5: 2.20e-04
6: 1.57e-03
7: 3.57e-03
                                                                                                                                                                                        GO Term Name
1: oxidoreductase activity, acting on paired donors, with incorporation or reduction of molecular oxygen, 2-oxoglutarate as one donor, and incorporation of one atom each of oxygen into both donors
2:                                                                                                                                                                                      reproduction
3:                                                                                                                                                                               sexual reproduction
4:                                                                                                                                                               multi-organism reproductive process
5:                                                                                                                                                                              reproductive process
6:                                                                                                                                                                              dioxygenase activity
7:                                                                                                                                                                             malic enzyme activity
# Module 8 
zmroot %>% filter(`MCL Cluster` == "MCL8")
    Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
 1:  ZmRoot        MCL8 GO:0006869                7           60           206
 2:  ZmRoot        MCL8 GO:0008289                7          102           206
 3:  ZmRoot        MCL8 GO:0019439                4           35           206
 4:  ZmRoot        MCL8 GO:1901361                4           43           206
 5:  ZmRoot        MCL8 GO:0004367                2            6           206
 6:  ZmRoot        MCL8 GO:0046434                2            7           206
 7:  ZmRoot        MCL8 GO:0004966                2            9           206
 8:  ZmRoot        MCL8 GO:0006559                2           10           206
 9:  ZmRoot        MCL8 GO:0009074                2           10           206
10:  ZmRoot        MCL8 GO:1902222                2           10           206
11:  ZmRoot        MCL8 GO:0016841                2           11           206
        pval
 1: 6.86e-07
 2: 2.44e-05
 3: 2.03e-04
 4: 4.54e-04
 5: 1.02e-03
 6: 1.42e-03
 7: 2.41e-03
 8: 3.00e-03
 9: 3.00e-03
10: 3.00e-03
11: 3.64e-03
                                                                     GO Term Name
 1:                                                               lipid transport
 2:                                                                 lipid binding
 3:                                           aromatic compound catabolic process
 4:                                     organic cyclic compound catabolic process
 5:                            glycerol-3-phosphate dehydrogenase [NAD+] activity
 6:                                             organophosphate catabolic process
 7:                                                     galanin receptor activity
 8:                                             L-phenylalanine catabolic process
 9:                                  aromatic amino acid family catabolic process
10: erythrose 4-phosphate/phosphoenolpyruvate family amino acid catabolic process
11:                                                        ammonia-lyase activity

ZmSAM Clusters - get clustes with >= 100 genes

dat <- clusters %>% group_by(ZmSAM) %>% mutate(num_genes = n()) %>% filter(num_genes >= 100) 
names <- unique(dat$ZmSAM)

gene_list <- list()
max <- nrow(dat[dat$ZmSAM == 0,])
for(i in 1:length(names)) {
  df <- clusters %>% filter(ZmSAM == names[i])
  genes <- c(df$V1, rep(NA, max-nrow(df)))
  gene_list[[i]] <- genes
}

modules <- do.call(cbind, gene_list)

Run analysis and FDR correction

alltissuemodules = cluster_analysis_func(modules)

#combine all into one list
bigdf <- do.call('rbind', alltissuemodules)

bigdf$fdr <- p.adjust(bigdf$pval, method='fdr') ##calculate an FDR
summary(bigdf$fdr) ##nothing is significant
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.9999  0.9999  0.9999  0.9999  0.9999  0.9999 
kable(bigdf[which.min(bigdf[,3]),])
module PC pval tissue fdr
184 2 PC5 0.0033344 LMAD26 0.9999109

Look at lowest p-value clusters

t <- bigdf %>% group_by(PC, tissue) %>% mutate(bonferroni = p.adjust(pval, method='bonferroni')) %>% arrange(bonferroni)
kable(head(t))
module PC pval tissue fdr bonferroni
2 PC5 0.0033344 LMAD26 0.9999109 0.0433477
7 PC3 0.0315067 LMAN26 0.9999109 0.4095866
10 PC1 0.0320505 Kern 0.9999109 0.4166559
4 PC5 0.0436062 LMAD26 0.9999109 0.5668812
2 PC1 0.0536048 Kern 0.9999109 0.6968619
5 PC5 0.0560459 LMAN26 0.9999109 0.7285967

Let’s look at the GO enrichment terms for the most significant clusters (bonferroni p < 0.05)

zmsam <- info %>% filter(Network == "ZmSAM") %>% select(Network, `MCL Cluster`, `GO Term`, `Num Genes common`, `Num GO genes`, `Num MCL Genes`, pval, `GO Term Name`)

# Module 2 
zmsam %>% filter(`MCL Cluster` == "MCL2")
   Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
1:   ZmSAM        MCL2 GO:0033180                8           10           942
2:   ZmSAM        MCL2 GO:0004347                3            5           942
3:   ZmSAM        MCL2 GO:0030120                6           24           942
4:   ZmSAM        MCL2 GO:0000502                3            7           942
5:   ZmSAM        MCL2 GO:0006094                3            7           942
       pval                                 GO Term Name
1: 4.62e-09 proton-transporting V-type ATPase, V1 domain
2: 1.72e-03       glucose-6-phosphate isomerase activity
3: 1.93e-03                                 vesicle coat
4: 5.53e-03                           proteasome complex
5: 5.53e-03                              gluconeogenesis

ZmPAN Clusters - get clustes with >= 100 genes

dat <- clusters %>% group_by(ZmPAN) %>% mutate(num_genes = n()) %>% filter(num_genes >= 100)
names <- unique(dat$ZmPAN)

gene_list <- list()
max <- nrow(dat[dat$ZmPAN == 0,])
for(i in 1:length(names)) {
  df <- clusters %>% filter(ZmPAN == names[i])
  genes <- c(df$V1, rep(NA, max-nrow(df)))
  gene_list[[i]] <- genes
}

modules <- do.call(cbind, gene_list)

Run analysis and FDR correction

alltissuemodules = cluster_analysis_func(modules)

#combine all into one list
bigdf <- do.call('rbind', alltissuemodules)

bigdf$fdr <- p.adjust(bigdf$pval, method='fdr') ##calculate an FDR
summary(bigdf$fdr) ##nothing is significant
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.9992  0.9992  0.9992  0.9992  0.9992  0.9992 
kable(bigdf[which.min(bigdf[,3]),])
module PC pval tissue fdr
241 3 PC5 0.0045783 LMAD26 0.9991676

Look at lowest p-value clusters

t <- bigdf %>% group_by(PC, tissue) %>% mutate(bonferroni = p.adjust(pval, method='bonferroni')) %>% arrange(bonferroni)
kable(head(t))
module PC pval tissue fdr bonferroni
3 PC5 0.0045783 LMAD26 0.9991676 0.0778318
2 PC5 0.0090431 GShoot 0.9991676 0.1537334
1 PC5 0.0092036 LMAN26 0.9991676 0.1564620
13 PC1 0.0129806 Kern 0.9991676 0.2206705
13 PC5 0.0142503 LMAD26 0.9991676 0.2422548
10 PC2 0.0157494 LMAN26 0.9991676 0.2677405

Let’s look at the GO enrichment terms for the most significant clusters (bonferroni p < 0.05)

zmpan <- info %>% filter(Network == "ZmPAN") %>% select(Network, `MCL Cluster`, `GO Term`, `Num Genes common`, `Num GO genes`, `Num MCL Genes`, pval, `GO Term Name`)

# Module 3 
zmpan %>% filter(`MCL Cluster` == "MCL3")
    Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
 1:   ZmPAN        MCL3 GO:0006414               20           37           793
 2:   ZmPAN        MCL3 GO:0044391               27           84           793
 3:   ZmPAN        MCL3 GO:0015935               17           49           793
 4:   ZmPAN        MCL3 GO:0022613                9           12           793
 5:   ZmPAN        MCL3 GO:0042254                9           12           793
 6:   ZmPAN        MCL3 GO:0003746               12           25           793
 7:   ZmPAN        MCL3 GO:0004298               12           27           793
 8:   ZmPAN        MCL3 GO:0070003               12           27           793
 9:   ZmPAN        MCL3 GO:0008135               20           90           793
10:   ZmPAN        MCL3 GO:0005839               12           29           793
11:   ZmPAN        MCL3 GO:0044085                9           27           793
12:   ZmPAN        MCL3 GO:0015934               10           36           793
13:   ZmPAN        MCL3 GO:0006334               20          154           793
14:   ZmPAN        MCL3 GO:0034728               20          154           793
15:   ZmPAN        MCL3 GO:0065004               20          154           793
16:   ZmPAN        MCL3 GO:0071824               20          154           793
17:   ZmPAN        MCL3 GO:0044429               18          141           793
18:   ZmPAN        MCL3 GO:0019843                5           10           793
19:   ZmPAN        MCL3 GO:0006626                4            6           793
20:   ZmPAN        MCL3 GO:0007007                4            6           793
21:   ZmPAN        MCL3 GO:0042719                4            6           793
22:   ZmPAN        MCL3 GO:0045039                4            6           793
23:   ZmPAN        MCL3 GO:0007005                4            7           793
24:   ZmPAN        MCL3 GO:0007006                4            7           793
25:   ZmPAN        MCL3 GO:0044743                4            7           793
26:   ZmPAN        MCL3 GO:0065002                4            7           793
27:   ZmPAN        MCL3 GO:0070585                4            7           793
28:   ZmPAN        MCL3 GO:0071806                4            7           793
29:   ZmPAN        MCL3 GO:0072655                4            7           793
30:   ZmPAN        MCL3 GO:0090151                4            7           793
31:   ZmPAN        MCL3 GO:1990542                4            7           793
32:   ZmPAN        MCL3 GO:0098798                6           20           793
33:   ZmPAN        MCL3 GO:0006325               20          194           793
34:   ZmPAN        MCL3 GO:0000786               17          151           793
35:   ZmPAN        MCL3 GO:0032993               17          151           793
36:   ZmPAN        MCL3 GO:0044815               17          151           793
37:   ZmPAN        MCL3 GO:0034622               23          245           793
38:   ZmPAN        MCL3 GO:0005853                4            8           793
39:   ZmPAN        MCL3 GO:0016272                4           10           793
40:   ZmPAN        MCL3 GO:0006413                8           48           793
41:   ZmPAN        MCL3 GO:0003743                8           50           793
42:   ZmPAN        MCL3 GO:0016986                5           20           793
43:   ZmPAN        MCL3 GO:0017038                4           13           793
44:   ZmPAN        MCL3 GO:0015929                3            7           793
45:   ZmPAN        MCL3 GO:0006465                3            8           793
    Network MCL Cluster    GO Term Num Genes common Num GO genes Num MCL Genes
        pval                                                    GO Term Name
 1: 8.91e-19                                        translational elongation
 2: 1.30e-17                                               ribosomal subunit
 3: 3.34e-12                                         small ribosomal subunit
 4: 5.43e-11                            ribonucleoprotein complex biogenesis
 5: 5.43e-11                                             ribosome biogenesis
 6: 5.61e-11                          translation elongation factor activity
 7: 1.74e-10                           threonine-type endopeptidase activity
 8: 1.74e-10                               threonine-type peptidase activity
 9: 3.77e-10                        translation factor activity, RNA binding
10: 4.82e-10                                         proteasome core complex
11: 6.69e-07                                   cellular component biogenesis
12: 1.07e-06                                         large ribosomal subunit
13: 4.13e-06                                             nucleosome assembly
14: 4.13e-06                                         nucleosome organization
15: 4.13e-06                                    protein-DNA complex assembly
16: 4.13e-06                        protein-DNA complex subunit organization
17: 1.57e-05                                              mitochondrial part
18: 2.27e-05                                                    rRNA binding
19: 3.72e-05                              protein targeting to mitochondrion
20: 3.72e-05                       inner mitochondrial membrane organization
21: 3.72e-05   mitochondrial intermembrane space protein transporter complex
22: 3.72e-05                protein import into mitochondrial inner membrane
23: 8.41e-05                                      mitochondrion organization
24: 8.41e-05                             mitochondrial membrane organization
25: 8.41e-05                      intracellular protein transmembrane import
26: 8.41e-05                   intracellular protein transmembrane transport
27: 8.41e-05                           protein localization to mitochondrion
28: 8.41e-05                                 protein transmembrane transport
29: 8.41e-05          establishment of protein localization to mitochondrion
30: 8.41e-05 establishment of protein localization to mitochondrial membrane
31: 8.41e-05                           mitochondrial transmembrane transport
32: 1.02e-04                                   mitochondrial protein complex
33: 1.21e-04                                          chromatin organization
34: 1.32e-04                                                      nucleosome
35: 1.32e-04                                             protein-DNA complex
36: 1.32e-04                                           DNA packaging complex
37: 1.61e-04                        cellular macromolecular complex assembly
38: 1.63e-04              eukaryotic translation elongation factor 1 complex
39: 4.58e-04                                               prefoldin complex
40: 6.18e-04                                        translational initiation
41: 8.19e-04                          translation initiation factor activity
42: 9.95e-04               obsolete transcription initiation factor activity
43: 1.41e-03                                                  protein import
44: 2.04e-03                                         hexosaminidase activity
45: 3.16e-03                                       signal peptide processing
        pval                                                    GO Term Name

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_1.29        data.table_1.12.8 dplyr_1.0.0       quaint_0.0.0.9000
[5] ggpubr_0.3.0      ggplot2_3.3.2     reshape2_1.4.4    workflowr_1.6.2  

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0 xfun_0.15        purrr_0.3.4      haven_2.3.1     
 [5] lattice_0.20-41  carData_3.0-4    colorspace_1.4-1 vctrs_0.3.1     
 [9] generics_0.0.2   htmltools_0.5.0  yaml_2.2.1       rlang_0.4.6     
[13] later_1.1.0.1    pillar_1.4.4     foreign_0.8-72   glue_1.4.1      
[17] withr_2.2.0      readxl_1.3.1     lifecycle_0.2.0  plyr_1.8.6      
[21] stringr_1.4.0    cellranger_1.1.0 munsell_0.5.0    ggsignif_0.6.0  
[25] gtable_0.3.0     zip_2.0.4        evaluate_0.14    rio_0.5.16      
[29] forcats_0.5.0    httpuv_1.5.4     curl_4.3         highr_0.8       
[33] broom_0.5.6      Rcpp_1.0.4.6     promises_1.1.1   scales_1.1.1    
[37] backports_1.1.8  abind_1.4-5      fs_1.4.1         hms_0.5.3       
[41] digest_0.6.25    stringi_1.4.6    openxlsx_4.1.5   rstatix_0.6.0   
[45] grid_3.6.2       rprojroot_1.3-2  tools_3.6.2      magrittr_1.5    
[49] tibble_3.0.1     crayon_1.3.4     whisker_0.4      tidyr_1.1.0     
[53] car_3.0-8        pkgconfig_2.0.3  ellipsis_0.3.1   rmarkdown_2.3   
[57] R6_2.4.1         nlme_3.1-148     git2r_0.27.1     compiler_3.6.2