I am trying to perform GO analysis with reacotmePA package and I wanted to see the GO terms for both up (log2FC>1) and down regulated genes (log2Fc<= -1). I am able to get results for the downregulated genes but not for the upregulated genes (FC >2) and I don't understand why since in my dataset I have upregulated genes and when I perform enrich pathway analysis I get a list of GO terms. where is the error? I have also removed all rows where there was NA.
# A tibble: 5 x 4 ENSEMBL ENTREZID log2FC FC <chr> <dbl> <dbl> <dbl> 1 ENSG00000265991 100616231 11.5 2852. 2 ENSG00000206979 26787 11.1 2226. 3 ENSG00000229686 26793 10.7 1635. 4 ENSG00000265706 109617012 9.65 801. 5 ENSG00000202515 56662 9.51 731.
#load packages library(org.Hs.eg.db) #human genome library(DOSE) library(ReactomePA) # to perform enrichment analysis library(enrichplot) # to plot the results library(UpSetR) #tidy the datasets genes <- f[] #numeric vector #selected fc names(genes) <- f[] #named vector geneLIST <- sort(genes, decreasing = T) #decreasing order head(geneLIST) de <- names(geneLIST)[abs(geneLIST) > 2] x <- enrichPathway(gene=de,pvalueCutoff=0.05, readable=T) head(as.data.frame(x)) result <- x@result barplot(x, showCategory=10, title = " ") #plot
and I got the results but not the graph. in fact when I do
head(as.data.frame(x)) I got this results but I have the excel file with the GO terms.
 ID Description GeneRatio BgRatio  pvalue p.adjust qvalue geneID  Count <0 rows> (or 0-length row.names)
But this is the first row of the"result" file that I have exported for the upregulated genes:
ID Description GeneRatio BgRatio pvalue p.adjust qvalue geneID Count R-HSA-211859 R-HSA-211859 Biological oxidations 13/234 222/10654 0.001229205 0.626327002 0.626327002 MGST3/CYP26A1/CYP4F3/EPHX1/FMO1/ADH6/SLC26A2/SULT1A1/MGST1/MGST2/MARC1/ALDH3A1/ACSM2A 13
so I have GO terms
thank you very much for the help!