library (clusterProfiler)
library (AnnotationDbi)
library (org.Mm.eg.db)
and then I get my files set up and do the enrichGO step like so:
goctrl <- enrichGO (gene = ctrl, OrgDb = "org.Mm.eg.db", keyType = "SYMBOL", ont = "BP")
I can use the default barplot to create a bar plot showing the top 20 results, but I cannot figure out how to change the color on the p-value gradient. I believe the color argument is coming from clusterprofiler, but all I see are arguments to set the scale to another value (like q-value instead of p-value) but not change the colors.
ctrlplot <- plot(barplot (goctrl, showCategory = 20))
When I use ctrlplot + scale_color_gradientn(colors = c("green", "red"))
, it tells me "Scale for colour is already present. Adding another scale for colour, which will replace the existing scale." which is indeed fine by me but, alas, it does not let me do it.
color
is the outline for the bars, andfill
is the actual bar color.