How to export enrichGO results for future visualization with barplot, dotplot, emapplot...
1
1
Entering edit mode
MAP ▴ 10
@map-16849
Last seen 6.2 years ago

Hi,

I am using a super useful package called clusterProfiler (v3.8.1) for some GO enrichment analysis. I already read the vignettes and they were super useful to better understand how it works.

For the GO enrichment this is what I am running:

> GO_BP_test <- enrichGO(gene = names_all_down_uniprot, OrgDb = "org.Mm.eg.db" , keyType = "UNIPROT", ont = "BP",pvalueCutoff = 0.05, pAdjustMethod = "fdr", universe = background_uniprot, qvalueCutoff = 0.25, minGSSize = 10, maxGSSize = 500, readable = FALSE, pool = FALSE)

The results looks as expected and I can visualize them using any of the functions included in the package (barplot, dotplot, emapplot...) 

The problem is when I try to save the results from enrichGO() in order to use them for visualization with the same functions.

I save the results as a data.frame in a .cvs file.

> cluster_summary <- data.frame(GO_BP_test )
> write.csv(cluster_summary , file = "GO_BP_test.csv", row.names=FALSE)

This is what I do to load the results and plot them using barplot():

> test_analysis <- read.csv(file = "GO_BP_test.csv", header=TRUE)
> barplot(test_analysis, showCategory=8)

Then, this error appears:

"Error in barplot.default(test_analysis, showCategory = 8) :  'height' must be a vector or a matrix"

Does anyone know how to save the results from enrichGO in a way that would be possible to use for future visualizations using the functions included in the package?

Thanks in advance for any help,

Miguel

clusterprofiler enrichGO barplot dotplot • 7.8k views
ADD COMMENT
3
Entering edit mode
@james-w-macdonald-5106
Last seen 42 minutes ago
United States
save(cluster_summary, file = "whatevs.Rdata")
## time passes...
load("whatevs.Rdata")
ADD COMMENT
0
Entering edit mode

Nice!!! Simple and works!!! Thanks a bunch!!!

ADD REPLY

Login before adding your answer.

Traffic: 828 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6