GOplot 包通过封装好的函数可视化基因功能分析结果。
#1. 安装
install.packages('GOplot')
#2. GOplot 内置数据
##2.1 脑和心脏内皮细胞的转录组数据
来自文章Nolan et al. 2013 ,GEO accession: GSE47067 .
Name
Description
Dimension
EC$eset
Data frame of normalized expression values of brain and heart endothelial cells (3 replicates)
20644 x 7
EC$genelist
Data frame of differentially expressed genes (adjusted p-value < 0.05)
2039 x 7
EC$david
Data frame of results from a functional analysis of the differentially expressed genes performed with DAVID
174 x 5
EC$genes
Data frame of selected genes with logFC
37 x 2
EC$process
Character vector of selected enriched biological processes
7
##2.2 查看内置数据格式
library(GOplot)
data(EC)
基因富集结果查看
head(EC$david)
## Category ID Term
## 1 BPGO:0007507 heartdevelopment
## 2 BPGO:0001944 vasculaturedevelopment
## 3 BPGO:0001568 blood vesseldevelopment
## 4 BPGO:0048729 tissuemorphogenesis
## 5 BPGO:0048514 blood vesselmorphogenesis
## 6 BPGO:0051336 regulation of hydrolase activity
## Genes
## 1 DLC1,NRP2, NRP1, EDN1, PDLIM3, GJA1, TTN, GJA5, ZIC3, TGFB2, CERKL, GATA6, COL4A3BP,GAB1, SEMA3C, MKL2, SLC22A5, MB, PTPRJ, RXRA, VANGL2, MYH6, TNNT2, HHEX, MURC,MIB1, FOXC2, FOXC1, ADAM19, MYL2, TCAP, EGLN1, SOX9, ITGB1, CHD7, HEXIM1, PKD2,NFATC4, PCSK5, ACTC1, TGFBR2, NF1, HSPG2, SMAD3, TBX1, TNNI3, CSRP3, FOXP1,KCNJ8, PLN, TSC2, ATP6V0A1, TGFBR3, HDAC9
## 2 GNA13, ACVRL1, NRP1, PGF, IL18, LEPR, EDN1, GJA1,FOXO1, GJA5, TGFB2, WARS, CERKL, APOE, CXCR4, ANG, SEMA3C, NOS2, MKL2, FGF2,RAPGEF1, PTPRJ, RECK, EFNB2, VASH1, PNPLA6, THY1, MIB1, NUS1, FOXC2, FOXC1,CAV1, CDH2, MEIS1, WT1, CDH5, PTK2, FBXW8, CHD7, PLCD1, PLXND1, FIGF, PPAP2B,MAP2K1, TBX4, TGFBR2, NF1, TBX1, TNNI3, LAMA4, MEOX2, ECSCR, HBEGF, AMOT,TGFBR3, HDAC7
## 3 GNA13,ACVRL1, NRP1, PGF, IL18, LEPR, EDN1, GJA1, FOXO1, GJA5, TGFB2, WARS, CERKL,APOE, CXCR4, ANG, SEMA3C, NOS2, MKL2, FGF2, RAPGEF1, PTPRJ, RECK, VASH1,PNPLA6, THY1, MIB1, NUS1, FOXC2, FOXC1, CAV1, CDH2, MEIS1, WT1, CDH5, PTK2,FBXW8, CHD7, PLCD1, PLXND1, FIGF, PPAP2B, MAP2K1, TBX4, TGFBR2, NF1, TBX1,TNNI3, LAMA4, MEOX2, ECSCR, HBEGF, AMOT, TGFBR3, HDAC7
## 4 DLC1, ENAH,NRP1, PGF, ZIC2, TGFB2, CD44, ILK, SEMA3C, RET, AR, RXRA, VANGL2, LEF1, TNNT2,HHEX, MIB1, NCOA3, FOXC2, FOXC1, TGFB1I1, WNT5A, COBL, BBS4, FGFR3, TNC, BMPR2,CTNND1, EGLN1, NR3C1, SOX9, TCF7L1, IGF1R, FOXQ1, MACF1, HOXA5, BCL2, PLXND1,CAR2, ACTC1, TBX4, SMAD3, FZD3, SHANK3, FZD6, HOXB4, FREM2, TSC2, ZIC5, TGFBR3,APAF1
## 5 GNA13, CAV1, ACVRL1, NRP1, PGF,IL18, LEPR, EDN1, GJA1, CDH2, MEIS1, WT1, TGFB2, WARS, PTK2, CERKL, APOE,CXCR4, ANG, SEMA3C, PLCD1, NOS2, MKL2, PLXND1, FIGF, FGF2, PTPRJ, TGFBR2, TBX4,NF1, TBX1, TNNI3, PNPLA6, VASH1, THY1, NUS1, MEOX2, ECSCR, AMOT, HBEGF, FOXC2,FOXC1, HDAC7
## 6 CAV1, XIAP, AGFG1, ADORA2A, TNNC1, TBC1D9, LEPR, ABHD5, EDN1, ASAP2,ASAP3, SMAP1, TBC1D12, ANG, TBC1D14, MTCH1, TBC1D13, TBC1D4, TBC1D30, DHCR24, HIP1,VAV3, NOS1, NF1, MYH6, RICTOR, TBC1D22A, THY1, PLCE1, RNF7, NDEL1, CHML, IFT57,ACAP2, TSC2, ERN1, APAF1, ARAP3, ARAP2, ARAP1, HTR2A, F2R
## adj_pval
## 1 0.000002170
## 2 0.000010400
## 3 0.000007620
## 4 0.000119000
## 5 0.000720000
## 6 0.001171166
查看选择的基因
head(EC$genelist)
## ID logFC AveExpr t P.Value adj.P.Val B
## 1 Slco1a4 6.645388 1.2168670 88.65515 1.32e-18 2.73e-14 29.02715
## 2 Slc19a3 6.281525 1.1600468 69.95094 2.41e-17 2.49e-13 27.62917
## 3 Ddc 4.4833380.8365231 65.57836 5.31e-17 3.65e-1327.18476
## 4 Slco1c1 6.469384 1.3558865 59.87613 1.62e-16 8.34e-13 26.51242
## 5 Sema3c5.515630 2.3252117 58.53141 2.14e-16 8.81e-13 26.33626
## 6 Slc38a3 4.761755 0.9218670 54.11559 5.58e-16 1.76e-12 25.70308
circ <- circle_dat(EC$david, EC$genelist)
head(circ)
category ID term count genes logFC adj_pval zscore
BP GO:0007507 heart development 54 DLC1 -0.9707875 2.17e-06 -0.8164966
BP GO:0007507 heart development 54 NRP2 -1.5153173 2.17e-06 -0.8164966
BP GO:0007507 heart development 54 NRP1 -1.1412315 2.17e-06 -0.8164966
BP GO:0007507 heart development 54 EDN1 1.3813006 2.17e-06-0.8164966
BP GO:0007507 heart development 54PDLIM3 -0.8876939 2.17e-06 -0.8164966
BP GO:0007507 heart development 54 GJA1 -0.8179480 2.17e-06 -0.8164966
zscore: 每个GO term下上调(logFC>0)基因数和下调基因数的差与注释到GO term基因数平方根的商。
zscore
#3. 画图
##3.1 条形图(GOBar())
GOBar(subset(circ, category == 'BP')
GOBar(circ, display = 'multiple')
GOBar
#3.2 气泡图(GOBubble())
GOBubble(circ, labels = 3)
上图中:X轴是z-score; Y轴是多重矫正后p值的负对数;圈大小展示GO Term下基因数。
GOBubble(circ, title = 'Bubble plot', colour =c('orange', 'darkred', 'gold'), display = 'multiple', labels = 3)
#2.3 圈图展示基因富集分析结果(GOCircle())
GOCircle(circ)
默认展示circ 数据前10个GO Term,通过参数nsub调整需要展示的GO Term
GOCircle(circ, nsub = c('GO:0007507', 'GO:0001568','GO:0001944', 'GO:0048729', 'GO:0048514', 'GO:0005886', 'GO:0008092','GO:0008047'))
GOCircle(circ, nsub = 10)
#2.4 展示基因与GO Terms关系的圈图 (GOChord())
chord_dat ()将作图数据构建成GOChord() 要求的输入格式;一个二进制的关系矩阵,1表示基因属于该GO Term,0与之相反。
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_dat(data, genes, process)
#genes、process其中任何一个参数不指定,默认使用对应的全部数据
chord <- chord_dat(circ, EC$genes, EC$process)
head(chord)
## heartdevelopment 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
## bloodvessel 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
## plasmamembrane 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)
GOChord(data, title, space, gene.order, gene.size,gene.space, nlfc = 1,lfc.col, lfc.min,lfc.max, ribbon.col, border.size, process.label, limit)
#data: 二进制矩阵
#title:标题
#space:基因对应方块之间的距离
#gene.order:基因排列顺序
#gene.size:基因标签大小
#nlfc:logFC 列的数目
#lfc.col:LFC颜色,定义模式:c(color for low values, color for the mid point, color for the highvalues)
#lfc.min:LFC最小值
#lfc.max:LFC最大值
#ribbon.col:向量定义基因与GO Term间条带颜色
#border.size:基因与GO Term间条带边框粗细
#process.label:GO Term 图例文字大小
#limit:c(3, 2),两个数字;第一个参数筛选基因(保留至少存在于3个GO Term的基因),第二个参数筛选GO Term(保留至少包含2个基因的GO Term )
#3.5 基因与GO Term的热图(GOHeat)
nlfc = 1 :颜色对应logFC
nlfc = 0 :颜色对应每个基因注释了到了几个GO Term
GOHeat(chord, nlfc = 1, fill.col = c('red', 'yellow','green'))
GOCluster(circ, EC$process, clust.by = ‘logFC’,term.width = 2)
GOCluster()调用R内置函数hclust 对基因表水平达或根据功能分内进行层次聚类。
GOCluster(circ, EC$process, clust.by = 'logFC',term.width = 2)