繪製火山圖的強大套件 – EnhancedVolcano 1.18.0

火山圖(Volcano plots)是一種常用於可視化差異表達分析(Differential expression analysis)結果的呈現方式,在生物學、基因組學、藥物研發等領域都有廣泛的應用。通過火山圖,研究人員可以直觀地了解在不同條件下的基因或分子表達差異,並從中識別出在生物學過程、疾病發展等方面具有重要意義的變化。在這裡跟大家分享一個繪製火山圖的強大又直覺的R套件,EnhancedVolcano

如何下載EnhancedVolcano套件?

# 下載EnhancedVolcano套件
if (!requireNamespace('BiocManager', quietly = TRUE))
  install.packages('BiocManager')
BiocManager::install('EnhancedVolcano')

# 檢查版本
packageVersion("EnhancedVolcano")

進行RNA-seq結果分析

1. 加載套件和載入RNA-seq結果

要使用任何 R 套件之前,需要先使用library()載入需要的套件。這次範例中所使用的RNA-seq檔案可以在這裡下載

# 加載套件
library(EnhancedVolcano)

# 載入RNA-seq結果
RNAseq <- read.csv("C:/Users/USER/Desktop/RNAseq_Sample.csv", header = T)
head(RNAseq)

成功輸入RNA-seq結果後,就可以直接繪製火山圖囉,過程就是那麼簡單粗暴!

2. 繪製最基本的火山圖

# 繪製最基本的火山圖
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name),x = 'Log.fold.change', y = 'P.value')

3. 修改logFC和P值的截斷值、指定標題、調整點和標籤的大小

# 修改logFC和P值的截斷值、指定標題、調整點和標籤的大小
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5)

4. 調整點點的顏色以及alpha值

將同時通過logFC和P值閾值的變量更改成紅色,其他所有變量塗成黑色。此外,alpha值能控制點點的透明度:1 = 100% 不透明;0 = 100% 透明。

# 調整點點的顏色以及alpha值
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5, col=c('black', 'black', 'black', 'red3'), colAlpha = 1)

5. 調整標點形狀

可以通過shape()參數指定標點形狀。形狀代碼的更多信息,請參考ggplot2:shape

# 調整標點形狀
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5, shape = c(1, 4, 23, 25), colAlpha = 1)

6. 調整圖例位置、大小和文字

# 調整圖例位置、大小和文字
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, cutoffLineType = 'twodash', cutoffLineWidth = 0.8,, pointSize = 3.0, labSize = 4.5, colAlpha = 1, legendLabels=c('Not sig.','Log (base 2) FC','p-value','p-value & Log (base 2) FC'),legendPosition = 'right',legendLabSize = 16,legendIconSize = 5.0)

7. 添加連接器來顯示更多標記

# 添加連接器來顯示更多標記
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', xlab = bquote(~Log[2]~ 'Log.fold.change'), title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5, legendIconSize = 3.0, drawConnectors = TRUE, widthConnectors = 0.5)
標記和小箭頭會根據使用者調整圖片大小而有所變化

8. 只顯示特定標記

# 只顯示特定標記
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', selectLab = c('Hamp','Irx5','Myh7','Tecrl'), title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5)

9. 在標記外加框框

# 在標記外加框框
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', selectLab = c('Hamp','Irx5','Myh7','Tecrl'), title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5, labCol = 'black', labFace = 'bold', boxedLabels = TRUE, colAlpha = 4/5, legendLabSize = 14, legendIconSize = 4.0, drawConnectors = TRUE, widthConnectors = 1.0, colConnectors = 'black')

10. 將火山圖翻轉到其它面

# 將火山圖翻轉到其它面
EnhancedVolcano(RNAseq,lab = as.character(RNAseq$Name), x = 'Log.fold.change', y = 'P.value', selectLab = c('Hamp','Irx5','Myh7','Tecrl'), title = 'control versus treatment', pCutoff = 10e-4, FCcutoff = 1, pointSize = 3.0, labSize = 4.5, labCol = 'black', labFace = 'bold', boxedLabels = TRUE, colAlpha = 4/5, legendLabSize = 14, legendIconSize = 4.0, drawConnectors = TRUE, widthConnectors = 1.0, colConnectors = 'black') + coord_flip()

以上便是EnhancedVolcano R套件中最常用到的指令和參數,如果想要畫更與眾不同的火山圖,可以參考EnhancedVolcano 套件的詳細教學。

參考文獻

1. Blighe, K, S Rana, and M Lewis. EnhancedVolcano: Publication-ready volcano plots with enhanced colouring and labeling. 2018.

2. EnhancedVolcano教學網站.

您的分享,我非常感激!!!
MillionQuesn
MillionQuesn

一個旅居台灣的異鄉人,分享突然靈光一現的亮點。

文章: 46

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

error: Alert: Content selection is disabled!!