R實戰 | 用R也可以完成的RNA-Seq分析-5

本文將介紹RNA-seq基因富集分析的實戰代碼。

原文地址:https://bioinformatics-core-shared-training.github.io/RNAseq-R/rna-seq-gene-set-testing.nb.html

書接上文(用R也可以完成的RNA-Seq下游分析-4)。

在基因差異分析后,我們會得到一個包含了差異表達基因信息的表格。但有時過于冗長的基因列表或是繁雜的信息會阻礙我們從中提取有效的信息。因此,科學家們時常會采用基因富集分析的辦法,去掌握差異表達基因真正影響到的信號通路或是代謝途徑等。

例如,Gene Ontology(GO)或是 KEGG就是較為常用的基因富集分析,不僅可以幫助我們從冗長的數據中提取出有生物學意義的信息,還能有助于我們從系統的水平觀察細胞/機體的變化。

接下來,我們就以GOseq這個包向大家展示在R中處理的GO富集分析流程。當然我們只是簡要地介紹一下,如果想要深入了解的朋友,可以查看Bioconductor上的幫助文檔:GOseq

本次流程所需要的包和數據集

library(edgeR)
library(goseq)

# 此前差異分析的結果
load("DE.Rdata")

GOseq analysis pipeline

results <- as.data.frame(topTags(lrt.BvsL, n = Inf))
# 篩選顯著的差異表達基因進行分析
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的分析也就到此為止了,至于后續的可視化的話就不先在此展開了。實際上還有許多R包也能在R中進行基因富集分析,例如Y叔的clusterProfilerfgseacamera等等。

關于RNA-seq分析流程到這就先告一段落了,文章中有任何錯誤都請各位小伙伴指出,共同學習!

完。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容