本文將介紹RNA-seq基因富集分析的實(shí)戰(zhàn)代碼瓢棒。
原文地址:https://bioinformatics-core-shared-training.github.io/RNAseq-R/rna-seq-gene-set-testing.nb.html
書接上文(用R也可以完成的RNA-Seq下游分析-4)。
在基因差異分析后陶衅,我們會(huì)得到一個(gè)包含了差異表達(dá)基因信息的表格。但有時(shí)過于冗長的基因列表或是繁雜的信息會(huì)阻礙我們從中提取有效的信息直晨。因此搀军,科學(xué)家們時(shí)常會(huì)采用基因富集分析的辦法,去掌握差異表達(dá)基因真正影響到的信號(hào)通路或是代謝途徑等抡秆。
例如奕巍,Gene Ontology(GO)或是 KEGG就是較為常用的基因富集分析,不僅可以幫助我們從冗長的數(shù)據(jù)中提取出有生物學(xué)意義的信息儒士,還能有助于我們從系統(tǒng)的水平觀察細(xì)胞/機(jī)體的變化的止。
接下來,我們就以GOseq
這個(gè)包向大家展示在R中處理的GO富集分析流程着撩。當(dāng)然我們只是簡要地介紹一下诅福,如果想要深入了解的朋友,可以查看Bioconductor上的幫助文檔:GOseq
本次流程所需要的包和數(shù)據(jù)集
library(edgeR)
library(goseq)
# 此前差異分析的結(jié)果
load("DE.Rdata")
GOseq analysis pipeline
results <- as.data.frame(topTags(lrt.BvsL, n = Inf))
# 篩選顯著的差異表達(dá)基因進(jìn)行分析
genes <- results$FDR < 0.01
names(genes) <- rownames(results)
# Fit the Probability Weighting Function (PWF) 拖叙,以生成零分布
pwf <- nullp(genes, "mm10","knownGene")
# 富集分析
go.results <- goseq(pwf, "mm10","knownGene")
head(go.results,10)
category over_represented_pvalue under_represented_pvalue numDEInCat numInCat
16121 GO:0071944 4.062458e-63 1 933 3543
2723 GO:0005886 2.686421e-62 1 908 3420
2540 GO:0005576 4.492776e-57 1 469 1457
11253 GO:0044421 1.026496e-50 1 391 1175
11283 GO:0044459 2.158946e-49 1 563 1893
2562 GO:0005615 2.018827e-47 1 336 975
7483 GO:0031224 2.789374e-41 1 833 3414
7485 GO:0031226 3.115084e-40 1 323 923
2724 GO:0005887 7.600430e-40 1 309 867
4426 GO:0009653 1.471331e-39 1 592 2186
term ontology
16121 cell periphery CC
2723 plasma membrane CC
2540 extracellular region CC
11253 extracellular region part CC
11283 plasma membrane part CC
2562 extracellular space CC
7483 intrinsic component of membrane CC
7485 intrinsic component of plasma membrane CC
2724 integral component of plasma membrane CC
4426 anatomical structure morphogenesis BP
GO的分析也就到此為止了氓润,至于后續(xù)的可視化的話就不先在此展開了。實(shí)際上還有許多R包也能在R中進(jìn)行基因富集分析薯鳍,例如Y叔的clusterProfiler
咖气,fgsea
,camera
等等挖滤。
關(guān)于RNA-seq分析流程到這就先告一段落了崩溪,文章中有任何錯(cuò)誤都請(qǐng)各位小伙伴指出,共同學(xué)習(xí)斩松!
完伶唯。