Search
Question: How to export enrichGO results for future visualization with barplot, dotplot, emapplot...
1
gravatar for MAP
10 weeks ago by
MAP0
MAP0 wrote:

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

ADD COMMENTlink modified 10 weeks ago • written 10 weeks ago by MAP0
3
gravatar for James W. MacDonald
10 weeks ago by
United States
James W. MacDonald48k wrote:
save(cluster_summary, file = "whatevs.Rdata")
## time passes...
load("whatevs.Rdata")
ADD COMMENTlink written 10 weeks ago by James W. MacDonald48k

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

ADD REPLYlink written 10 weeks ago by MAP0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 456 users visited in the last hour