火山图智能标注可视化
简介
基于力导向算法的差异表达基因可视化工具,自动识别并标注Top 10显著基因,解决生信分析中标签重叠难题。
原始描述
Automatically label top significant genes in volcano plots with repulsion algorithm
通过你的 Agent 添加
安装目录:volcano-plot-labeler-164332/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Volcano Plot Labeler 是一款专为生物信息学分析设计的可视化工具,主要用于对火山图(Volcano Plot)中的显著差异表达基因进行智能标注。该工具接受标准的差异表达分析结果(如 DESeq2 或 edgeR 输出),自动计算基因的综合显著性评分(|log2FC| × -log10(pvalue)),识别最显著的 Top N 个基因,并通过力导向算法(Force-directed Algorithm)优化标签位置,彻底解决传统火山图中基因标签相互重叠、难以辨识的痛点。
用户可通过 Python API 或命令行两种方式进行调用,支持 CSV/TSV 格式的输入数据,输出格式涵盖 PNG、PDF、SVG 等科研常用格式。核心参数包括 p 值和 log2 倍数变化的阈值设定、标签样式配置以及排斥算法的迭代次数和力度调节,提供从基础到高级的完整配置能力。
显著优点
-
智能标注算法:采用物理模拟的排斥-弹簧模型,自动计算最优标签位置,无需手动调整,大幅提升科研作图效率。
-
零门槛集成:与 pandas、matplotlib、scipy 等主流 Python 生态无缝对接,支持标准 DESeq2 输出格式,学习成本极低。
-
高度可定制:从标签字体、颜色、箭头样式到阈值设定,几乎所有视觉元素均可配置,满足不同期刊的投稿要求。
-
本地化处理:纯本地运行,无需调用外部 API,保障基因数据的隐私安全,尤其适合涉及人类遗传信息的敏感研究。
潜在缺点与局限性
-
性能瓶颈:力导向算法的时间复杂度为 O(n²),当标注基因数量增加或迭代次数提高时,处理时间会显著增长,大规模数据集可能需要性能优化。
-
静态输出限制:当前版本仅支持静态图像输出,无法生成交互式网页图表,用户无法通过悬停查看详细信息。
-
算法收敛不确定性:排斥算法的最终布局依赖于初始随机状态,在极端密集区域可能出现局部最优解,导致标签布局不够理想。
-
依赖管理:需要用户自行维护 Python 环境及多个科学计算依赖库,对非技术背景的生信研究人员存在一定门槛。
适合的目标群体
智能标注算法:采用物理模拟的排斥-弹簧模型,自动计算最优标签位置,无需手动调整,大幅提升科研作图效率。
零门槛集成:与 pandas、matplotlib、scipy 等主流 Python 生态无缝对接,支持标准 DESeq2 输出格式,学习成本极低。
高度可定制:从标签字体、颜色、箭头样式到阈值设定,几乎所有视觉元素均可配置,满足不同期刊的投稿要求。
本地化处理:纯本地运行,无需调用外部 API,保障基因数据的隐私安全,尤其适合涉及人类遗传信息的敏感研究。
-
性能瓶颈:力导向算法的时间复杂度为 O(n²),当标注基因数量增加或迭代次数提高时,处理时间会显著增长,大规模数据集可能需要性能优化。
-
静态输出限制:当前版本仅支持静态图像输出,无法生成交互式网页图表,用户无法通过悬停查看详细信息。
-
算法收敛不确定性:排斥算法的最终布局依赖于初始随机状态,在极端密集区域可能出现局部最优解,导致标签布局不够理想。
-
依赖管理:需要用户自行维护 Python 环境及多个科学计算依赖库,对非技术背景的生信研究人员存在一定门槛。
适合的目标群体
该技能主要面向:从事转录组学、蛋白质组学等高通量组学研究的生物信息学分析师;需要快速生成 publication-ready 图表的科研人员;以及教授生物信息学课程、需要演示火山图可视化原理的教育工作者。尤其适合那些在 R/Python 可视化过程中饱受标签重叠困扰、希望获得自动化解决方案的用户群体。
使用风险
-
文件系统风险:工具需要读写本地文件,若输入路径验证不严格,理论上存在目录遍历攻击可能(尽管当前版本已设置基础防护)。
-
依赖供应链风险:依赖 numpy、scipy 等底层 C 扩展库,若这些依赖被恶意篡改,可能引入代码执行风险。
-
数据泄露风险:输出文件默认保存至工作目录,多用户共享环境需注意文件权限设置,防止敏感基因表达数据泄露。
-
版本兼容风险:matplotlib 等库的版本更新可能导致 API 变动,建议锁定依赖版本以确保可重复性。
文件系统风险:工具需要读写本地文件,若输入路径验证不严格,理论上存在目录遍历攻击可能(尽管当前版本已设置基础防护)。
依赖供应链风险:依赖 numpy、scipy 等底层 C 扩展库,若这些依赖被恶意篡改,可能引入代码执行风险。
数据泄露风险:输出文件默认保存至工作目录,多用户共享环境需注意文件权限设置,防止敏感基因表达数据泄露。
版本兼容风险:matplotlib 等库的版本更新可能导致 API 变动,建议锁定依赖版本以确保可重复性。
技能正文
name: volcano-plot-labeler
description: Automatically label top significant genes in volcano plots with repulsion
algorithm
version: 1.0.0
category: Visual
tags: []
author: AIPOCH
license: MIT
status: Draft
risk_level: Medium
skill_type: Tool/Script
owner: AIPOCH
reviewer: ''
last_updated: '2026-02-06'
Volcano Plot Labeler (ID: 148)
Automatically identify and label the Top 10 most significant genes in volcano plots using a repulsion algorithm to prevent label overlap.
Features
- Smart Gene Selection: Automatically identifies the top 10 most significant genes based on p-value and fold change
- Repulsion Algorithm: Uses force-directed positioning to prevent text label overlap
- Customizable: Configurable thresholds, label styling, and positioning options
- Multiple Output Formats: PNG, PDF, SVG support
Installation
pip install pandas matplotlib numpy scipy
Usage
Basic Usage
from volcano_plot_labeler import label_volcano_plot
import pandas as pd
# Load your data
df = pd.read_csv('differential_expression_results.csv')
# Generate labeled volcano plot
fig = label_volcano_plot(
df,
log2fc_col='log2FoldChange',
pvalue_col='padj',
gene_col='gene_name',
top_n=10
)
fig.savefig('volcano_plot_labeled.png', dpi=300, bbox_inches='tight')
Advanced Usage
from volcano_plot_labeler import label_volcano_plot
fig = label_volcano_plot(
df,
log2fc_col='log2FoldChange',
pvalue_col='padj',
gene_col='gene_name',
top_n=10,
pvalue_threshold=0.05,
log2fc_threshold=1.0,
figsize=(12, 10),
repulsion_iterations=100,
repulsion_force=0.05,
label_fontsize=10,
label_color='black',
arrow_color='gray',
save_path='output.png'
)
Command Line Usage
pip install pandas matplotlib numpy scipy
Usage
Basic Usage
from volcano_plot_labeler import label_volcano_plot
import pandas as pd
# Load your data
df = pd.read_csv('differential_expression_results.csv')
# Generate labeled volcano plot
fig = label_volcano_plot(
df,
log2fc_col='log2FoldChange',
pvalue_col='padj',
gene_col='gene_name',
top_n=10
)
fig.savefig('volcano_plot_labeled.png', dpi=300, bbox_inches='tight')
Advanced Usage
from volcano_plot_labeler import label_volcano_plot
fig = label_volcano_plot(
df,
log2fc_col='log2FoldChange',
pvalue_col='padj',
gene_col='gene_name',
top_n=10,
pvalue_threshold=0.05,
log2fc_threshold=1.0,
figsize=(12, 10),
repulsion_iterations=100,
repulsion_force=0.05,
label_fontsize=10,
label_color='black',
arrow_color='gray',
save_path='output.png'
)
python scripts/main.py \
--input data/deseq2_results.csv \
--output volcano_labeled.png \
--log2fc-col log2FoldChange \
--pvalue-col padj \
--gene-col gene_name \
--top-n 10
Input Format
Expected CSV/TSV columns:
log2FoldChange: Log2 fold change valuespadjorpvalue: Adjusted p-values or raw p-valuesgene_name: Gene identifiers
Algorithm
Significance Calculation
- Calculate
-log10(pvalue)for all genes - Rank genes by combined score:
|log2FC| * -log10(pvalue) - Select top N genes with highest significance
Repulsion Algorithm
- Initial Placement: Place labels at gene coordinates
- Force Calculation:
- Repulsive force between overlapping labels
- Spring force pulling label toward its gene point
- Boundary forces to keep labels within plot area
- Iterative Optimization: Update positions for N iterations until convergence
- Arrow Drawing: Draw connecting lines from labels to gene points
Parameters
Parameter
Type
Default
Description
df
DataFrame
-
Input data
log2fc_col
str
'log2FoldChange'
Column name for log2 fold change
pvalue_col
str
'padj'
Column name for p-value
gene_col
str
'gene_name'
Column name for gene names
top_n
int
10
Number of top genes to label
pvalue_threshold
float
0.05
P-value cutoff for coloring
log2fc_threshold
float
1.0
Log2FC cutoff for coloring
repulsion_iterations
int
100
Iterations for repulsion algorithm
repulsion_force
float
0.05
Strength of repulsion force
label_fontsize
int
10
Font size for labels
figsize
tuple
(10, 10)
Figure size
Output
- Labeled volcano plot with:
- Color-coded points (up/down/not significant)
- Top 10 gene labels with leader lines
- No overlapping text labels
License
- Repulsive force between overlapping labels
- Spring force pulling label toward its gene point
- Boundary forces to keep labels within plot area
| Parameter | Type | Default | Description |
|---|---|---|---|
df |
DataFrame | - | Input data |
log2fc_col |
str | 'log2FoldChange' | Column name for log2 fold change |
pvalue_col |
str | 'padj' | Column name for p-value |
gene_col |
str | 'gene_name' | Column name for gene names |
top_n |
int | 10 | Number of top genes to label |
pvalue_threshold |
float | 0.05 | P-value cutoff for coloring |
log2fc_threshold |
float | 1.0 | Log2FC cutoff for coloring |
repulsion_iterations |
int | 100 | Iterations for repulsion algorithm |
repulsion_force |
float | 0.05 | Strength of repulsion force |
label_fontsize |
int | 10 | Font size for labels |
figsize |
tuple | (10, 10) | Figure size |
Output
- Labeled volcano plot with:
- Color-coded points (up/down/not significant)
- Top 10 gene labels with leader lines
- No overlapping text labels
License
- Color-coded points (up/down/not significant)
- Top 10 gene labels with leader lines
- No overlapping text labels
MIT
Risk Assessment
Risk Indicator
Assessment
Level
Code Execution
Python/R scripts executed locally
Medium
Network Access
No external API calls
Low
File System Access
Read input files, write output files
Medium
Instruction Tampering
Standard prompt guidelines
Low
Data Exposure
Output files saved to workspace
Low
Security Checklist
- No hardcoded credentials or API keys
- No unauthorized file system access (../)
- Output does not expose sensitive information
- Prompt injection protections in place
- Input file paths validated (no ../ traversal)
- Output directory restricted to workspace
- Script execution in sandboxed environment
- Error messages sanitized (no stack traces exposed)
- Dependencies audited
Prerequisites
# Python dependencies
pip install -r requirements.txt
Evaluation Criteria
Success Metrics
- Successfully executes main functionality
- Output meets quality standards
- Handles edge cases gracefully
- Performance is acceptable
Test Cases
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
| Risk Indicator | Assessment | Level |
|---|---|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access | No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
- No hardcoded credentials or API keys
- No unauthorized file system access (../)
- Output does not expose sensitive information
- Prompt injection protections in place
- Input file paths validated (no ../ traversal)
- Output directory restricted to workspace
- Script execution in sandboxed environment
- Error messages sanitized (no stack traces exposed)
- Dependencies audited
Prerequisites
# Python dependencies
pip install -r requirements.txt
Evaluation Criteria
Success Metrics
- Successfully executes main functionality
- Output meets quality standards
- Handles edge cases gracefully
- Performance is acceptable
Test Cases
# Python dependencies
pip install -r requirements.txt
Success Metrics
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
- Performance optimization
- Additional feature support
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。