有一些已經(jīng)做完了GO enrichment, 得到了結(jié)果愿棋,才發(fā)現(xiàn)很多軟件都是直接給gene list做富集唧领。如果已經(jīng)完成分析处嫌,照樣可以畫圖而涉,代碼如下:
library(ggplot2)
data<-read.table("CC.txt",header=T,sep="\t")
p6 <- ggplot(data, aes(x = Log2_Fold_enrichment,y = reorder(Annotation ,Log2_Fold_enrichment),size = Protein_number,fill = P_value))+geom_point(shape = 21)+theme_bw() +theme()
p6+ scale_fill_continuous(low = '#d90424', high = '#374a89')+scale_x_continuous(
labels = scales::number_format(accuracy = 0.1))+ theme(axis.title.y = element_blank())+xlab("Log2 Fold enrichment")+scale_x_continuous(breaks = seq(0, 3, by = 0.5))
原始文件示例:
Annotation Log2_Fold_enrichment P_value Protein_number
microtubule 1.027014841 0.005642234 23
membrane 0.374104338 0.025142178 111
nucleus 0.424999773 7.72E-05 429
apoplast 0.735305636 0.02136697 33
Golgi apparatus 0.770239426 0.000202145 66
trans-Golgi network 1.387382333 1.81E-05 33
endosome 1.53697692 1.81E-05 30
endoplasmic reticulum 1.556968395 2.91E-05 96
endoplasmic reticulum membrane 1.596990241 2.93E-05 68
cytoplasm 1.609094255 6.52E-05 502
chloroplast 1.671835722 5.38E-05 220
plastid 1.760840728 2.38E-05 36
vacuolar membrane 1.761961268 2.91E-05 46
ribonucleoprotein complex 1.983233149 1.81E-05 36
ribosome 2.067353771 2.09E-05 64
mitochondrion 2.083889363 3.77E-05 230
nucleosome 2.144514056 1.81E-05 26
peroxisome 2.242151447 1.81E-05 35
cytosol 2.342176087 4.17E-05 454
mitochondrial matrix 2.491380053 1.81E-05 32
cytosolic large ribosomal subunit 2.858905014 1.81E-05 75