Ggplot for Gene ontology data
2
2
Entering edit mode
8.0 years ago
Kritika ▴ 270

Hello all I need one help in plot ggplot Suppose I have file containing 1 column the terms like biological processes,molecular function, cellular components 2 column has count of gene having particular function 3 column David ID GOxxxxxx 4 column function of set of gene for eg RNase activity etc I want to plot ggplot having X axis David I'd Y axis count But my geom_bar colour should be different for molecular function, cellular components, biological processes How should I proceed Please help

ggplot geneontology RNA-Seq • 9.6k views
ADD COMMENT
0
Entering edit mode
ggplot(d, aes(id, count, fill=ontology)) + geom_col()
ADD REPLY
0
Entering edit mode

I want to plot bar using ggplot with different color for biological processes molecular function and cellular process

ADD REPLY
1
Entering edit mode

I guess you know nothing about ggplot2.

a bar plot (geom_col(), which is a short cut of geom_bar(stat='identity')) that map id to x and count to y and use ontology to color the bars.

go to read some docs before posting a question with no idea of what you (and someone else) are talking about.

ADD REPLY
0
Entering edit mode

Ok thanks for your suggestions and answer

ADD REPLY
2
Entering edit mode
8.0 years ago
Guangchuang Yu ★ 2.6k
require(clusterProfiler)
require(ggplot2)

data(geneList)
de = names(geneList)[1:100]
x=enrichGO(de, OrgDb='org.Hs.eg.db', ont='ALL')

ggplot(x, aes(ID, Count, fill=ONTOLOGY), split='ONTOLOGY') + geom_col()  + 
    theme(axis.text.x=element_text(angle=-40, hjust=0)) + facet_grid(.~ONTOLOGY, scale="free_x")

ADD COMMENT
0
Entering edit mode
7.9 years ago
raya.girish ▴ 40

Hi guangchuang yu Thanks for this !! I was searching for this few month ago same kind of plot but ended up with overlaping value in x-axis It would be appreciable if you help me so that i can apply the same for my future work Thanks

ADD COMMENT
0
Entering edit mode

Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized.

ADD REPLY
0
Entering edit mode

you can use clusterProfiler which use y axis for GO/pathway description to prevent overlapping text.

ADD REPLY

Login before adding your answer.

Traffic: 1631 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6