Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Omics/iVolcanoPlot.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ author:

The interactive volcano plot is a visualization tool for differential expression analysis of high-throughput data (e.g., transcriptomics, proteomics). Building upon the traditional volcano plot, it supports mouse hover to view gene information, click to jump to external databases, and provides more flexible threshold settings and color schemes, helping researchers screen and interpret differential analysis results more efficiently.

::: callout-note
**Full-featured version on Hiplot**

To keep this page lightweight, the interactive plots below are rendered from a downsampled subset of the example data (all significant genes plus a random sample of non-significant genes). For the complete, no-code interactive application, please use the Volcano plugin on the Hiplot website: <https://hiplot.cn/basic/volcano?lang=en>
:::

## Example

![](../images/Omics/iVolcanoPlot_demo.png){fig-alt="iVolcanoPlot DEMO" fig-align="center" width="60%"}
Expand Down Expand Up @@ -61,6 +67,14 @@ We use the built-in `easy_input_limma.rds` dataset from the `ivolcano` package,
# Load data
f1 <- system.file("extdata/easy_input_limma.rds", package = "ivolcano")
df_limma <- readRDS(f1)

# Downsample to keep the tutorial page lightweight: retain all significant
# genes (P.Value < 0.05 & |logFC| > 1) plus a fixed random sample of 2,000
# non-significant genes. Use the full dataset in your own analysis.
set.seed(1)
is_sig <- df_limma$P.Value < 0.05 & abs(df_limma$logFC) > 1
df_limma <- df_limma[sort(c(which(is_sig), sample(which(!is_sig), 2000))), ]

# View dataset
head(df_limma)
```
Expand Down Expand Up @@ -277,6 +291,13 @@ The `pathway_volcano` function can display an enrichment analysis dot plot along
# Prepare airway differential analysis data and perform GO enrichment analysis
f2 <- system.file("extdata/airway.rds", package = "ivolcano")
df_airway <- readRDS(f2)

# Downsample as above: all genes significant at padj < 0.05 are retained, so
# the enrichment analysis and plot linkage are unaffected.
set.seed(1)
is_sig_airway <- !is.na(df_airway$padj) & df_airway$padj < 0.05
df_airway <- df_airway[sort(c(which(is_sig_airway),
sample(which(!is_sig_airway), 2000))), ]
sig_genes <- df_airway$symbol[df_airway$padj < 0.01 & abs(df_airway$log2FoldChange) > 2]
sig_genes <- sig_genes[!is.na(sig_genes)]
entrez <- na.omit(mapIds(org.Hs.eg.db, sig_genes, "ENTREZID", "SYMBOL", multiVals = "first"))
Expand Down
19 changes: 19 additions & 0 deletions Omics/iVolcanoPlot.zh.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ author:

交互式火山图(Interactive Volcano Plot)是一种用于高通量数据(如转录组、蛋白组)差异表达分析的可视化图形。它在传统火山图的基础上,支持鼠标悬停查看基因信息、点击跳转外部数据库,并提供更灵活的阈值设定与配色方案,帮助研究者更高效地筛选和解读差异分析结果。

::: callout-note
**Hiplot 完整版应用**

为控制页面体积,本教程中的交互式图形基于降采样后的示例数据绘制(保留全部显著基因,并随机抽取部分非显著基因)。如需完整功能的无代码版本,请使用 Hiplot 网站的 Volcano 插件:<https://hiplot.cn/basic/volcano?lang=zh_cn>
:::

## 示例

![](../images/Omics/iVolcanoPlot_demo.png){fig-alt="iVolcanoPlot DEMO" fig-align="center" width="60%"}
Expand Down Expand Up @@ -61,6 +67,13 @@ sessioninfo::session_info("attached")
# 读取数据
f1 <- system.file("extdata/easy_input_limma.rds", package = "ivolcano")
df_limma <- readRDS(f1)

# 降采样以控制页面体积:保留全部显著基因(P.Value < 0.05 且 |logFC| > 1),
# 并固定随机种子抽取 2,000 个非显著基因。实际分析请使用完整数据集。
set.seed(1)
is_sig <- df_limma$P.Value < 0.05 & abs(df_limma$logFC) > 1
df_limma <- df_limma[sort(c(which(is_sig), sample(which(!is_sig), 2000))), ]

# 查看数据集
head(df_limma)
```
Expand Down Expand Up @@ -277,6 +290,12 @@ p
# 准备 airway 差异分析数据并做 GO 富集分析
f2 <- system.file("extdata/airway.rds", package = "ivolcano")
df_airway <- readRDS(f2)

# 同样进行降采样:padj < 0.05 的基因全部保留,因此富集分析与图形联动不受影响。
set.seed(1)
is_sig_airway <- !is.na(df_airway$padj) & df_airway$padj < 0.05
df_airway <- df_airway[sort(c(which(is_sig_airway),
sample(which(!is_sig_airway), 2000))), ]
sig_genes <- df_airway$symbol[df_airway$padj < 0.01 & abs(df_airway$log2FoldChange) > 2]
sig_genes <- sig_genes[!is.na(sig_genes)]
entrez <- na.omit(mapIds(org.Hs.eg.db, sig_genes, "ENTREZID", "SYMBOL", multiVals = "first"))
Expand Down
Loading