Source: https://github.com/markziemann/combined_enrichment

Intro

Here we are performing an analysis of some gene expression data to demonstrate the difference between ORA and FCS methods and to highlight the differences caused by improper background gene set use.

The dataset being used is SRP038101 and we are comparing the cells expressing a set7kd shRNA construct (case) compared to the scrambled construct (control).

Data are obtained from http://dee2.io/

suppressPackageStartupMessages({
library("getDEE2") 
library("DESeq2")
library("clusterProfiler")
library("mitch")
library("kableExtra")
library("eulerr")
})

Get expression data

I’m using some RNA-seq data looking at the effect of Set7 knockdown on HMEC cells.

name="SRP096177"
mdat<-getDEE2Metadata("hsapiens")
samplesheet <- mdat[grep("SRP096177",mdat$SRP_accession),]
samplesheet<-samplesheet[order(samplesheet$SRR_accession),]
samplesheet$trt<-as.factor(c(1,1,1,0,0,0))
s1 <- samplesheet

s1 %>% kbl(caption = "sample sheet") %>% kable_paper("hover", full_width = F)
sample sheet
SRR_accession QC_summary SRX_accession SRS_accession SRP_accession Sample_name GEO_series Library_name trt
379112 SRR5150592 PASS SRX2468682 SRS1901000 SRP096177 GSM2448982 GSE93236 1
379113 SRR5150593 PASS SRX2468683 SRS1901005 SRP096177 GSM2448983 GSE93236 1
379114 SRR5150594 PASS SRX2468684 SRS1901001 SRP096177 GSM2448984 GSE93236 1
379115 SRR5150595 PASS SRX2468685 SRS1901002 SRP096177 GSM2448985 GSE93236 0
379116 SRR5150596 PASS SRX2468686 SRS1901003 SRP096177 GSM2448986 GSE93236 0
379117 SRR5150597 PASS SRX2468687 SRS1901004 SRP096177 GSM2448987 GSE93236 0
w<-getDEE2("hsapiens",samplesheet$SRR_accession,metadata=mdat,legacy = TRUE)
## For more information about DEE2 QC metrics, visit
##     https://github.com/markziemann/dee2/blob/master/qc/qc_metrics.md
x<-Tx2Gene(w)
x<-x$Tx2Gene

# save the genetable for later
gt<-w$GeneInfo[,1,drop=FALSE]
gt$accession<-rownames(gt)

# counts 
x1<-x[,which(colnames(x) %in% samplesheet$SRR_accession)]

Here show the number of genes in the annotation set, and those detected above the detection threshold.

# filter out lowly expressed genes
x1<-x1[which(rowSums(x1)/ncol(x1)>=(10)),]
nrow(x)
## [1] 39297
nrow(x1)
## [1] 15607

Now multidimensional scaling (MDS) plot to show the correlation between the datasets. If the control and case datasets are clustered separately, then it is likely that there will be many differentially expressed genes with FDR<0.05.

plot(cmdscale(dist(t(x1))), xlab="Coordinate 1", ylab="Coordinate 2", pch=19, col=s1$trt, main="MDS")

Differential expression

Now run DESeq2 for control vs case.

y <- DESeqDataSetFromMatrix(countData = round(x1), colData = s1, design = ~ trt)
## converting counts to integer mode
y <- DESeq(y)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
de <- results(y)
de<-as.data.frame(de[order(de$pvalue),])
rownames(de)<-sapply(strsplit(rownames(de),"\\."),"[[",1)
head(de) %>% kbl() %>% kable_paper("hover", full_width = F)
baseMean log2FoldChange lfcSE stat pvalue padj
ENSG00000168542 1259.1001 2.7325696 0.0952226 28.69666 0 0
ENSG00000164692 11379.8760 2.2961488 0.0887089 25.88407 0 0
ENSG00000172531 2130.9201 -1.7175060 0.0712043 -24.12082 0 0
ENSG00000106484 4549.7360 1.2253274 0.0581660 21.06603 0 0
ENSG00000163017 300.4833 4.8785541 0.2741929 17.79242 0 0
ENSG00000130508 10277.9876 -0.9442904 0.0530794 -17.79015 0 0

Now let’s have a look at some of the charts showing differential expression. In particular, an MA plot and volcano plot.

maplot <- function(de,contrast_name) {
  sig <-subset(de, padj < 0.05 )
  up <-rownames(subset(de, padj < 0.05 & log2FoldChange > 0))
  dn <-rownames(subset(de, padj < 0.05 & log2FoldChange < 0))
  GENESUP <- length(up)
  GENESDN <- length(dn)
  DET=nrow(de)
  SUBHEADER = paste(GENESUP, "up, ", GENESDN, "down", DET, "detected")
  ns <-subset(de, padj > 0.05 )
  plot(log2(de$baseMean),de$log2FoldChange, 
       xlab="log2 basemean", ylab="log2 foldchange",
       pch=19, cex=0.5, col="dark gray",
       main=contrast_name, cex.main=0.7)
  points(log2(sig$baseMean),sig$log2FoldChange,
         pch=19, cex=0.5, col="red")
  mtext(SUBHEADER,cex = 0.7)
}

make_volcano <- function(de,name) {
    sig <- subset(de,padj<0.05)
    N_SIG=nrow(sig)
    N_UP=nrow(subset(sig,log2FoldChange>0))
    N_DN=nrow(subset(sig,log2FoldChange<0))
    DET=nrow(de)
    HEADER=paste(N_SIG,"@5%FDR,", N_UP, "up", N_DN, "dn", DET, "detected")
    plot(de$log2FoldChange,-log10(de$padj),cex=0.5,pch=19,col="darkgray",
        main=name, xlab="log2 FC", ylab="-log10 pval", xlim=c(-6,6))
    mtext(HEADER)
    grid()
    points(sig$log2FoldChange,-log10(sig$padj),cex=0.5,pch=19,col="red")
}

maplot(de,name)

make_volcano(de,name)

Gene sets from Reactome

In order to perform gene set analysis, we need some gene sets.

if (! file.exists("ReactomePathways.gmt")) {
  download.file("https://reactome.org/download/current/ReactomePathways.gmt.zip", 
    destfile="ReactomePathways.gmt.zip")
  unzip("ReactomePathways.gmt.zip")
}
genesets<-gmt_import("ReactomePathways.gmt")

FCS with Mitch

Mitch uses rank-ANOVA statistics for enrichment detection.

Here I’m using the standard approach

m <- mitch_import(de,DEtype = "DEseq2", geneTable = gt)
## The input is a single dataframe; one contrast only. Converting
##         it to a list for you.
## Note: Mean no. genes in input = 15607
## Note: no. genes in output = 14564
## Note: estimated proportion of input genes in output = 0.933
msep <- mitch_calc(m,genesets = genesets)
## Note: When prioritising by significance (ie: small
##             p-values), large effect sizes might be missed.
ms_up <- subset(msep$enrichment_result,p.adjustANOVA<0.05 & s.dist > 0)[,1]
ms_dn <- subset(msep$enrichment_result,p.adjustANOVA<0.05 & s.dist < 0)[,1]
message(paste("Number of up-regulated pathways:",length(ms_up) ))
## Number of up-regulated pathways: 308
message(paste("Number of down-regulated pathways:",length(ms_dn) ))
## Number of down-regulated pathways: 44
head(msep$enrichment_result,10)  #%>% kbl() %>% kable_paper("hover", full_width = F)
##                                                      set setSize       pANOVA
## 346                    Eukaryotic Translation Elongation      93 1.949798e-22
## 796                             Peptide chain elongation      88 2.443753e-21
## 1066                            Selenocysteine synthesis      91 2.010715e-20
## 1015 Response of EIF2AK4 (GCN2) to amino acid deficiency     100 2.118516e-20
## 629                                    Metabolism of RNA     661 3.396388e-20
## 1335                              Viral mRNA Translation      88 9.281504e-19
## 348                   Eukaryotic Translation Termination      92 1.138885e-18
## 668                       Mitotic Metaphase and Anaphase     222 3.805978e-18
## 665                                     Mitotic Anaphase     221 4.774265e-18
## 387             Formation of a pool of free 40S subunits     100 1.215397e-17
##          s.dist p.adjustANOVA
## 346  -0.5843493  2.694622e-19
## 796  -0.5846275  1.688633e-18
## 1066 -0.5615284  7.319474e-18
## 1015 -0.5355088  7.319474e-18
## 629   0.2112927  9.387617e-18
## 1335 -0.5452426  2.137840e-16
## 348  -0.5319553  2.248484e-16
## 668   0.3387003  6.574828e-16
## 665   0.3384478  7.331149e-16
## 387  -0.4948438  1.679679e-15
#mitch_report(msep,outfile="mitch_separate.html",overwrite=TRUE)

Here I’m using the combined approach.

mcom <- mitch_calc(abs(m),genesets = genesets)
## Note: When prioritising by significance (ie: small
##             p-values), large effect sizes might be missed.
mc_up <- subset(mcom$enrichment_result,p.adjustANOVA<0.05 & s.dist > 0)[,1]
mc_dn <- subset(mcom$enrichment_result,p.adjustANOVA<0.05 & s.dist < 0)[,1]
message(paste("Number of up-regulated pathways:",length(mc_up) ))
## Number of up-regulated pathways: 402
message(paste("Number of down-regulated pathways:",length(mc_dn) ))
## Number of down-regulated pathways: 6
head(mcom$enrichment_result,10)  #%>% kbl() %>% kable_paper("hover", full_width = F)
##                               set setSize       pANOVA    s.dist p.adjustANOVA
## 513                 Immune System    1426 1.527748e-24 0.1643194  1.519825e-21
## 280                       Disease    1277 2.199457e-24 0.1720700  1.519825e-21
## 719    Nervous system development     471 8.428692e-22 0.2590856  3.882817e-19
## 94                  Axon guidance     450 1.173092e-21 0.2639249  4.053033e-19
## 641        Metabolism of proteins    1558 1.689983e-21 0.1471765  4.671114e-19
## 167 Cellular responses to stimuli     640 1.727616e-20 0.2162498  3.979275e-18
## 168  Cellular responses to stress     634 5.968463e-20 0.2141177  1.178345e-17
## 530          Innate Immune System     745 3.450694e-19 0.1941714  5.961074e-17
## 277         Developmental Biology     710 4.168011e-19 0.1981867  6.400213e-17
## 520            Infectious disease     662 5.198451e-19 0.2043317  7.184260e-17
#mitch_report(mcom,outfile="mitch_combined.html",overwrite=TRUE)

Let’s look at the significant ones based on the combined analysis. There weren’t many gene sets classe d as significant. Let’s see how many have a direction agnostic enrichment score which is larger in magnitude than the direction informed enrichment score. There are only 11 such sets which would benefit from such combined analysis.

Euler diagram of the significant pathways found with each approach.

