Goplot.jpg
GOplot | 更美觀的富集分析可視化
數(shù)據(jù)準備
# 下載
install.packages('GOplot')
library(GOplot)
# 載入示例數(shù)據(jù)
data(EC)
# 富集分析結(jié)果
head(EC$david)
# 差異分析結(jié)果
head(EC$genelist)
# 生成畫圖數(shù)據(jù)
circ <- circle_dat(EC$david, EC$genelist)
> head(circ)
category ID term count genes logFC adj_pval zscore
1 BP GO:0007507 heart development 54 DLC1 -0.9707875 2.17e-06 -0.8164966
2 BP GO:0007507 heart development 54 NRP2 -1.5153173 2.17e-06 -0.8164966
3 BP GO:0007507 heart development 54 NRP1 -1.1412315 2.17e-06 -0.8164966
4 BP GO:0007507 heart development 54 EDN1 1.3813006 2.17e-06 -0.8164966
5 BP GO:0007507 heart development 54 PDLIM3 -0.8876939 2.17e-06 -0.8164966
6 BP GO:0007507 heart development 54 GJA1 -0.8179480 2.17e-06 -0.8164966
GOplot
使用了zscore
概念,但其并不是指Z-score
標準化,而是指每個GO term
下上調(diào)(logFC>0)基因數(shù)和下調(diào)基因數(shù)的差與注釋到GO term
基因數(shù)平方根的商。用于表示每個GO Term
的上下調(diào)情況,公式:
image-20220118111114261
可視化
條圖
GOBar(subset(circ, category == 'BP'))
zscore用于表示每個Term的上下調(diào)情況
# 以terms的分類進行分面
GOBar(circ, display = 'multiple')
image-20220118205118305
# 以terms的分類進行分面 切改變色階顏色
GOBar(circ, display = 'multiple', title = 'Z-score coloured barplot', zsc.col = c('yellow', 'black', 'cyan'))
image-20220118205140222
氣泡圖
z-score
作為橫坐標,校正p值的負對數(shù)作為縱坐標(y軸越高越顯著)。所顯示圓圈的面積與富集到term
的基因數(shù)量成比例,顏色對應于類別。
# 生成y大于3的term的標簽
GOBubble(circ, labels = 3)
image-20220118210132333
# 添加標題、分面、修改顏色
GOBubble(circ, title = 'Bubble plot', colour = c('orange', 'darkred', 'gold'), display = 'multiple', labels = 3)
image-20220118204819489
# 根據(jù)分類添加背景色
GOBubble(circ, title = 'Bubble plot with background colour', display = 'multiple', bg.col = T, labels = 3)
image-20220118204839151
reduce_overlap
減少冗余terms
數(shù)目。該功能刪除所有基因重疊大于或等于設(shè)定閾值的terms
。保留每個組的一個terms
作為代表,而不考慮GO層次結(jié)構(gòu)。
# 刪除所有基因重疊大于或等于 0.75的 terms
reduced_circ <- reduce_overlap(circ, overlap = 0.75)
GOBubble(reduced_circ, labels = 2.8)
image-20220118210058117
圈圖
GOCircle(circ)
image-20220118210406873
# 可視化感興趣的 terms
IDs <- c('GO:0007507', 'GO:0001568', 'GO:0001944', 'GO:0048729', 'GO:0048514', 'GO:0005886', 'GO:0008092', 'GO:0008047')
GOCircle(circ, nsub = IDs)
image-20220118210619044
# 可視化前10個terms
GOCircle(circ, nsub = 10)
image-20220118210717621
弦圖
顯示了所選基因和術(shù)語列表之間的關(guān)系,以及這些基因的logFC。
數(shù)據(jù)準備
head(EC$genes)
## ID logFC
## 1 PTK2 -0.6527904
## 2 GNA13 0.3711599
## 3 LEPR 2.6539788
## 4 APOE 0.8698346
## 5 CXCR4 -2.5647537
## 6 RECK 3.6926860
EC$process
## [1] "heart development" "phosphorylation"
## [3] "vasculature development" "blood vessel development"
## [5] "tissue morphogenesis" "cell adhesion"
## [7] "plasma membrane"
chord <- chord_dat(circ, EC$genes, EC$process)
head(chord)
## heart development phosphorylation vasculature development
## PTK2 0 1 1
## GNA13 0 0 1
## LEPR 0 0 1
## APOE 0 0 1
## CXCR4 0 0 1
## RECK 0 0 1
## blood vessel development tissue morphogenesis cell adhesion
## PTK2 1 0 0
## GNA13 1 0 0
## LEPR 1 0 0
## APOE 1 0 0
## CXCR4 1 0 0
## RECK 1 0 0
## plasma membrane logFC
## PTK2 1 -0.6527904
## GNA13 1 0.3711599
## LEPR 1 2.6539788
## APOE 1 0.8698346
## CXCR4 1 -2.5647537
## RECK 1 3.6926860
繪制
chord <- chord_dat(data = circ, genes = EC$genes, process = EC$process)
GOChord(chord, space = 0.02, gene.order = 'logFC', gene.space = 0.25, gene.size = 5)
Snipaste_2022-01-18_21-15-50
#只顯示富集到至少3個terms的基因
GOChord(chord, limit = c(3, 0), gene.order = 'logFC')
image-20220118211805704
熱圖
GOHeat(chord[,-8], nlfc = 0) #nlfc = 0,則以count為色階
image-20220118213129133
GOHeat(chord, nlfc = 1, fill.col = c('red', 'yellow', 'green')) #nlfc = 0,則以logFC 為色階
image-20220118213154579
GOCluster
GOCluster(circ, EC$process, clust.by = 'logFC', term.width = 2)
image-20220118220821861
GOCluster(circ, EC$process, clust.by = 'term', lfc.col = c('darkgoldenrod1', 'black', 'cyan1'))
image-20220118220848934
Venn diagram
l1 <- subset(circ, term == 'heart development', c(genes,logFC))
l2 <- subset(circ, term == 'plasma membrane', c(genes,logFC))
l3 <- subset(circ, term == 'tissue morphogenesis', c(genes,logFC))
GOVenn(l1,l2,l3, label = c('heart development', 'plasma membrane', 'tissue morphogenesis'))
image-20220118214705119