Question: DAVID functional Analysis and its visualization of GO terms using Bar plot
1
gravatar for lawarde.ankita1
21 months ago by
lawarde.ankita150 wrote:

Hello, I have used DAVID tool for the Functional annotation of my data (microarray data) and now i wan to visualize the results of GO term in the form of Bar plots (i have seen the such results from the research paper)reference image from the paper the link contains the image of box plot in the research paper. My question is, 1. Which tools can be used to create such plots or any online tool I have used Revigo tool but it doesn,t give such kind of plots. Any suggestions would be helpful.

Thank you.

visualization david go term • 2.2k views
ADD COMMENTlink modified 21 months ago by Kevin Blighe51k • written 21 months ago by lawarde.ankita150
1
gravatar for Kevin Blighe
21 months ago by
Kevin Blighe51k
Kevin Blighe51k wrote:

Hi, it is just a simple barchart or bar-plot. First, create a data-frame that has your GO enrichment terms as rows and count values in a single column, like this:

     input
GO1                    128
GO2                      1
GO3                     70
GO4                      6
GO5                     17
GO6                     14
GO7                     18
GO8                      4
GO9                     13
GO10                     0
GO11                     0
GO12                     5
GO13                    16
GO14                     5
GO15                     2
GO16                     0
GO17                     0
GO18                    20
GO19                     6
GO20                     0
GO21                     0
GO22                     0
GO23                     2
GO24                     0
GO25                     6
GO26                     1
GO27                     5
GO28                     1
GO29                     0
GO30                     0
GO31                     0
GO32                     0
GO33                     1

Then, generate separate barcharts with lattice and piece them together on the same panel using grid / gridExtra:

require(lattice)
require(RColorBrewer)
require(rasterVis)
require(gridExtra)
require(grid)

A <- barchart(data.matrix(input[1:15,]), col="black", xlab="Total count", ylab="", pretty=TRUE, scales=list(x=list(cex=1.0, col="black", fontface="bold"), y=list(cex=0.8, labels=rownames(input), col="black", fontface="bold"), xlab=list(cex=2.0), ylab=list(cex=2.0), tck=c(1,0)), aspect="fill")

B <- barchart(data.matrix(input2[1:15,]), col="black", xlab="Total count", ylab="", pretty=TRUE, scales=list(x=list(cex=1.0, col="black", fontface="bold"), y=list(cex=0.8, labels=rownames(input2), col="black", fontface="bold"), xlab=list(cex=2.0), ylab=list(cex=2.0), tck=c(1,0)), aspect="fill")

layout <- cbind(c(1,2))

grid.arrange(layout_matrix=layout, arrangeGrob(A, top=textGrob("A", x=unit(0.05,"npc"), y=unit(0.9,"npc"), just=c("left","top"), gp=gpar(fontsize=32))), arrangeGrob(B, top=textGrob("B", x=unit(0.05,"npc"), y=unit(0.9,"npc"), just=c("left","top"), gp=gpar(fontsize=32))), ncol=1)

tem

------------------------------------------------------------

For side to side, alter the layout and use ncol=2 to grid.arrange

A <- barchart(data.matrix(input), col="black", xlab="Total count", ylab="", pretty=TRUE, scales=list(x=list(cex=1.0, col="black", fontface="bold"), y=list(cex=0.8, labels=rownames(input), col="black", fontface="bold"), xlab=list(cex=2.0), ylab=list(cex=2.0), tck=c(1,0)), aspect="fill")

B <- barchart(data.matrix(input2), col="black", xlab="Total count", ylab="", pretty=TRUE, scales=list(x=list(cex=1.0, col="black", fontface="bold"), y=list(cex=0.8, labels=rownames(input2), col="black", fontface="bold"), xlab=list(cex=2.0), ylab=list(cex=2.0), tck=c(1,0)), aspect="fill")

layout <- cbind(c(1),c(2))
grid.arrange(layout_matrix=layout, arrangeGrob(A, top=textGrob("A", x=unit(0.05,"npc"), y=unit(0.9,"npc"), just=c("left","top"), gp=gpar(fontsize=32))), arrangeGrob(B, top=textGrob("B", x=unit(0.05,"npc"), y=unit(0.9,"npc"), just=c("left","top"), gp=gpar(fontsize=32))), ncol=2)

tempo

ADD COMMENTlink written 21 months ago by Kevin Blighe51k

Hello Kevin Blighe,

Thank you sir for the solution. and I'm so sorry that i didn't check your reply. Your answer is very helpful thank so much.

ADD REPLYlink written 21 months ago by lawarde.ankita150

No problem my dear Sir / Madam

ADD REPLYlink written 21 months ago by Kevin Blighe51k

Hello,

May I kindly ask you to let me know how can I also add to the above bar chart a vertical red line which shows a threshold (such as for example 0.05 p-value as a threshold of significance). I need to create a bar chart like the attached figure.

I assume that the red line, in the attached image, shows -log10(0.05) threshold which is equal to 1.30103. Am I right? I would highly appreciate if you can let me know how to add this threshold red line to my bar chart. Many thanks.

Bar chart with a red line as threshold

ADD REPLYlink written 4 days ago by F. Golestan20

Hey, I presume that you can add a red line via abline(v = ..., col = 'red2', lwd = 2), i.e., after you have already called barplot()

ADD REPLYlink written 4 days ago by Kevin Blighe51k
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: 1304 users visited in the last hour