l0 <- list("sep up"=ms_up,"sep dn"=ms_dn,"comb up"=mc_up,"comb dn"=mc_dn)
par(cex.main=0.5)
plot(euler(l0),quantities = TRUE, edges = "gray", main="FCS: combined vs separated")

length(ms_up)
## [1] 308
length(ms_dn)
## [1] 44
length(ms_up)+length(ms_dn)
## [1] 352
length(mc_up)
## [1] 402
length(mc_dn)
## [1] 6
length(mc_up)+length(mc_dn)
## [1] 408
( length(ms_up)+length(ms_dn) ) / ( length(mc_up)+length(mc_dn) )
## [1] 0.8627451

List gene sets which are specific to each approach.

ms <- c(ms_up,ms_dn)

# in sep but not comb
setdiff(ms,mc_up)
##   [1] "mRNA Splicing"                                                                                                      
##   [2] "mRNA Splicing - Major Pathway"                                                                                      
##   [3] "tRNA processing"                                                                                                    
##   [4] "Signaling by Hedgehog"                                                                                              
##   [5] "mRNA Splicing - Minor Pathway"                                                                                      
##   [6] "Mitochondrial translation initiation"                                                                               
##   [7] "Mitochondrial translation elongation"                                                                               
##   [8] "Mitochondrial translation termination"                                                                              
##   [9] "Mitotic Prometaphase"                                                                                               
##  [10] "Mitochondrial translation"                                                                                          
##  [11] "Transcription-Coupled Nucleotide Excision Repair (TC-NER)"                                                          
##  [12] "RHO GTPases Activate WASPs and WAVEs"                                                                               
##  [13] "Nucleotide Excision Repair"                                                                                         
##  [14] "Formation of TC-NER Pre-Incision Complex"                                                                           
##  [15] "Transport of Mature Transcript to Cytoplasm"                                                                        
##  [16] "RHOBTB1 GTPase cycle"                                                                                               
##  [17] "The citric acid (TCA) cycle and respiratory electron transport"                                                     
##  [18] "Transport of Mature mRNA derived from an Intron-Containing Transcript"                                              
##  [19] "Viral Messenger RNA Synthesis"                                                                                      
##  [20] "SUMOylation of DNA replication proteins"                                                                            
##  [21] "Respiratory electron transport"                                                                                     
##  [22] "Protein folding"                                                                                                    
##  [23] "FCGR3A-mediated phagocytosis"                                                                                       
##  [24] "Leishmania phagocytosis"                                                                                            
##  [25] "Parasite infection"                                                                                                 
##  [26] "Cooperation of PDCL (PhLP1) and TRiC/CCT in G-protein beta folding"                                                 
##  [27] "Transcription of the HIV genome"                                                                                    
##  [28] "SUMOylation of SUMOylation proteins"                                                                                
##  [29] "S33 mutants of beta-catenin aren't phosphorylated"                                                                  
##  [30] "S37 mutants of beta-catenin aren't phosphorylated"                                                                  
##  [31] "S45 mutants of beta-catenin aren't phosphorylated"                                                                  
##  [32] "Signaling by CTNNB1 phospho-site mutants"                                                                           
##  [33] "Signaling by GSK3beta mutants"                                                                                      
##  [34] "T41 mutants of beta-catenin aren't phosphorylated"                                                                  
##  [35] "Global Genome Nucleotide Excision Repair (GG-NER)"                                                                  
##  [36] "Gene expression (Transcription)"                                                                                    
##  [37] "Dual incision in TC-NER"                                                                                            
##  [38] "Respiratory electron transport, ATP synthesis by chemiosmotic coupling, and heat production by uncoupling proteins."
##  [39] "Chaperonin-mediated protein folding"                                                                                
##  [40] "SUMOylation of RNA binding proteins"                                                                                
##  [41] "RNA Polymerase II Transcription Termination"                                                                        
##  [42] "SLBP Dependent Processing of Replication-Dependent Histone Pre-mRNAs"                                               
##  [43] "Gap-filling DNA repair synthesis and ligation in TC-NER"                                                            
##  [44] "APC truncation mutants have impaired AXIN binding"                                                                  
##  [45] "AXIN missense mutants destabilize the destruction complex"                                                          
##  [46] "Signaling by AMER1 mutants"                                                                                         
##  [47] "Signaling by APC mutants"                                                                                           
##  [48] "Signaling by AXIN mutants"                                                                                          
##  [49] "Truncations of AMER1 destabilize the destruction complex"                                                           
##  [50] "Signal transduction by L1"                                                                                          
##  [51] "tRNA modification in the nucleus and cytosol"                                                                       
##  [52] "Mitochondrial protein import"                                                                                       
##  [53] "Aggrephagy"                                                                                                         
##  [54] "Formation of HIV elongation complex in the absence of HIV Tat"                                                      
##  [55] "Sema3A PAK dependent Axon repulsion"                                                                                
##  [56] "Elastic fibre formation"                                                                                            
##  [57] "Incretin synthesis, secretion, and inactivation"                                                                    
##  [58] "Synthesis, secretion, and inactivation of Glucagon-like Peptide-1 (GLP-1)"                                          
##  [59] "Integrin cell surface interactions"                                                                                 
##  [60] "HIV elongation arrest and recovery"                                                                                 
##  [61] "Pausing and recovery of HIV elongation"                                                                             
##  [62] "HIV Transcription Initiation"                                                                                       
##  [63] "RNA Polymerase II HIV Promoter Escape"                                                                              
##  [64] "RNA Polymerase II Promoter Escape"                                                                                  
##  [65] "RNA Polymerase II Transcription Initiation"                                                                         
##  [66] "RNA Polymerase II Transcription Initiation And Promoter Clearance"                                                  
##  [67] "RNA Polymerase II Transcription Pre-Initiation And Promoter Opening"                                                
##  [68] "SLBP independent Processing of Histone Pre-mRNAs"                                                                   
##  [69] "Signaling by FGFR2 in disease"                                                                                      
##  [70] "Protein ubiquitination"                                                                                             
##  [71] "Complex I biogenesis"                                                                                               
##  [72] "RNA Polymerase II Pre-transcription Events"                                                                         
##  [73] "HS-GAG biosynthesis"                                                                                                
##  [74] "Formation of HIV-1 elongation complex containing HIV-1 Tat"                                                         
##  [75] "HIV Transcription Elongation"                                                                                       
##  [76] "Tat-mediated elongation of the HIV-1 transcript"                                                                    
##  [77] "RNA Polymerase III Transcription Termination"                                                                       
##  [78] "DNA Repair"                                                                                                         
##  [79] "The role of Nef in HIV-1 replication and disease pathogenesis"                                                      
##  [80] "RNA Polymerase III Transcription Initiation From Type 1 Promoter"                                                   
##  [81] "RHOU GTPase cycle"                                                                                                  
##  [82] "Synthesis of active ubiquitin: roles of E1 and E2 enzymes"                                                          
##  [83] "RNA polymerase II transcribes snRNA genes"                                                                          
##  [84] "Pausing and recovery of Tat-mediated HIV elongation"                                                                
##  [85] "Tat-mediated HIV elongation arrest and recovery"                                                                    
##  [86] "Regulation of glycolysis by fructose 2,6-bisphosphate metabolism"                                                   
##  [87] "Processing of Capped Intronless Pre-mRNA"                                                                           
##  [88] "Platelet homeostasis"                                                                                               
##  [89] "NGF-stimulated transcription"                                                                                       
##  [90] "Complement cascade"                                                                                                 
##  [91] "Regulation of Complement cascade"                                                                                   
##  [92] "Endosomal/Vacuolar pathway"                                                                                         
##  [93] "Mucopolysaccharidoses"                                                                                              
##  [94] "Interferon gamma signaling"                                                                                         
##  [95] "Amyloid fiber formation"                                                                                            
##  [96] "Regulated Necrosis"                                                                                                 
##  [97] "Synthesis of Leukotrienes (LT) and Eoxins (EX)"                                                                     
##  [98] "ABC transporters in lipid homeostasis"                                                                              
##  [99] "RUNX1 regulates genes involved in megakaryocyte differentiation and platelet function"                              
## [100] "CASP8 activity is inhibited"                                                                                        
## [101] "Dimerization of procaspase-8"                                                                                       
## [102] "Regulation by c-FLIP"                                                                                               
## [103] "Immunoregulatory interactions between a Lymphoid and a non-Lymphoid cell"                                           
## [104] "Diseases of carbohydrate metabolism"                                                                                
## [105] "TRAF6 mediated NF-kB activation"                                                                                    
## [106] "Aflatoxin activation and detoxification"
# in comb but not sep
setdiff(mc_up,ms)
##   [1] "Immune System"                                                                                                              
##   [2] "Disease"                                                                                                                    
##   [3] "Nervous system development"                                                                                                 
##   [4] "Axon guidance"                                                                                                              
##   [5] "Cellular responses to stimuli"                                                                                              
##   [6] "Cellular responses to stress"                                                                                               
##   [7] "Innate Immune System"                                                                                                       
##   [8] "Developmental Biology"                                                                                                      
##   [9] "Infectious disease"                                                                                                         
##  [10] "Metabolism"                                                                                                                 
##  [11] "Neutrophil degranulation"                                                                                                   
##  [12] "Signaling by ROBO receptors"                                                                                                
##  [13] "Regulation of expression of SLITs and ROBOs"                                                                                
##  [14] "Cytokine Signaling in Immune system"                                                                                        
##  [15] "rRNA processing in the nucleus and cytosol"                                                                                 
##  [16] "Major pathway of rRNA processing in the nucleolus and cytosol"                                                              
##  [17] "Translation"                                                                                                                
##  [18] "rRNA processing"                                                                                                            
##  [19] "Metabolism of lipids"                                                                                                       
##  [20] "Signaling by Receptor Tyrosine Kinases"                                                                                     
##  [21] "Signaling by Interleukins"                                                                                                  
##  [22] "FOXO-mediated transcription"                                                                                                
##  [23] "Regulation of Insulin-like Growth Factor (IGF) transport and uptake by Insulin-like Growth Factor Binding Proteins (IGFBPs)"
##  [24] "Platelet activation, signaling and aggregation"                                                                             
##  [25] "Response to elevated platelet cytosolic Ca2+"                                                                               
##  [26] "Post-translational protein phosphorylation"                                                                                 
##  [27] "Signaling by Nuclear Receptors"                                                                                             
##  [28] "Platelet degranulation"                                                                                                     
##  [29] "ESR-mediated signaling"                                                                                                     
##  [30] "Antiviral mechanism by IFN-stimulated genes"                                                                                
##  [31] "trans-Golgi Network Vesicle Budding"                                                                                        
##  [32] "PIP3 activates AKT signaling"                                                                                               
##  [33] "Phospholipid metabolism"                                                                                                    
##  [34] "Interferon Signaling"                                                                                                       
##  [35] "ISG15 antiviral mechanism"                                                                                                  
##  [36] "Binding and Uptake of Ligands by Scavenger Receptors"                                                                       
##  [37] "Deubiquitination"                                                                                                           
##  [38] "Signaling by ALK fusions and activated point mutants"                                                                       
##  [39] "Signaling by ALK in cancer"                                                                                                 
##  [40] "Antigen Presentation: Folding, assembly and peptide loading of class I MHC"                                                 
##  [41] "Intracellular signaling by second messengers"                                                                               
##  [42] "Pre-NOTCH Expression and Processing"                                                                                        
##  [43] "SARS-CoV Infections"                                                                                                        
##  [44] "Metabolism of carbohydrates"                                                                                                
##  [45] "Diseases of metabolism"                                                                                                     
##  [46] "Non-integrin membrane-ECM interactions"                                                                                     
##  [47] "RAC1 GTPase cycle"                                                                                                          
##  [48] "Golgi Associated Vesicle Biogenesis"                                                                                        
##  [49] "Lysosome Vesicle Biogenesis"                                                                                                
##  [50] "GPVI-mediated activation cascade"                                                                                           
##  [51] "Signaling by FLT3 ITD and TKD mutants"                                                                                      
##  [52] "Signaling by MET"                                                                                                           
##  [53] "FOXO-mediated transcription of cell cycle genes"                                                                            
##  [54] "RHOA GTPase cycle"                                                                                                          
##  [55] "PI Metabolism"                                                                                                              
##  [56] "Unfolded Protein Response (UPR)"                                                                                            
##  [57] "Scavenging by Class A Receptors"                                                                                            
##  [58] "Adherens junctions interactions"                                                                                            
##  [59] "Interleukin-3, Interleukin-5 and GM-CSF signaling"                                                                          
##  [60] "Metabolism of nucleotides"                                                                                                  
##  [61] "RHOC GTPase cycle"                                                                                                          
##  [62] "N-glycan trimming in the ER and Calnexin/Calreticulin cycle"                                                                
##  [63] "Extra-nuclear estrogen signaling"                                                                                           
##  [64] "Interleukin-4 and Interleukin-13 signaling"                                                                                 
##  [65] "Negative regulation of the PI3K/AKT network"                                                                                
##  [66] "Degradation of the extracellular matrix"                                                                                    
##  [67] "ECM proteoglycans"                                                                                                          
##  [68] "PI5P, PP2A and IER3 Regulate PI3K/AKT Signaling"                                                                            
##  [69] "RHO GTPases activate PKNs"                                                                                                  
##  [70] "Sema4D in semaphorin signaling"                                                                                             
##  [71] "RAC2 GTPase cycle"                                                                                                          
##  [72] "Diseases of glycosylation"                                                                                                  
##  [73] "Cell junction organization"                                                                                                 
##  [74] "Estrogen-dependent gene expression"                                                                                         
##  [75] "Nef-mediates down modulation of cell surface receptors by recruiting them to clathrin adapters"                             
##  [76] "Collagen chain trimerization"                                                                                               
##  [77] "Synthesis of PIPs at the plasma membrane"                                                                                   
##  [78] "Cell-Cell communication"                                                                                                    
##  [79] "Semaphorin interactions"                                                                                                    
##  [80] "FOXO-mediated transcription of oxidative stress, metabolic and neuronal genes"                                              
##  [81] "Signaling by FLT3 fusion proteins"                                                                                          
##  [82] "Interleukin receptor SHC signaling"                                                                                         
##  [83] "Assembly of collagen fibrils and other multimeric structures"                                                               
##  [84] "Cell surface interactions at the vascular wall"                                                                             
##  [85] "The NLRP3 inflammasome"                                                                                                     
##  [86] "Transcriptional Regulation by TP53"                                                                                         
##  [87] "Signaling by PDGF"                                                                                                          
##  [88] "Glutamate binding, activation of AMPA receptors and synaptic plasticity"                                                    
##  [89] "Trafficking of AMPA receptors"                                                                                              
##  [90] "CDC42 GTPase cycle"                                                                                                         
##  [91] "HSF1 activation"                                                                                                            
##  [92] "Regulation of localization of FOXO transcription factors"                                                                   
##  [93] "Collagen degradation"                                                                                                       
##  [94] "Cyclin D associated events in G1"                                                                                           
##  [95] "G1 Phase"                                                                                                                   
##  [96] "Pre-NOTCH Transcription and Translation"                                                                                    
##  [97] "PTEN Regulation"                                                                                                            
##  [98] "Autophagy"                                                                                                                  
##  [99] "RND1 GTPase cycle"                                                                                                          
## [100] "Diseases associated with glycosaminoglycan metabolism"                                                                      
## [101] "Disassembly of the destruction complex and recruitment of AXIN to the membrane"                                             
## [102] "Apoptotic factor-mediated response"                                                                                         
## [103] "ATF6 (ATF6-alpha) activates chaperones"                                                                                     
## [104] "Sema4D induced cell migration and growth-cone collapse"                                                                     
## [105] "ATF6 (ATF6-alpha) activates chaperone genes"                                                                                
## [106] "Heparan sulfate/heparin (HS-GAG) metabolism"                                                                                
## [107] "FOXO-mediated transcription of cell death genes"                                                                            
## [108] "Biological oxidations"                                                                                                      
## [109] "NR1H3 & NR1H2 regulate gene expression linked to cholesterol transport and efflux"                                          
## [110] "Transcriptional regulation by RUNX1"                                                                                        
## [111] "RAC3 GTPase cycle"                                                                                                          
## [112] "Prolactin receptor signaling"                                                                                               
## [113] "Intrinsic Pathway for Apoptosis"                                                                                            
## [114] "Pre-NOTCH Processing in Golgi"                                                                                              
## [115] "RHO GTPases activate CIT"                                                                                                   
## [116] "MyD88-independent TLR4 cascade"                                                                                             
## [117] "TRIF(TICAM1)-mediated TLR4 signaling"                                                                                       
## [118] "Signaling by Leptin"                                                                                                        
## [119] "EPH-ephrin mediated repulsion of cells"                                                                                     
## [120] "Transport of small molecules"                                                                                               
## [121] "FLT3 signaling in disease"                                                                                                  
## [122] "Defective pyroptosis"                                                                                                       
## [123] "Trafficking of GluR2-containing AMPA receptors"                                                                             
## [124] "Signaling by VEGF"                                                                                                          
## [125] "Tie2 Signaling"                                                                                                             
## [126] "RHO GTPases activate IQGAPs"                                                                                                
## [127] "Inflammasomes"                                                                                                              
## [128] "PI-3K cascade:FGFR3"                                                                                                        
## [129] "HS-GAG degradation"                                                                                                         
## [130] "Toll-like Receptor Cascades"                                                                                                
## [131] "DDX58/IFIH1-mediated induction of interferon-alpha/beta"                                                                    
## [132] "Glycerophospholipid biosynthesis"                                                                                           
## [133] "XBP1(S) activates chaperone genes"                                                                                          
## [134] "Glycosphingolipid metabolism"                                                                                               
## [135] "Plasma lipoprotein clearance"                                                                                               
## [136] "Erythropoietin activates Phosphoinositide-3-kinase (PI3K)"                                                                  
## [137] "Constitutive Signaling by NOTCH1 HD+PEST Domain Mutants"                                                                    
## [138] "Constitutive Signaling by NOTCH1 PEST Domain Mutants"                                                                       
## [139] "Signaling by NOTCH1 HD+PEST Domain Mutants in Cancer"                                                                       
## [140] "Signaling by NOTCH1 PEST Domain Mutants in Cancer"                                                                          
## [141] "Signaling by NOTCH1 in Cancer"                                                                                              
## [142] "RND3 GTPase cycle"                                                                                                          
## [143] "SARS-CoV-2 Infection"                                                                                                       
## [144] "RHOB GTPase cycle"                                                                                                          
## [145] "RND2 GTPase cycle"                                                                                                          
## [146] "Macroautophagy"                                                                                                             
## [147] "Pyruvate metabolism and Citric Acid (TCA) cycle"                                                                            
## [148] "RHOG GTPase cycle"                                                                                                          
## [149] "Glycosaminoglycan metabolism"                                                                                               
## [150] "Constitutive Signaling by Aberrant PI3K in Cancer"                                                                          
## [151] "Aberrant regulation of mitotic G1/S transition in cancer due to RB1 defects"                                                
## [152] "Defective binding of RB1 mutants to E2F1,(E2F2, E2F3)"                                                                      
## [153] "Negative regulation of MAPK pathway"                                                                                        
## [154] "Sphingolipid metabolism"                                                                                                    
## [155] "NR1H2 and NR1H3-mediated signaling"                                                                                         
## [156] "Signaling by TGF-beta Receptor Complex"
# intersection
intersect(mc_up,ms)
##   [1] "Metabolism of proteins"                                                                                  
##   [2] "Signal Transduction"                                                                                     
##   [3] "Metabolism of RNA"                                                                                       
##   [4] "Post-translational protein modification"                                                                 
##   [5] "Vesicle-mediated transport"                                                                              
##   [6] "Diseases of signal transduction by growth factor receptors and second messengers"                        
##   [7] "Extracellular matrix organization"                                                                       
##   [8] "Signaling by Rho GTPases"                                                                                
##   [9] "Signaling by Rho GTPases, Miro GTPases and RHOBTB3"                                                      
##  [10] "Membrane Trafficking"                                                                                    
##  [11] "Host Interactions of HIV factors"                                                                        
##  [12] "RHO GTPase Effectors"                                                                                    
##  [13] "Hemostasis"                                                                                              
##  [14] "Influenza Infection"                                                                                     
##  [15] "SRP-dependent cotranslational protein targeting to membrane"                                             
##  [16] "HIV Infection"                                                                                           
##  [17] "GTP hydrolysis and joining of the 60S ribosomal subunit"                                                 
##  [18] "Adaptive Immune System"                                                                                  
##  [19] "Cap-dependent Translation Initiation"                                                                    
##  [20] "Eukaryotic Translation Initiation"                                                                       
##  [21] "Influenza Viral RNA Transcription and Replication"                                                       
##  [22] "Cell Cycle, Mitotic"                                                                                     
##  [23] "Cell Cycle"                                                                                              
##  [24] "L13a-mediated translational silencing of Ceruloplasmin expression"                                       
##  [25] "Signaling by NOTCH"                                                                                      
##  [26] "Cellular response to hypoxia"                                                                            
##  [27] "Metabolism of amino acids and derivatives"                                                               
##  [28] "Regulation of HMOX1 expression and activity"                                                             
##  [29] "Mitotic G1 phase and G1/S transition"                                                                    
##  [30] "Programmed Cell Death"                                                                                   
##  [31] "G1/S Transition"                                                                                         
##  [32] "Formation of a pool of free 40S subunits"                                                                
##  [33] "Oxygen-dependent proline hydroxylation of Hypoxia-inducible Factor Alpha"                                
##  [34] "Cellular response to chemical stress"                                                                    
##  [35] "Apoptosis"                                                                                               
##  [36] "Asparagine N-linked glycosylation"                                                                       
##  [37] "DNA Replication"                                                                                         
##  [38] "DNA Replication Pre-Initiation"                                                                          
##  [39] "Mitotic Anaphase"                                                                                        
##  [40] "Response of EIF2AK4 (GCN2) to amino acid deficiency"                                                     
##  [41] "Mitotic Metaphase and Anaphase"                                                                          
##  [42] "Eukaryotic Translation Elongation"                                                                       
##  [43] "Peptide chain elongation"                                                                                
##  [44] "HCMV Early Events"                                                                                       
##  [45] "Metabolism of polyamines"                                                                                
##  [46] "Nonsense Mediated Decay (NMD) enhanced by the Exon Junction Complex (EJC)"                               
##  [47] "Nonsense-Mediated Decay (NMD)"                                                                           
##  [48] "Degradation of beta-catenin by the destruction complex"                                                  
##  [49] "Signaling by WNT"                                                                                        
##  [50] "Viral mRNA Translation"                                                                                  
##  [51] "Cell Cycle Checkpoints"                                                                                  
##  [52] "Cytoprotection by HMOX1"                                                                                 
##  [53] "ER to Golgi Anterograde Transport"                                                                       
##  [54] "Transport to the Golgi and subsequent modification"                                                      
##  [55] "rRNA modification in the nucleus and cytosol"                                                            
##  [56] "CLEC7A (Dectin-1) signaling"                                                                             
##  [57] "MAPK family signaling cascades"                                                                          
##  [58] "EPH-Ephrin signaling"                                                                                    
##  [59] "Golgi-to-ER retrograde transport"                                                                        
##  [60] "Signaling by NOTCH4"                                                                                     
##  [61] "Eukaryotic Translation Termination"                                                                      
##  [62] "MAPK6/MAPK4 signaling"                                                                                   
##  [63] "Downstream TCR signaling"                                                                                
##  [64] "Selenoamino acid metabolism"                                                                             
##  [65] "Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC)"                            
##  [66] "Cyclin A:Cdk2-associated events at S phase entry"                                                        
##  [67] "HSP90 chaperone cycle for steroid hormone receptors (SHR) in the presence of ligand"                     
##  [68] "Downstream signaling events of B Cell Receptor (BCR)"                                                    
##  [69] "ER-Phagosome pathway"                                                                                    
##  [70] "FCERI mediated NF-kB activation"                                                                         
##  [71] "Cellular response to starvation"                                                                         
##  [72] "Assembly of the pre-replicative complex"                                                                 
##  [73] "Interleukin-1 signaling"                                                                                 
##  [74] "TNFR2 non-canonical NF-kB pathway"                                                                       
##  [75] "Fc epsilon receptor (FCERI) signaling"                                                                   
##  [76] "RHO GTPase cycle"                                                                                        
##  [77] "Regulation of mRNA stability by proteins that bind AU-rich elements"                                     
##  [78] "SCF(Skp2)-mediated degradation of p27/p21"                                                               
##  [79] "Defective CFTR causes cystic fibrosis"                                                                   
##  [80] "HCMV Infection"                                                                                          
##  [81] "Antigen processing-Cross presentation"                                                                   
##  [82] "ROS sensing by NFE2L2"                                                                                   
##  [83] "Synthesis of DNA"                                                                                        
##  [84] "Cyclin E associated events during G1/S transition"                                                       
##  [85] "Separation of Sister Chromatids"                                                                         
##  [86] "Selenocysteine synthesis"                                                                                
##  [87] "Neddylation"                                                                                             
##  [88] "Vpu mediated degradation of CD4"                                                                         
##  [89] "Regulation of ornithine decarboxylase (ODC)"                                                             
##  [90] "p53-Dependent G1 DNA Damage Response"                                                                    
##  [91] "p53-Dependent G1/S DNA damage checkpoint"                                                                
##  [92] "Degradation of DVL"                                                                                      
##  [93] "Collagen biosynthesis and modifying enzymes"                                                             
##  [94] "G1/S DNA Damage Checkpoints"                                                                             
##  [95] "NIK-->noncanonical NF-kB signaling"                                                                      
##  [96] "EPHB-mediated forward signaling"                                                                         
##  [97] "FBXL7 down-regulates AURKA during mitotic entry and in early mitosis"                                    
##  [98] "Dectin-1 mediated noncanonical NF-kB signaling"                                                          
##  [99] "SCF-beta-TrCP mediated degradation of Emi1"                                                              
## [100] "RUNX1 regulates transcription of genes involved in differentiation of HSCs"                              
## [101] "Ub-specific processing proteases"                                                                        
## [102] "Purine ribonucleoside monophosphate biosynthesis"                                                        
## [103] "Orc1 removal from chromatin"                                                                             
## [104] "PCP/CE pathway"                                                                                          
## [105] "C-type lectin receptors (CLRs)"                                                                          
## [106] "Hh mutants are degraded by ERAD"                                                                         
## [107] "Class I MHC mediated antigen processing & presentation"                                                  
## [108] "M Phase"                                                                                                 
## [109] "TCR signaling"                                                                                           
## [110] "Activation of NF-kappaB in B cells"                                                                      
## [111] "Autodegradation of the E3 ubiquitin ligase COP1"                                                         
## [112] "Vif-mediated degradation of APOBEC3G"                                                                    
## [113] "S Phase"                                                                                                 
## [114] "RAF/MAP kinase cascade"                                                                                  
## [115] "EML4 and NUDC in mitotic spindle formation"                                                              
## [116] "Degradation of GLI1 by the proteasome"                                                                   
## [117] "Collagen formation"                                                                                      
## [118] "MHC class II antigen presentation"                                                                       
## [119] "MAPK1/MAPK3 signaling"                                                                                   
## [120] "RHO GTPases Activate Formins"                                                                            
## [121] "Hedgehog ligand biogenesis"                                                                              
## [122] "Degradation of GLI2 by the proteasome"                                                                   
## [123] "Switching of origins to a post-replicative state"                                                        
## [124] "Regulation of RUNX2 expression and activity"                                                             
## [125] "Hh mutants abrogate ligand secretion"                                                                    
## [126] "Negative regulation of NOTCH4 signaling"                                                                 
## [127] "COPI-independent Golgi-to-ER retrograde traffic"                                                         
## [128] "Cross-presentation of soluble exogenous antigens (endosomes)"                                            
## [129] "ABC transporter disorders"                                                                               
## [130] "Regulation of activated PAK-2p34 by proteasome mediated degradation"                                     
## [131] "AUF1 (hnRNP D0) binds and destabilizes mRNA"                                                             
## [132] "Disorders of transmembrane transporters"                                                                 
## [133] "Ribosomal scanning and start codon recognition"                                                          
## [134] "Stabilization of p53"                                                                                    
## [135] "CDT1 association with the CDC6:ORC:origin complex"                                                       
## [136] "Intra-Golgi and retrograde Golgi-to-ER traffic"                                                          
## [137] "Smooth Muscle Contraction"                                                                               
## [138] "GLI3 is processed to GLI3R by the proteasome"                                                            
## [139] "Ubiquitin Mediated Degradation of Phosphorylated Cdc25A"                                                 
## [140] "p53-Independent DNA Damage Response"                                                                     
## [141] "p53-Independent G1/S DNA damage checkpoint"                                                              
## [142] "Beta-catenin independent WNT signaling"                                                                  
## [143] "Signaling by the B Cell Receptor (BCR)"                                                                  
## [144] "Regulation of Apoptosis"                                                                                 
## [145] "TCF dependent signaling in response to WNT"                                                              
## [146] "Cellular response to heat stress"                                                                        
## [147] "Nuclear Envelope Breakdown"                                                                              
## [148] "Regulation of HSF1-mediated heat shock response"                                                         
## [149] "CDK-mediated phosphorylation and removal of Cdc6"                                                        
## [150] "Clathrin-mediated endocytosis"                                                                           
## [151] "Interleukin-1 family signaling"                                                                          
## [152] "Cell-extracellular matrix interactions"                                                                  
## [153] "Amplification  of signal from unattached  kinetochores via a MAD2  inhibitory signal"                    
## [154] "Amplification of signal from the kinetochores"                                                           
## [155] "Interleukin-12 signaling"                                                                                
## [156] "Regulation of RAS by GAPs"                                                                               
## [157] "Activation of the mRNA upon binding of the cap-binding complex and eIFs, and subsequent binding to 43S"  
## [158] "The role of GTSE1 in G2/M progression after G2 checkpoint"                                               
## [159] "Transcriptional regulation by RUNX3"                                                                     
## [160] "COPI-mediated anterograde transport"                                                                     
## [161] "Translation initiation complex formation"                                                                
## [162] "Glycolysis"                                                                                              
## [163] "Mitotic G2-G2/M phases"                                                                                  
## [164] "Interleukin-12 family signaling"                                                                         
## [165] "Glucose metabolism"                                                                                      
## [166] "Striated Muscle Contraction"                                                                             
## [167] "Degradation of AXIN"                                                                                     
## [168] "tRNA processing in the nucleus"                                                                          
## [169] "Asymmetric localization of PCP proteins"                                                                 
## [170] "Mitotic Prophase"                                                                                        
## [171] "Regulation of RUNX3 expression and activity"                                                             
## [172] "UCH proteinases"                                                                                         
## [173] "ABC-family proteins mediated transport"                                                                  
## [174] "Ubiquitin-dependent degradation of Cyclin D"                                                             
## [175] "Nucleotide biosynthesis"                                                                                 
## [176] "Metabolism of non-coding RNA"                                                                            
## [177] "snRNP Assembly"                                                                                          
## [178] "Transcriptional regulation by RUNX2"                                                                     
## [179] "Fcgamma receptor (FCGR) dependent phagocytosis"                                                          
## [180] "G2/M Transition"                                                                                         
## [181] "Interactions of Vpr with host cellular proteins"                                                         
## [182] "Autodegradation of Cdh1 by Cdh1:APC/C"                                                                   
## [183] "Regulation of APC/C activators between G1/S and early anaphase"                                          
## [184] "Gene and protein expression by JAK-STAT signaling after Interleukin-12 stimulation"                      
## [185] "Folding of actin by CCT/TriC"                                                                            
## [186] "Mitotic Spindle Checkpoint"                                                                              
## [187] "Formation of the ternary complex, and subsequently, the 43S complex"                                     
## [188] "Regulation of actin dynamics for phagocytic cup formation"                                               
## [189] "Interferon alpha/beta signaling"                                                                         
## [190] "Cdc20:Phospho-APC/C mediated degradation of Cyclin A"                                                    
## [191] "Gene Silencing by RNA"                                                                                   
## [192] "Transport of the SLBP Dependant Mature mRNA"                                                             
## [193] "Nuclear Envelope (NE) Reassembly"                                                                        
## [194] "RHO GTPases Activate ROCKs"                                                                              
## [195] "Selective autophagy"                                                                                     
## [196] "Prefoldin mediated transfer of substrate  to CCT/TriC"                                                   
## [197] "Transport of the SLBP independent Mature mRNA"                                                           
## [198] "APC:Cdc20 mediated degradation of cell cycle proteins prior to satisfation of the cell cycle checkpoint" 
## [199] "Nuclear import of Rev protein"                                                                           
## [200] "Interactions of Rev with host cellular proteins"                                                         
## [201] "COPII-mediated vesicle transport"                                                                        
## [202] "Transport of Ribonucleoproteins into the Host Nucleus"                                                   
## [203] "APC/C:Cdc20 mediated degradation of Securin"                                                             
## [204] "Formation of tubulin folding intermediates by CCT/TriC"                                                  
## [205] "NS1 Mediated Effects on Host Pathways"                                                                   
## [206] "COPI-dependent Golgi-to-ER retrograde traffic"                                                           
## [207] "Late Phase of HIV Life Cycle"                                                                            
## [208] "Cargo recognition for clathrin-mediated endocytosis"                                                     
## [209] "Cooperation of Prefoldin and TriC/CCT  in actin and tubulin folding"                                     
## [210] "Transcriptional regulation by small RNAs"                                                                
## [211] "Antigen processing: Ubiquitination & Proteasome degradation"                                             
## [212] "Transport of Mature mRNAs Derived from Intronless Transcripts"                                           
## [213] "HIV Life Cycle"                                                                                          
## [214] "APC/C:Cdh1 mediated degradation of Cdc20 and other APC/C:Cdh1 targeted proteins in late mitosis/early G1"
## [215] "Regulation of PTEN stability and activity"                                                               
## [216] "Export of Viral Ribonucleoproteins from Nucleus"                                                         
## [217] "NEP/NS2 Interacts with the Cellular Export Machinery"                                                    
## [218] "G2/M Checkpoints"                                                                                        
## [219] "Vpr-mediated nuclear import of PICs"                                                                     
## [220] "Rev-mediated nuclear export of HIV RNA"                                                                  
## [221] "Potential therapeutics for SARS"                                                                         
## [222] "Syndecan interactions"                                                                                   
## [223] "Postmitotic nuclear pore complex (NPC) reformation"                                                      
## [224] "Resolution of Sister Chromatid Cohesion"                                                                 
## [225] "Transport of Mature mRNA Derived from an Intronless Transcript"                                          
## [226] "Hedgehog 'on' state"                                                                                     
## [227] "Nuclear Pore Complex (NPC) Disassembly"                                                                  
## [228] "Interconversion of nucleotide di- and triphosphates"                                                     
## [229] "Activation of APC/C and APC/C:Cdc20 mediated degradation of mitotic proteins"                            
## [230] "Processing of Capped Intron-Containing Pre-mRNA"                                                         
## [231] "Cargo concentration in the ER"                                                                           
## [232] "APC/C:Cdc20 mediated degradation of mitotic proteins"                                                    
## [233] "Initiation of Nuclear Envelope (NE) Reformation"                                                         
## [234] "Defective TPR may confer susceptibility towards thyroid papillary carcinoma (TPC)"                       
## [235] "Regulation of Glucokinase by Glucokinase Regulatory Protein"                                             
## [236] "Interleukin-20 family signaling"                                                                         
## [237] "SUMOylation of ubiquitinylation proteins"                                                                
## [238] "Hedgehog 'off' state"                                                                                    
## [239] "Beta-catenin phosphorylation cascade"                                                                    
## [240] "APC/C-mediated degradation of cell cycle proteins"                                                       
## [241] "Regulation of mitotic cell cycle"                                                                        
## [242] "IRE1alpha activates chaperones"                                                                          
## [243] "L1CAM interactions"                                                                                      
## [244] "RHOBTB2 GTPase cycle"                                                                                    
## [245] "RHOBTB GTPase Cycle"                                                                                     
## [246] "RAF activation"

