Hi,
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.
my dataset:
# 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.
My code:
#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[[4]] #numeric vector #selected fc
names(genes) <- f[[2]] #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. when I do head(as.data.frame(x))
I got this (that would explain why I do not have a graph):
[1] ID Description GeneRatio BgRatio
[5] pvalue p.adjust qvalue geneID
[9] Count
<0 rows> (or 0-length row.names)
BUT if I export the results in excel file I have a list of GO terms:
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
Why? thank you for your help!
the sessionInfo()
is
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] parallel stats4 stats graphics
[5] grDevices utils datasets methods
[9] base
other attached packages:
[1] UpSetR_1.4.0 enrichplot_1.8.1
[3] ReactomePA_1.32.0 DOSE_3.14.0
[5] org.Hs.eg.db_3.11.4 AnnotationDbi_1.50.0
[7] IRanges_2.22.2 S4Vectors_0.26.1
[9] Biobase_2.48.0 BiocGenerics_0.34.0
[11] readxl_1.3.1
loaded via a namespace (and not attached):
[1] bit64_0.9-7 RColorBrewer_1.1-2
[3] progress_1.2.2 httr_1.4.1
[5] backports_1.1.7 tools_4.0.0
[7] R6_2.4.1 DBI_1.1.0
[9] colorspace_1.4-1 graphite_1.34.0
[11] tidyselect_1.1.0 gridExtra_2.3
[13] prettyunits_1.1.1 bit_1.1-15.2
[15] compiler_4.0.0 graph_1.66.0
[17] scatterpie_0.1.4 xml2_1.3.2
[19] triebeard_0.3.0 checkmate_2.0.0
[21] scales_1.1.1 ggridges_0.5.2
[23] rappdirs_0.3.1 stringr_1.4.0
[25] digest_0.6.25 pkgconfig_2.0.3
[27] rlang_0.4.6 rstudioapi_0.11
[29] RSQLite_2.2.0 gridGraphics_0.5-0
[31] farver_2.0.3 generics_0.0.2
[33] jsonlite_1.6.1 BiocParallel_1.22.0
[35] GOSemSim_2.14.0 dplyr_1.0.0
[37] magrittr_1.5 ggplotify_0.0.5
[39] GO.db_3.11.4 Matrix_1.2-18
[41] Rcpp_1.0.4.6 munsell_0.5.0
[43] viridis_0.5.1 lifecycle_0.2.0
[45] stringi_1.4.6 ggraph_2.0.3
[47] MASS_7.3-51.5 plyr_1.8.6
[49] qvalue_2.20.0 grid_4.0.0
[51] blob_1.2.1 ggrepel_0.8.2
[53] DO.db_2.9 crayon_1.3.4
[55] lattice_0.20-41 graphlayouts_0.7.0
[57] cowplot_1.0.0 splines_4.0.0
[59] hms_0.5.3 pillar_1.4.4
[61] fgsea_1.14.0 igraph_1.2.5
[63] reshape2_1.4.4 fastmatch_1.1-0
[65] glue_1.4.1 data.table_1.12.8
[67] BiocManager_1.30.10 vctrs_0.3.1
[69] tweenr_1.0.1 urltools_1.7.3
[71] cellranger_1.1.0 gtable_0.3.0
[73] purrr_0.3.4 polyclip_1.10-0
[75] tidyr_1.1.0 ggplot2_3.3.1
[77] xfun_0.14 ggforce_0.3.1
[79] europepmc_0.4 tidygraph_1.2.0
[81] reactome.db_1.70.0 viridisLite_0.3.0
[83] tibble_3.0.1 rvcheck_0.1.8
[85] tinytex_0.23 memoise_1.1.0
[87] ellipsis_0.3.1
Camilla
Cross-posted: https://www.biostars.org/p/444911/