gravatar for ashish

26 minutes ago by

This is a barplot and can be made easily in R using ggplot. First remove all the unnecessary columns in the DAVID output file. Just keep the GO terms and their associated pvalue. Assuming you can get the data in a three column format where first column is GO term, second is module name and third is pvalues, you can try this:

    head(data)

                                             term module      pvalue
    1                  defense response to fungus   blue 0.000207773
    2                                MAPK cascade   blue 0.000545800
    3                 chondrocyte differentiation   blue 0.001003693
    4              antibacterial humoral response   blue 0.001419371
    5          killing of cells of other organism   blue 0.002021502
    6 defense response to Gram-negative bacterium   blue 0.002072591

library(ggplot2)

ggplot(data, aes(x = term,
                 y = -log10(pvalue),
                 fill = module)) + geom_bar(stat = "identity",  position = "dodge") + coord_flip()

If you want to make your plot exactly like the one you showed you will have to add theme() in the ggplot command and specify parameters inside it. See this for an intro on making custom theme.



Source link