If we consider both strategies to be valid, then we can define the significant sets as dysregulated. We can calculate the percent sentitivity of both approaches.

all <- unique(c(ms_up,ms_dn,mc_up))

message("Sensitivity: separate only")
## Sensitivity: separate only
(length(ms_up)+length(ms_dn))/length(all)
## [1] 0.6929134
message("Sensitivity: combined only")
## Sensitivity: combined only
length(mc_up)/length(all)
## [1] 0.7913386

ORA with clusterprofiler

Clusterprofiler uses a hypergeometric test. Firstly I will conduct the analysis separately for up and down regulated genes and with the correct backgound (as intended by the developers).

genesets2 <- read.gmt("ReactomePathways.gmt")

de_up <- rownames(subset(de, padj<0.05 & log2FoldChange > 0))
de_up <- unique(gt[which(rownames(gt) %in% de_up),1])

de_dn <- rownames(subset(de, padj<0.05 & log2FoldChange < 0))
de_dn <- unique(gt[which(rownames(gt) %in% de_dn),1])

de_bg <- rownames(de)
de_bg <- unique(gt[which(rownames(gt) %in% de_bg),1])

o_up <- as.data.frame(enricher(gene = de_up, universe = de_bg,  maxGSSize = 5000, TERM2GENE = genesets2, pAdjustMethod="fdr"))
o_up <- rownames(subset(o_up, p.adjust < 0.05))
       
