YuLab-SMU / enrichplot

Visualization of Functional Enrichment Result
https://yulab-smu.top/biomedical-knowledge-mining-book/
226 stars 64 forks source link

goplot not working with my data but works with tutorial #146

Open abbaslab opened 2 years ago

abbaslab commented 2 years ago

Using the tutorial on https://bioc.ism.ac.jp/packages/3.7/bioc/vignettes/enrichplot/inst/doc/enrichplot.html , I am able to generate object ego and generate a figure from goplot

I then convert my gene names to ENTREZID and run enrichGO as in tutorial. the object ego result pasted below without issues

When I try then to generate goplot(ego), Rstudio just lags and does nothing. When I click a button I get the error: Error in AnnotationDbi::mget(id, GOANCESTOR) : second argument must be an environment

Of note, this is not something I get when I run the ego from the tutorial which is really unusual. Any thoughts?

#

over-representation test

#

...@organism Homo sapiens

...@ontology GOALL

...@keytype ENTREZID

...@gene chr [1:47] "649159" "587" "5450" "284111" "100505841" "200420" "128338" NA "10682" "4607" "1120" "4802" "51735" "163486" "80224" ...

...pvalues adjusted by 'none' with cutoff <0.02

...9 enriched terms found

'data.frame': 9 obs. of 10 variables: $ ONTOLOGY : chr "MF" "MF" "MF" "MF" ... $ ID : chr "GO:0004857" "GO:0005543" "GO:0051539" "GO:0044389" ... $ Description: chr "enzyme inhibitor activity" "phospholipid binding" "4 iron, 4 sulfur cluster binding" "ubiquitin-like protein ligase binding" ... $ GeneRatio : chr "5/40" "5/40" "2/40" "4/40" ... $ BgRatio : chr "383/18352" "454/18352" "42/18352" "316/18352" ... $ pvalue : num 0.00139 0.00292 0.00377 0.00484 0.00617 ... $ p.adjust : num 0.00139 0.00292 0.00377 0.00484 0.00617 ... $ qvalue : num 0.164 0.164 0.164 0.164 0.164 ... $ geneID : chr "RPL5/GMFG/A2ML1/ANXA9/PPP1R26" "RAPGEF6/DENND1B/SNX14/ANXA9/PCLO" "NUBPL/NDUFS2" "RPL5/SUMO4/DIO2/NDUFS2" ... $ Count : int 5 5 2 4 2 3 2 2 3

...Citation

Guangchuang Yu, Li-Gen Wang, Yanyan Han and Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology 2012, 16(5):284-287

jdreyf commented 1 year ago

I ran into a similar issue and got the error message "Error in AnnotationDbi::mget(id, GOANCESTOR) : use of NULL environment is defunct" and noted that you are probably using ont = "ALL" and so am I, whereas the examples are only testing for one ontology, e.g. MF. Also, each ontology would make its own DAG, whereas this function plots one DAG. So I reran enrichGO using one ontology (e.g. ont = "BP") and then goplot() worked. This function should probably add an error message.

darkrams98 commented 5 months ago

don't use ont = "ALL" for enrichGO input . i think goplot just works with : ont = "BP" ont = "CC" ont = "MF" it works for me.