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,