o_dn <- as.data.frame(enricher(gene = de_dn, universe = de_bg,  maxGSSize = 5000, TERM2GENE = genesets2, pAdjustMethod="fdr"))
o_dn <- rownames(subset(o_dn, p.adjust < 0.05))

o_com <- as.data.frame(enricher(gene = union(de_up,de_dn), universe = de_bg,  maxGSSize = 5000, TERM2GENE = genesets2, pAdjustMethod="fdr"))
o_com <- rownames(subset(o_com, p.adjust < 0.05))

length(o_up)
## [1] 271
length(o_dn)
## [1] 38
length(o_up) + length(o_dn)
## [1] 309
length(o_com)
## [1] 181
( length(o_up) + length(o_dn) ) / length(o_com)
## [1] 1.707182
all <- unique(c(o_up,o_dn,o_com))

message("Sensitivity: separate only")
## Sensitivity: separate only
(length(o_up)+length(o_dn))/length(all)
## [1] 0.9392097
message("Sensitivity: combined only")
## Sensitivity: combined only
length(o_com)/length(all)
## [1] 0.550152

Euler diagram of the significant pathways found with each approach.

l2 <- list("sep up"=o_up,"sep dn"=o_dn,"comb"=o_com)

plot(euler(l2),quantities = TRUE, edges = "gray", main="ORA: combined vs separated")

