ycl6 / topGO-feat

Enrichment Analysis for Gene Ontology. This version has "enrichment_barplot" function added to the package
GNU Lesser General Public License v3.0
3 stars 4 forks source link

could not find function "enrichment_barplot" #4

Closed marce-sarrias closed 11 months ago

marce-sarrias commented 11 months ago

Hello,

I'm trying to make a bar plot of the enriched go terms as shown in https://ycl6.github.io/GO-Enrichment-Analysis-Demo/2_topGO.html but it's not working.

I have tried installing the github version which should have the enrichment_barplot function but it's still not working. Any advice?

devtools::install_github("ycl6/topGO-feat", ref = "v2.41.0-barplot", force = TRUE) library(topGO) png(paste0(outTitle, "_up.png"), width = 8, height = 6, units = "in", res = 300) enrichment_barplot(up_GOdata, up_Res, showTerms = 20, numChar = 50, orderBy = "Scores", title = paste0("GO-", ontology," ORA of up-regulated genes")) invisible(dev.off())

Error in enrichment_barplot(up_GOdata, up_Res, showTerms = 20, numChar = 50, : could not find function "enrichment_barplot"

Thank you,

Marcela

ycl6 commented 11 months ago

Hi @marce-sarrias

I think you aren't installing the correct version. Please try the below command (without the ref param):

devtools::install_github("ycl6/topGO-feat")

And the package should have the enrichment_barplot function. Please let me know if that works for you.

library(topGO)

?enrichment_barplot
enrichment_barplot            package:topGO            R Documentation

Create a barplot using ggplot2 to show enrichment results

Description:

     This function takes a ‘topGOdata’ object and a ‘topGOresult’
     object to display the enrichment statistics of top ‘N’ GO terms.
     It wraps ‘ggplot2’ plotting, and returns a ‘ggplot2’ graphic
     object.

Usage:

     enrichment_barplot(object, result, showTerms = 10, numChar = 40, 
                        orderBy = "Scores", y = "Count", 
                        xlab = NULL, ylab = NULL, title = NULL)
marce-sarrias commented 11 months ago

Got It, thank you! I love your tutorial!!

Marcela

ycl6 commented 11 months ago

Hi @marce-sarrias Thanks, I appreciate your feedback. I'll close this issue.

goodgodric28 commented 1 month ago

Hello. I followed the same procedure described above, but I'm now getting the same error. Any idea why this might be?

> enrichment_barplot(GOdataBP.dc, resultFisherBP.dc, showTerms = 10, numChar = 40, 
+                    orderBy = "Scores", y = "Count", 
+                    xlab = NULL, ylab = NULL, title = NULL)
Error in enrichment_barplot(GOdataBP.dc, resultFisherBP.dc, showTerms = 10,  : 
  could not find function "enrichment_barplot"

I also tried to call from topGO specifically:

> topGO::enrichment_barplot(GOdataBP.dc, resultFisherBP.dc, showTerms = 10, numChar = 40, 
+                    orderBy = "Scores", y = "Count", 
+                    xlab = NULL, ylab = NULL, title = NULL)
Error: 'enrichment_barplot' is not an exported object from 'namespace:topGO'