Question: Plot biological process of DAVID analysis in a barplot
0
gravatar for Silvia Gonzalez
5 months ago by
Spain
Silvia Gonzalez10 wrote:

Hi,

I have done a functional analysis with DAVID about the genes corresponding each module of my WGCNA.

My objective now is to plot the biologicals process of each module using a barplot, but I want all biologicals process of each module in an unique graph using diferent colors to distinguish each module with their biologicals process. I want something like in the image:

enrichment-analysis

If someone can say or show me any tutorial, I will appreciate it

Thanks,

Silvia

plot david biological process • 303 views
ADD COMMENTlink modified 5 months ago by ashish540 • written 5 months ago by Silvia Gonzalez10
1
gravatar for ashish
5 months ago by
ashish540
ashish540 wrote:

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.

ADD COMMENTlink written 5 months ago by ashish540

I got it!

Thank you very much for your help!

ADD REPLYlink written 5 months ago by Silvia Gonzalez10
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.3.0
Traffic: 780 users visited in the last hour