List gene sets which are specific to each approach.

o_sep <- c(o_up,o_dn)

# in sep but not comb
setdiff(o_sep,o_com)
##   [1] "Cell Cycle"                                                                                              
##   [2] "M Phase"                                                                                                 
##   [3] "Signaling by the B Cell Receptor (BCR)"                                                                  
##   [4] "RAF/MAP kinase cascade"                                                                                  
##   [5] "Processing of Capped Intron-Containing Pre-mRNA"                                                         
##   [6] "Regulation of APC/C activators between G1/S and early anaphase"                                          
##   [7] "APC/C:Cdc20 mediated degradation of Securin"                                                             
##   [8] "Mitotic G2-G2/M phases"                                                                                  
##   [9] "MAPK1/MAPK3 signaling"                                                                                   
##  [10] "mRNA Splicing - Major Pathway"                                                                           
##  [11] "Cdc20:Phospho-APC/C mediated degradation of Cyclin A"                                                    
##  [12] "Autodegradation of Cdh1 by Cdh1:APC/C"                                                                   
##  [13] "G2/M Checkpoints"                                                                                        
##  [14] "G2/M Transition"                                                                                         
##  [15] "APC:Cdc20 mediated degradation of cell cycle proteins prior to satisfation of the cell cycle checkpoint" 
##  [16] "Regulation of RAS by GAPs"                                                                               
##  [17] "Amplification  of signal from unattached  kinetochores via a MAD2  inhibitory signal"                    
##  [18] "Amplification of signal from the kinetochores"                                                           
##  [19] "mRNA Splicing"                                                                                           
##  [20] "APC/C:Cdc20 mediated degradation of mitotic proteins"                                                    
##  [21] "Regulation of RUNX3 expression and activity"                                                             
##  [22] "RHOBTB GTPase Cycle"                                                                                     
##  [23] "Fc epsilon receptor (FCERI) signaling"                                                                   
##  [24] "COPI-mediated anterograde transport"                                                                     
##  [25] "Activation of APC/C and APC/C:Cdc20 mediated degradation of mitotic proteins"                            
##  [26] "Adaptive Immune System"                                                                                  
##  [27] "APC/C:Cdh1 mediated degradation of Cdc20 and other APC/C:Cdh1 targeted proteins in late mitosis/early G1"
##  [28] "Mitotic Spindle Checkpoint"                                                                              
##  [29] "APC/C-mediated degradation of cell cycle proteins"                                                       
##  [30] "Regulation of mitotic cell cycle"                                                                        
##  [31] "Cellular response to heat stress"                                                                        
##  [32] "RAF activation"                                                                                          
##  [33] "UCH proteinases"                                                                                         
##  [34] "Asymmetric localization of PCP proteins"                                                                 
##  [35] "Metabolism of non-coding RNA"                                                                            
##  [36] "snRNP Assembly"                                                                                          
##  [37] "Regulation of HSF1-mediated heat shock response"                                                         
##  [38] "Hedgehog 'off' state"                                                                                    
##  [39] "COPII-mediated vesicle transport"                                                                        
##  [40] "RUNX1 regulates transcription of genes involved in differentiation of HSCs"                              
##  [41] "Folding of actin by CCT/TriC"                                                                            
##  [42] "Postmitotic nuclear pore complex (NPC) reformation"                                                      
##  [43] "TNFR2 non-canonical NF-kB pathway"                                                                       
##  [44] "Regulation of PTEN stability and activity"                                                               
##  [45] "Interactions of Rev with host cellular proteins"                                                         
##  [46] "Neddylation"                                                                                             
##  [47] "Formation of tubulin folding intermediates by CCT/TriC"                                                  
##  [48] "Resolution of Sister Chromatid Cohesion"                                                                 
##  [49] "tRNA processing"                                                                                         
##  [50] "RHOBTB1 GTPase cycle"                                                                                    
##  [51] "RHOBTB2 GTPase cycle"                                                                                    
##  [52] "Intra-Golgi and retrograde Golgi-to-ER traffic"                                                          
##  [53] "Cytoprotection by HMOX1"                                                                                 
##  [54] "Cargo concentration in the ER"                                                                           
##  [55] "Signaling by WNT"                                                                                        
##  [56] "Transport of the SLBP Dependant Mature mRNA"                                                             
##  [57] "Interleukin-12 signaling"                                                                                
##  [58] "Selective autophagy"                                                                                     
##  [59] "Transcriptional regulation by RUNX3"                                                                     
##  [60] "Cooperation of Prefoldin and TriC/CCT  in actin and tubulin folding"                                     
##  [61] "Interleukin-1 family signaling"                                                                          
##  [62] "Nuclear import of Rev protein"                                                                           
##  [63] "Initiation of Nuclear Envelope (NE) Reformation"                                                         
##  [64] "Mitotic Prophase"                                                                                        
##  [65] "COPI-dependent Golgi-to-ER retrograde traffic"                                                           
##  [66] "Transcription-Coupled Nucleotide Excision Repair (TC-NER)"                                               
##  [67] "Potential therapeutics for SARS"                                                                         
##  [68] "Glycolysis"                                                                                              
##  [69] "Class I MHC mediated antigen processing & presentation"                                                  
##  [70] "Prefoldin mediated transfer of substrate  to CCT/TriC"                                                   
##  [71] "Interleukin-12 family signaling"                                                                         
##  [72] "Export of Viral Ribonucleoproteins from Nucleus"                                                         
##  [73] "NEP/NS2 Interacts with the Cellular Export Machinery"                                                    
##  [74] "Transport of Ribonucleoproteins into the Host Nucleus"                                                   
##  [75] "Rev-mediated nuclear export of HIV RNA"                                                                  
##  [76] "Transport of the SLBP independent Mature mRNA"                                                           
##  [77] "ABC-family proteins mediated transport"                                                                  
##  [78] "Clathrin-mediated endocytosis"                                                                           
##  [79] "TCF dependent signaling in response to WNT"                                                              
##  [80] "Regulation of actin dynamics for phagocytic cup formation"                                               
##  [81] "Beta-catenin independent WNT signaling"                                                                  
##  [82] "Cellular response to chemical stress"                                                                    
##  [83] "Transcriptional regulation by small RNAs"                                                                
##  [84] "Transcriptional regulation by RUNX2"                                                                     
##  [85] "S33 mutants of beta-catenin aren't phosphorylated"                                                       
##  [86] "S37 mutants of beta-catenin aren't phosphorylated"                                                       
##  [87] "S45 mutants of beta-catenin aren't phosphorylated"                                                       
##  [88] "Signaling by CTNNB1 phospho-site mutants"                                                                
##  [89] "Signaling by GSK3beta mutants"                                                                           
##  [90] "T41 mutants of beta-catenin aren't phosphorylated"                                                       
##  [91] "Signaling by Hedgehog"                                                                                   
##  [92] "Cyclin D associated events in G1"                                                                        
##  [93] "G1 Phase"                                                                                                
##  [94] "Late Phase of HIV Life Cycle"                                                                            
##  [95] "Transport of Mature mRNAs Derived from Intronless Transcripts"                                           
##  [96] "mRNA Splicing - Minor Pathway"                                                                           
##  [97] "SUMOylation of RNA binding proteins"                                                                     
##  [98] "Viral Messenger RNA Synthesis"                                                                           
##  [99] "RHO GTPase cycle"                                                                                        
## [100] "Formation of TC-NER Pre-Incision Complex"                                                                
## [101] "Negative regulation of MAPK pathway"                                                                     
## [102] "RHOA GTPase cycle"                                                                                       
## [103] "Mitotic Prometaphase"                                                                                    
## [104] "Gene and protein expression by JAK-STAT signaling after Interleukin-12 stimulation"                      
## [105] "Nucleotide Excision Repair"                                                                              
## [106] "Transport of Mature mRNA Derived from an Intronless Transcript"                                          
## [107] "Cargo recognition for clathrin-mediated endocytosis"                                                     
## [108] "Hedgehog 'on' state"                                                                                     
## [109] "Transcription of the HIV genome"                                                                         
## [110] "Nuclear Envelope Breakdown"                                                                              
## [111] "APC truncation mutants have impaired AXIN binding"                                                       
## [112] "AXIN missense mutants destabilize the destruction complex"                                               
## [113] "Nucleotide biosynthesis"                                                                                 
## [114] "Signaling by AMER1 mutants"                                                                              
## [115] "Signaling by APC mutants"                                                                                
## [116] "Signaling by AXIN mutants"                                                                               
## [117] "Truncations of AMER1 destabilize the destruction complex"                                                
## [118] "Fcgamma receptor (FCGR) dependent phagocytosis"                                                          
## [119] "Beta-catenin phosphorylation cascade"                                                                    
## [120] "Nef-mediates down modulation of cell surface receptors by recruiting them to clathrin adapters"          
## [121] "Defective TPR may confer susceptibility towards thyroid papillary carcinoma (TPC)"                       
## [122] "Regulation of Glucokinase by Glucokinase Regulatory Protein"                                             
## [123] "RHOC GTPase cycle"                                                                                       
## [124] "Aggrephagy"                                                                                              
## [125] "HSF1 activation"                                                                                         
## [126] "Transport of Mature Transcript to Cytoplasm"                                                             
## [127] "NS1 Mediated Effects on Host Pathways"                                                                   
## [128] "Interactions of Vpr with host cellular proteins"                                                         
## [129] "Signaling by Interleukins"                                                                               
## [130] "RHO GTPases Activate WASPs and WAVEs"                                                                    
## [131] "Smooth Muscle Contraction"                                                                               
## [132] "Vpr-mediated nuclear import of PICs"                                                                     
## [133] "HIV Life Cycle"                                                                                          
## [134] "Signaling by FGFR2 in disease"                                                                           
## [135] "Signaling by FGFR3 in disease"                                                                           
## [136] "Signaling by FGFR3 point mutants in cancer"                                                              
## [137] "Striated Muscle Contraction"                                                                             
## [138] "Glucose metabolism"                                                                                      
## [139] "Transport of Mature mRNA derived from an Intron-Containing Transcript"                                   
## [140] "L1CAM interactions"                                                                                      
## [141] "Antigen processing: Ubiquitination & Proteasome degradation"                                             
## [142] "Interferon alpha/beta signaling"                                                                         
## [143] "Ribosomal scanning and start codon recognition"                                                          
## [144] "Translation initiation complex formation"                                                                
## [145] "Formation of the ternary complex, and subsequently, the 43S complex"                                     
## [146] "Activation of the mRNA upon binding of the cap-binding complex and eIFs, and subsequent binding to 43S"  
## [147] "FOXO-mediated transcription of cell cycle genes"                                                         
## [148] "SARS-CoV-1 Infection"
# in comb but not sep
setdiff(o_com,o_sep)
##  [1] "Regulation of Insulin-like Growth Factor (IGF) transport and uptake by Insulin-like Growth Factor Binding Proteins (IGFBPs)"
##  [2] "Post-translational protein phosphorylation"                                                                                 
##  [3] "trans-Golgi Network Vesicle Budding"                                                                                        
##  [4] "Cytokine Signaling in Immune system"                                                                                        
##  [5] "SARS-CoV Infections"                                                                                                        
##  [6] "Antiviral mechanism by IFN-stimulated genes"                                                                                
##  [7] "Golgi Associated Vesicle Biogenesis"                                                                                        
##  [8] "ESR-mediated signaling"                                                                                                     
##  [9] "Signaling by FLT3 ITD and TKD mutants"                                                                                      
## [10] "Translation"                                                                                                                
## [11] "Binding and Uptake of Ligands by Scavenger Receptors"                                                                       
## [12] "Scavenging by Class A Receptors"                                                                                            
## [13] "N-glycan trimming in the ER and Calnexin/Calreticulin cycle"                                                                
## [14] "Signaling by FLT3 fusion proteins"                                                                                          
## [15] "Signaling by MET"                                                                                                           
## [16] "The NLRP3 inflammasome"                                                                                                     
## [17] "FLT3 signaling in disease"                                                                                                  
## [18] "Lysosome Vesicle Biogenesis"                                                                                                
## [19] "Signaling by Nuclear Receptors"                                                                                             
## [20] "Signal Transduction"                                                                                                        
## [21] "Inflammasomes"                                                                                                              
## [22] "Platelet activation, signaling and aggregation"                                                                             
## [23] "Signaling by Receptor Tyrosine Kinases"                                                                                     
## [24] "GPVI-mediated activation cascade"                                                                                           
## [25] "Metabolism"                                                                                                                 
## [26] "Adherens junctions interactions"
# intersection
intersect(mc_up,ms)
##   [1] "Metabolism of proteins"                                                                                  
##   [2] "Signal Transduction"                                                                                     
##   [3] "Metabolism of RNA"                                                                                       
##   [4] "Post-translational protein modification"                                                                 
##   [5] "Vesicle-mediated transport"                                                                              
##   [6] "Diseases of signal transduction by growth factor receptors and second messengers"                        
##   [7] "Extracellular matrix organization"                                                                       
##   [8] "Signaling by Rho GTPases"                                                                                
##   [9] "Signaling by Rho GTPases, Miro GTPases and RHOBTB3"                                                      
##  [10] "Membrane Trafficking"                                                                                    
##  [11] "Host Interactions of HIV factors"                                                                        
##  [12] "RHO GTPase Effectors"                                                                                    
##  [13] "Hemostasis"                                                                                              
##  [14] "Influenza Infection"                                                                                     
##  [15] "SRP-dependent cotranslational protein targeting to membrane"                                             
##  [16] "HIV Infection"                                                                                           
##  [17] "GTP hydrolysis and joining of the 60S ribosomal subunit"                                                 
##  [18] "Adaptive Immune System"                                                                                  
##  [19] "Cap-dependent Translation Initiation"                                                                    
##  [20] "Eukaryotic Translation Initiation"                                                                       
##  [21] "Influenza Viral RNA Transcription and Replication"                                                       
##  [22] "Cell Cycle, Mitotic"                                                                                     
##  [23] "Cell Cycle"                                                                                              
##  [24] "L13a-mediated translational silencing of Ceruloplasmin expression"                                       
##  [25] "Signaling by NOTCH"                                                                                      
##  [26] "Cellular response to hypoxia"                                                                            
##  [27] "Metabolism of amino acids and derivatives"                                                               
##  [28] "Regulation of HMOX1 expression and activity"                                                             
##  [29] "Mitotic G1 phase and G1/S transition"                                                                    
##  [30] "Programmed Cell Death"                                                                                   
##  [31] "G1/S Transition"                                                                                         
##  [32] "Formation of a pool of free 40S subunits"                                                                
##  [33] "Oxygen-dependent proline hydroxylation of Hypoxia-inducible Factor Alpha"                                
##  [34] "Cellular response to chemical stress"                                                                    
##  [35] "Apoptosis"                                                                                               
##  [36] "Asparagine N-linked glycosylation"                                                                       
##  [37] "DNA Replication"                                                                                         
##  [38] "DNA Replication Pre-Initiation"                                                                          
##  [39] "Mitotic Anaphase"                                                                                        
##  [40] "Response of EIF2AK4 (GCN2) to amino acid deficiency"                                                     
##  [41] "Mitotic Metaphase and Anaphase"                                                                          
##  [42] "Eukaryotic Translation Elongation"                                                                       
##  [43] "Peptide chain elongation"                                                                                
##  [44] "HCMV Early Events"                                                                                       
##  [45] "Metabolism of polyamines"                                                                                
##  [46] "Nonsense Mediated Decay (NMD) enhanced by the Exon Junction Complex (EJC)"                               
##  [47] "Nonsense-Mediated Decay (NMD)"                                                                           
##  [48] "Degradation of beta-catenin by the destruction complex"                                                  
##  [49] "Signaling by WNT"                                                                                        
##  [50] "Viral mRNA Translation"                                                                                  
##  [51] "Cell Cycle Checkpoints"                                                                                  
##  [52] "Cytoprotection by HMOX1"                                                                                 
##  [53] "ER to Golgi Anterograde Transport"                                                                       
##  [54] "Transport to the Golgi and subsequent modification"                                                      
##  [55] "rRNA modification in the nucleus and cytosol"                                                            
##  [56] "CLEC7A (Dectin-1) signaling"                                                                             
##  [57] "MAPK family signaling cascades"                                                                          
##  [58] "EPH-Ephrin signaling"                                                                                    
##  [59] "Golgi-to-ER retrograde transport"                                                                        
##  [60] "Signaling by NOTCH4"                                                                                     
##  [61] "Eukaryotic Translation Termination"                                                                      
##  [62] "MAPK6/MAPK4 signaling"                                                                                   
##  [63] "Downstream TCR signaling"                                                                                
##  [64] "Selenoamino acid metabolism"                                                                             
##  [65] "Nonsense Mediated Decay (NMD) independent of the Exon Junction Complex (EJC)"                            
##  [66] "Cyclin A:Cdk2-associated events at S phase entry"                                                        
##  [67] "HSP90 chaperone cycle for steroid hormone receptors (SHR) in the presence of ligand"                     
##  [68] "Downstream signaling events of B Cell Receptor (BCR)"                                                    
##  [69] "ER-Phagosome pathway"                                                                                    
##  [70] "FCERI mediated NF-kB activation"                                                                         
##  [71] "Cellular response to starvation"                                                                         
##  [72] "Assembly of the pre-replicative complex"                                                                 
##  [73] "Interleukin-1 signaling"                                                                                 
##  [74] "TNFR2 non-canonical NF-kB pathway"                                                                       
##  [75] "Fc epsilon receptor (FCERI) signaling"                                                                   
##  [76] "RHO GTPase cycle"                                                                                        
##  [77] "Regulation of mRNA stability by proteins that bind AU-rich elements"                                     
##  [78] "SCF(Skp2)-mediated degradation of p27/p21"                                                               
##  [79] "Defective CFTR causes cystic fibrosis"                                                                   
##  [80] "HCMV Infection"                                                                                          
##  [81] "Antigen processing-Cross presentation"                                                                   
##  [82] "ROS sensing by NFE2L2"                                                                                   
##  [83] "Synthesis of DNA"                                                                                        
##  [84] "Cyclin E associated events during G1/S transition"                                                       
##  [85] "Separation of Sister Chromatids"                                                                         
##  [86] "Selenocysteine synthesis"                                                                                
##  [87] "Neddylation"                                                                                             
##  [88] "Vpu mediated degradation of CD4"                                                                         
##  [89] "Regulation of ornithine decarboxylase (ODC)"                                                             
##  [90] "p53-Dependent G1 DNA Damage Response"                                                                    
##  [91] "p53-Dependent G1/S DNA damage checkpoint"                                                                
##  [92] "Degradation of DVL"                                                                                      
##  [93] "Collagen biosynthesis and modifying enzymes"                                                             
##  [94] "G1/S DNA Damage Checkpoints"                                                                             
##  [95] "NIK-->noncanonical NF-kB signaling"                                                                      
##  [96] "EPHB-mediated forward signaling"                                                                         
##  [97] "FBXL7 down-regulates AURKA during mitotic entry and in early mitosis"                                    
##  [98] "Dectin-1 mediated noncanonical NF-kB signaling"                                                          
##  [99] "SCF-beta-TrCP mediated degradation of Emi1"                                                              
## [100] "RUNX1 regulates transcription of genes involved in differentiation of HSCs"                              
## [101] "Ub-specific processing proteases"                                                                        
## [102] "Purine ribonucleoside monophosphate biosynthesis"                                                        
## [103] "Orc1 removal from chromatin"                                                                             
## [104] "PCP/CE pathway"                                                                                          
## [105] "C-type lectin receptors (CLRs)"                                                                          
## [106] "Hh mutants are degraded by ERAD"                                                                         
## [107] "Class I MHC mediated antigen processing & presentation"                                                  
## [108] "M Phase"                                                                                                 
## [109] "TCR signaling"                                                                                           
## [110] "Activation of NF-kappaB in B cells"                                                                      
## [111] "Autodegradation of the E3 ubiquitin ligase COP1"                                                         
## [112] "Vif-mediated degradation of APOBEC3G"                                                                    
## [113] "S Phase"                                                                                                 
## [114] "RAF/MAP kinase cascade"                                                                                  
## [115] "EML4 and NUDC in mitotic spindle formation"                                                              
## [116] "Degradation of GLI1 by the proteasome"                                                                   
## [117] "Collagen formation"                                                                                      
## [118] "MHC class II antigen presentation"                                                                       
## [119] "MAPK1/MAPK3 signaling"                                                                                   
## [120] "RHO GTPases Activate Formins"                                                                            
## [121] "Hedgehog ligand biogenesis"                                                                              
## [122] "Degradation of GLI2 by the proteasome"                                                                   
## [123] "Switching of origins to a post-replicative state"                                                        
## [124] "Regulation of RUNX2 expression and activity"                                                             
## [125] "Hh mutants abrogate ligand secretion"                                                                    
## [126] "Negative regulation of NOTCH4 signaling"                                                                 
## [127] "COPI-independent Golgi-to-ER retrograde traffic"                                                         
## [128] "Cross-presentation of soluble exogenous antigens (endosomes)"                                            
## [129] "ABC transporter disorders"                                                                               
## [130] "Regulation of activated PAK-2p34 by proteasome mediated degradation"                                     
## [131] "AUF1 (hnRNP D0) binds and destabilizes mRNA"                                                             
## [132] "Disorders of transmembrane transporters"                                                                 
## [133] "Ribosomal scanning and start codon recognition"                                                          
## [134] "Stabilization of p53"                                                                                    
## [135] "CDT1 association with the CDC6:ORC:origin complex"                                                       
## [136] "Intra-Golgi and retrograde Golgi-to-ER traffic"                                                          
## [137] "Smooth Muscle Contraction"                                                                               
## [138] "GLI3 is processed to GLI3R by the proteasome"                                                            
## [139] "Ubiquitin Mediated Degradation of Phosphorylated Cdc25A"                                                 
## [140] "p53-Independent DNA Damage Response"                                                                     
## [141] "p53-Independent G1/S DNA damage checkpoint"                                                              
## [142] "Beta-catenin independent WNT signaling"                                                                  
## [143] "Signaling by the B Cell Receptor (BCR)"                                                                  
## [144] "Regulation of Apoptosis"                                                                                 
## [145] "TCF dependent signaling in response to WNT"                                                              
## [146] "Cellular response to heat stress"                                                                        
## [147] "Nuclear Envelope Breakdown"                                                                              
## [148] "Regulation of HSF1-mediated heat shock response"                                                         
## [149] "CDK-mediated phosphorylation and removal of Cdc6"                                                        
## [150] "Clathrin-mediated endocytosis"                                                                           
## [151] "Interleukin-1 family signaling"                                                                          
## [152] "Cell-extracellular matrix interactions"                                                                  
## [153] "Amplification  of signal from unattached  kinetochores via a MAD2  inhibitory signal"                    
## [154] "Amplification of signal from the kinetochores"                                                           
## [155] "Interleukin-12 signaling"                                                                                
## [156] "Regulation of RAS by GAPs"                                                                               
## [157] "Activation of the mRNA upon binding of the cap-binding complex and eIFs, and subsequent binding to 43S"  
## [158] "The role of GTSE1 in G2/M progression after G2 checkpoint"                                               
## [159] "Transcriptional regulation by RUNX3"                                                                     
## [160] "COPI-mediated anterograde transport"                                                                     
## [161] "Translation initiation complex formation"                                                                
## [162] "Glycolysis"                                                                                              
## [163] "Mitotic G2-G2/M phases"                                                                                  
## [164] "Interleukin-12 family signaling"                                                                         
## [165] "Glucose metabolism"                                                                                      
## [166] "Striated Muscle Contraction"                                                                             
## [167] "Degradation of AXIN"                                                                                     
## [168] "tRNA processing in the nucleus"                                                                          
## [169] "Asymmetric localization of PCP proteins"                                                                 
## [170] "Mitotic Prophase"                                                                                        
## [171] "Regulation of RUNX3 expression and activity"                                                             
## [172] "UCH proteinases"                                                                                         
## [173] "ABC-family proteins mediated transport"                                                                  
## [174] "Ubiquitin-dependent degradation of Cyclin D"                                                             
## [175] "Nucleotide biosynthesis"                                                                                 
## [176] "Metabolism of non-coding RNA"                                                                            
## [177] "snRNP Assembly"                                                                                          
## [178] "Transcriptional regulation by RUNX2"                                                                     
## [179] "Fcgamma receptor (FCGR) dependent phagocytosis"                                                          
## [180] "G2/M Transition"                                                                                         
## [181] "Interactions of Vpr with host cellular proteins"                                                         
## [182] "Autodegradation of Cdh1 by Cdh1:APC/C"                                                                   
## [183] "Regulation of APC/C activators between G1/S and early anaphase"                                          
## [184] "Gene and protein expression by JAK-STAT signaling after Interleukin-12 stimulation"                      
## [185] "Folding of actin by CCT/TriC"                                                                            
## [186] "Mitotic Spindle Checkpoint"                                                                              
## [187] "Formation of the ternary complex, and subsequently, the 43S complex"                                     
## [188] "Regulation of actin dynamics for phagocytic cup formation"                                               
## [189] "Interferon alpha/beta signaling"                                                                         
## [190] "Cdc20:Phospho-APC/C mediated degradation of Cyclin A"                                                    
## [191] "Gene Silencing by RNA"                                                                                   
## [192] "Transport of the SLBP Dependant Mature mRNA"                                                             
## [193] "Nuclear Envelope (NE) Reassembly"                                                                        
## [194] "RHO GTPases Activate ROCKs"                                                                              
## [195] "Selective autophagy"                                                                                     
## [196] "Prefoldin mediated transfer of substrate  to CCT/TriC"                                                   
## [197] "Transport of the SLBP independent Mature mRNA"                                                           
## [198] "APC:Cdc20 mediated degradation of cell cycle proteins prior to satisfation of the cell cycle checkpoint" 
## [199] "Nuclear import of Rev protein"                                                                           
## [200] "Interactions of Rev with host cellular proteins"                                                         
## [201] "COPII-mediated vesicle transport"                                                                        
## [202] "Transport of Ribonucleoproteins into the Host Nucleus"                                                   
## [203] "APC/C:Cdc20 mediated degradation of Securin"                                                             
## [204] "Formation of tubulin folding intermediates by CCT/TriC"                                                  
## [205] "NS1 Mediated Effects on Host Pathways"                                                                   
## [206] "COPI-dependent Golgi-to-ER retrograde traffic"                                                           
## [207] "Late Phase of HIV Life Cycle"                                                                            
## [208] "Cargo recognition for clathrin-mediated endocytosis"                                                     
## [209] "Cooperation of Prefoldin and TriC/CCT  in actin and tubulin folding"                                     
## [210] "Transcriptional regulation by small RNAs"                                                                
## [211] "Antigen processing: Ubiquitination & Proteasome degradation"                                             
## [212] "Transport of Mature mRNAs Derived from Intronless Transcripts"                                           
## [213] "HIV Life Cycle"                                                                                          
## [214] "APC/C:Cdh1 mediated degradation of Cdc20 and other APC/C:Cdh1 targeted proteins in late mitosis/early G1"
## [215] "Regulation of PTEN stability and activity"                                                               
## [216] "Export of Viral Ribonucleoproteins from Nucleus"                                                         
## [217] "NEP/NS2 Interacts with the Cellular Export Machinery"                                                    
## [218] "G2/M Checkpoints"                                                                                        
## [219] "Vpr-mediated nuclear import of PICs"                                                                     
## [220] "Rev-mediated nuclear export of HIV RNA"                                                                  
## [221] "Potential therapeutics for SARS"                                                                         
## [222] "Syndecan interactions"                                                                                   
## [223] "Postmitotic nuclear pore complex (NPC) reformation"                                                      
## [224] "Resolution of Sister Chromatid Cohesion"                                                                 
## [225] "Transport of Mature mRNA Derived from an Intronless Transcript"                                          
## [226] "Hedgehog 'on' state"                                                                                     
## [227] "Nuclear Pore Complex (NPC) Disassembly"                                                                  
## [228] "Interconversion of nucleotide di- and triphosphates"                                                     
## [229] "Activation of APC/C and APC/C:Cdc20 mediated degradation of mitotic proteins"                            
## [230] "Processing of Capped Intron-Containing Pre-mRNA"                                                         
## [231] "Cargo concentration in the ER"                                                                           
## [232] "APC/C:Cdc20 mediated degradation of mitotic proteins"                                                    
## [233] "Initiation of Nuclear Envelope (NE) Reformation"                                                         
## [234] "Defective TPR may confer susceptibility towards thyroid papillary carcinoma (TPC)"                       
## [235] "Regulation of Glucokinase by Glucokinase Regulatory Protein"                                             
## [236] "Interleukin-20 family signaling"                                                                         
## [237] "SUMOylation of ubiquitinylation proteins"                                                                
## [238] "Hedgehog 'off' state"                                                                                    
## [239] "Beta-catenin phosphorylation cascade"                                                                    
## [240] "APC/C-mediated degradation of cell cycle proteins"                                                       
## [241] "Regulation of mitotic cell cycle"                                                                        
## [242] "IRE1alpha activates chaperones"                                                                          
## [243] "L1CAM interactions"                                                                                      
## [244] "RHOBTB2 GTPase cycle"                                                                                    
## [245] "RHOBTB GTPase Cycle"                                                                                     
## [246] "RAF activation"

