GO KEGG富集分析绘图


柱状图

setwd("C:/Users/acer/Desktop/数据处理/富集分析-lung/")
  • 读取数据
Data <- read.csv("富集分析-lung/lung-enrichment.csv",header=TRUE)
  • 转换term为因子
GO_term_order=factor(as.integer(rownames(Data)),labels=Data$term)
  • 设置柱子颜色
COLS <- c("#66C3A5", "#8DA1CB", "#FD8D62")
  • 绘图(柱状图)
ggplot(data=Data,aes(x=GO_term_order,y=pValue, fill=Category)) + geom_bar(stat="identity", width=0.8)+ xlab("GO terms") + ylab("-log(p-value)") + theme_bw() + labs(title = "The Most Enriched GO Terms") + scale_fill_manual(values = COLS) + coord_flip() + theme(axis.text.x=element_text(face = "bold", color="gray50",angle = 70,vjust = 1, hjust = 1 ))
  • 绘图(气泡图)
 ggplot(Data, aes(x=cc, y=term,  size=Count, color=-1*log10(pValue))) + geom_point()  + scale_colour_gradient(low="green",high="red") + labs(color=expression(-log[10](pValue)),size="Gene number", x="p-Value",y="Pathway name",title="Pathway enrichment")


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM