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