Euler diagrams comparing FCS and ORA methods

par(cex.main=0.5)

par(mar=c(2,2,2,2))

l3 <- list("ORA up"=o_up,"ORA dn"=o_dn,"ORA comb"=o_com,
  "FCS up"=ms_up,"FCS dn"=ms_dn,"FCS comb"=mc_up)

plot(euler(l3),quantities = TRUE, edges = "gray", main="FCS compared to ORA")

Save data

dat <- list(  "FCS_up"=ms_up,
  "FCS_dn"=ms_dn,
  "FCS_com"=mc_up,
  "ORA_up"= o_up,
  "ORA_dn"=o_dn,
  "ORA_com"=o_com)

str(dat)
## List of 6
##  $ FCS_up : chr [1:308] "Metabolism of RNA" "Mitotic Metaphase and Anaphase" "Mitotic Anaphase" "M Phase" ...
##  $ FCS_dn : chr [1:44] "Eukaryotic Translation Elongation" "Peptide chain elongation" "Selenocysteine synthesis" "Response of EIF2AK4 (GCN2) to amino acid deficiency" ...
##  $ FCS_com: chr [1:402] "Immune System" "Disease" "Nervous system development" "Axon guidance" ...
##  $ ORA_up : chr [1:271] "Metabolism of RNA" "Mitotic Anaphase" "Mitotic Metaphase and Anaphase" "Host Interactions of HIV factors" ...
##  $ ORA_dn : chr [1:38] "Eukaryotic Translation Elongation" "Peptide chain elongation" "Response of EIF2AK4 (GCN2) to amino acid deficiency" "Selenocysteine synthesis" ...
##  $ ORA_com: chr [1:181] "Disease" "Innate Immune System" "Neutrophil degranulation" "Axon guidance" ...
saveRDS(dat,file = "ex4dat.rds")

