Question: Ggplot for Gene ontology data
2
gravatar for Kritika
2.9 years ago by
Kritika260
India
Kritika260 wrote:

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

rna-seq ggplot geneontology • 2.5k views
ADD COMMENTlink modified 2.9 years ago by raya.girish20 • written 2.9 years ago by Kritika260
ggplot(d, aes(id, count, fill=ontology)) + geom_col()
ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by Guangchuang Yu2.2k

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

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by Kritika260
1

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 REPLYlink modified 2.9 years ago • written 2.9 years ago by Guangchuang Yu2.2k

Ok thanks for your suggestions and answer

ADD REPLYlink written 2.9 years ago by Kritika260
2
gravatar for Guangchuang Yu
2.9 years ago by
Guangchuang Yu2.2k
China/Guangzhou/Southern Medical University
Guangchuang Yu2.2k wrote:
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 COMMENTlink written 2.9 years ago by Guangchuang Yu2.2k
0
gravatar for raya.girish
2.9 years ago by
raya.girish20
raya.girish20 wrote:

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 COMMENTlink written 2.9 years ago by raya.girish20

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

ADD REPLYlink written 2.9 years ago by genomax73k

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

ADD REPLYlink written 2.9 years ago by Guangchuang Yu2.2k
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: 2563 users visited in the last hour