I'm plotting the GO(Gene Ontology) analysis with ggplot2. There are 15 groups, each of them have 3 items. what I want is look like this:
But what I got from ggplot is like this:
as you can see, the groups with same item were combined together, they are too tight to be recognized. but I hope they can seperate, each of them are independent.
is there anyway I can realize that? Thx!
here is the data:
dput(t3)
structure(list(X = 1:15, GO = structure(c(4L, 1L, 9L, 4L, 7L,
13L, 4L, 8L, 11L, 3L, 12L, 2L, 5L, 10L, 6L), .Label = c("GO:0002433",
"GO:0006644", "GO:0006650", "GO:0007169", "GO:0007266", "GO:0008360",
"GO:0033674", "GO:0038093", "GO:0038096", "GO:0051056", "GO:0051347",
"GO:0090407", "GO:1901652"), class = "factor"), Category = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "GO Biological Processes", class = "factor"),
Description = structure(c(13L, 4L, 2L, 13L, 7L, 11L, 13L,
1L, 8L, 3L, 5L, 6L, 12L, 10L, 9L), .Label = c("Fc receptor signaling pathway",
"Fc-gamma receptor signaling pathway involved in phagocytosis",
"glycerophospholipid metabolic process", "immune response-regulating cell surface receptor signaling pathway involved in phagocytosis",
"organophosphate biosynthetic process", "phospholipid metabolic process",
"positive regulation of kinase activity", "positive regulation of transferase activity",
"regulation of cell shape", "regulation of small GTPase mediated signal transduction",
"response to peptide", "Rho protein signal transduction",
"transmembrane receptor protein tyrosine kinase signaling pathway"
), class = "factor"), LogP = c(-40.887821181404, -38.4419736211887,
-38.4419736211887, -43.8825656440477, -40.9658168441261,
-40.928738226587, -52.6082917563572, -50.1381337600203, -46.3514494215002,
-71.5496270612963, -67.9829155303795, -67.4635662792925,
-40.1994934987666, -36.6884206140971, -33.5740640802768),
Label = structure(c(1L, 1L, 1L, 2L, 2L, 3L, 2L, 5L, 3L, 3L,
4L, 5L, 5L, 4L, 4L), .Label = c("A", "B", "C", "D", "E"), class = "factor"),
Pvalue = c(1.2947288298802e-41, 3.61431815145327e-39, 3.61431815145327e-39,
1.3104919452196e-44, 1.08189012276903e-41, 1.17831599603069e-41,
2.46438322354707e-53, 7.27555687363364e-51, 4.45195307925231e-47,
2.82080418123444e-72, 1.04012244840109e-68, 3.43901223333678e-68,
6.31693635444945e-41, 2.04917659044434e-37, 2.66646519778058e-34
)), class = "data.frame", row.names = c(NA, -15L))
and here is my code:
ggplot(top3, aes(x = reorder(description, -log10pvalue), y = log10pvalue, fill = Label)) +
geom_bar(stat = "identity", position=position_dodge) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
labs(x = "Description", y = "Log Pvalue") +
coord_flip()