Conclusion

For mitch, it would appear that performing direction informed (DI) analysis clearly yields more differentially regulated pathways (413) as compared to the direction agnostic (DA) method (55).

That being said, there were 18 pathways identified only in the DA method that appeared to be related to the physiology of the model. These gene sets are likely to contain a mix of genes affected by the stimulus in different ways - for example a mix of up and downregulated genes. Are these really real? Not sure.

This pattern was consistent with ORA, where 80 sets were identified with separate analysis and only 23 with the combined analysis.

When comparing ORA to FCS, we found that FCS identified many more sets than ORA. In fact all gene sets that were identified by ORA were also identified by FCS, except for 3 that were specific to the ORA up set.

Let’s look at those now.

myfcs <- c(ms_up, mc_up)

setdiff(o_up,myfcs)
## [1] "Signaling by FGFR3 in disease"             
## [2] "Signaling by FGFR3 point mutants in cancer"

Session information

sessionInfo()
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.3 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
##  [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
##  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] eulerr_6.1.1                mitch_1.4.1                
##  [3] clusterProfiler_4.0.5       DESeq2_1.32.0              
##  [5] SummarizedExperiment_1.22.0 Biobase_2.52.0             
##  [7] MatrixGenerics_1.4.3        matrixStats_0.61.0         
##  [9] GenomicRanges_1.44.0        GenomeInfoDb_1.28.4        
## [11] IRanges_2.26.0              S4Vectors_0.30.2           
## [13] BiocGenerics_0.38.0         getDEE2_1.2.0              
## [15] beeswarm_0.4.0              kableExtra_1.3.4           
## 
## loaded via a namespace (and not attached):
##   [1] shadowtext_0.1.1       fastmatch_1.1-3        systemfonts_1.0.3     
##   [4] plyr_1.8.6             igraph_1.2.11          lazyeval_0.2.2        
##   [7] polylabelr_0.2.0       splines_4.1.2          BiocParallel_1.26.2   
##  [10] ggplot2_3.3.5          digest_0.6.29          yulab.utils_0.0.4     
##  [13] htmltools_0.5.2        GOSemSim_2.18.1        viridis_0.6.2         
##  [16] GO.db_3.13.0           fansi_1.0.0            magrittr_2.0.1        
##  [19] memoise_2.0.1          Biostrings_2.60.2      annotate_1.70.0       
##  [22] graphlayouts_0.8.0     svglite_2.0.0          enrichplot_1.12.3     
##  [25] colorspace_2.0-2       blob_1.2.2             rvest_1.0.2           
##  [28] ggrepel_0.9.1          xfun_0.29              dplyr_1.0.7           
##  [31] crayon_1.4.2           RCurl_1.98-1.5         jsonlite_1.7.2        
##  [34] scatterpie_0.1.7       genefilter_1.74.1      survival_3.2-13       
##  [37] ape_5.6-1              glue_1.6.0             polyclip_1.10-0       
##  [40] gtable_0.3.0           zlibbioc_1.38.0        XVector_0.32.0        
##  [43] webshot_0.5.2          htm2txt_2.1.1          DelayedArray_0.18.0   
##  [46] scales_1.1.1           DOSE_3.18.3            DBI_1.1.2             
##  [49] GGally_2.1.2           Rcpp_1.0.7             viridisLite_0.4.0     
##  [52] xtable_1.8-4           gridGraphics_0.5-1     tidytree_0.3.7        
##  [55] bit_4.0.4              htmlwidgets_1.5.4      httr_1.4.2            
##  [58] fgsea_1.18.0           gplots_3.1.1           RColorBrewer_1.1-2    
##  [61] ellipsis_0.3.2         reshape_0.8.8          pkgconfig_2.0.3       
##  [64] XML_3.99-0.8           farver_2.1.0           sass_0.4.0            
##  [67] locfit_1.5-9.4         utf8_1.2.2             later_1.3.0           
##  [70] ggplotify_0.1.0        tidyselect_1.1.1       rlang_0.4.12          
##  [73] reshape2_1.4.4         AnnotationDbi_1.54.1   munsell_0.5.0         
##  [76] tools_4.1.2            cachem_1.0.6           downloader_0.4        
##  [79] generics_0.1.1         RSQLite_2.2.9          evaluate_0.14         
##  [82] stringr_1.4.0          fastmap_1.1.0          yaml_2.2.1            
##  [85] ggtree_3.0.4           knitr_1.37             bit64_4.0.5           
##  [88] tidygraph_1.2.0        caTools_1.18.2         purrr_0.3.4           
##  [91] KEGGREST_1.32.0        ggraph_2.0.5           nlme_3.1-153          
##  [94] mime_0.12              aplot_0.1.2            DO.db_2.9             
##  [97] xml2_1.3.3             compiler_4.1.2         rstudioapi_0.13       
## [100] png_0.1-7              treeio_1.16.2          tibble_3.1.6          
## [103] tweenr_1.0.2           geneplotter_1.70.0     bslib_0.3.1           
## [106] stringi_1.7.6          highr_0.9              lattice_0.20-45       
## [109] Matrix_1.4-0           vctrs_0.3.8            pillar_1.6.4          
## [112] lifecycle_1.0.1        jquerylib_0.1.4        data.table_1.14.2     
## [115] cowplot_1.1.1          bitops_1.0-7           httpuv_1.6.5          
## [118] patchwork_1.1.1        qvalue_2.24.0          R6_2.5.1              
## [121] promises_1.2.0.1       KernSmooth_2.23-20     echarts4r_0.4.3       
## [124] gridExtra_2.3          gtools_3.9.2           MASS_7.3-54           
## [127] assertthat_0.2.1       GenomeInfoDbData_1.2.6 grid_4.1.2            
## [130] ggfun_0.0.4            tidyr_1.1.4            rmarkdown_2.11        
## [133] ggforce_0.3.3          shiny_1.7.1