← 返回 Skills 市场
aipoch-ai

Heatmap Beautifier

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
112
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install heatmap-beautifier
功能描述
Professional beautification tool for gene expression heatmaps, automatically adds clustering trees, color annotation tracks, and intelligently optimizes labe...
使用说明 (SKILL.md)

Heatmap Beautifier

Professional beautification tool for gene expression heatmaps, automatically adds clustering trees, color annotation tracks, and intelligently optimizes label layout.

Input Validation

This skill accepts: CSV files containing gene expression matrices (genes as rows, samples as columns) for heatmap generation and beautification.

If the user's request does not involve heatmap generation or gene expression visualization — for example, asking to perform differential expression analysis, run statistical tests, or generate other chart types — do not proceed. Instead respond:

"heatmap-beautifier is designed to generate and beautify gene expression heatmaps from expression matrix data. Your request appears to be outside this scope. Please provide a CSV expression matrix file, or use a more appropriate tool for your task."

Do not continue the workflow when the request is out of scope, missing the required input CSV, or would require unsupported assumptions. For missing inputs, state exactly which fields are missing.

Quick Check

python -m py_compile scripts/main.py
python scripts/main.py --help
# Demo mode (no CSV required):
python scripts/main.py --demo --output demo_heatmap.pdf

When to Use

  • Beautify gene expression heatmaps with clustering trees and annotation tracks
  • Generate publication-ready heatmap output (PDF, PNG, SVG) with optimized label layout
  • Add row/column annotation color bars to expression matrices
  • Standardize heatmap styling for manuscript figures

Workflow

  1. Validate input — confirm the request is within scope before any processing.
  2. Confirm the user objective, required inputs, and non-negotiable constraints.
  3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
  4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
  5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

Features

  • Automatic Clustering: Adds row/column clustering trees based on hierarchical clustering
  • Annotation Tracks: Supports multiple color annotation tracks (sample grouping, gene classification, etc.)
  • Smart Labels: Automatically calculates optimal font size to avoid row/column label overlap
  • Flexible Color Schemes: Built-in multiple professional scientific research color schemes
  • Export Options: Supports PDF, PNG, SVG formats
  • Demo Mode: Run --demo to generate a synthetic 20×10 matrix without a real CSV

Dependencies

pip install seaborn matplotlib scipy pandas numpy

Usage

Basic Usage

from skills.heatmap_beautifier.scripts.main import HeatmapBeautifier

hb = HeatmapBeautifier()
hb.create_heatmap(
    data_path="expression_matrix.csv",
    output_path="output/heatmap.pdf"
)

Command Line Usage

python -m skills.heatmap_beautifier.scripts.main \
    --input expression_matrix.csv \
    --output heatmap.pdf

python -m skills.heatmap_beautifier.scripts.main \
    --input expression_matrix.csv \
    --output heatmap.pdf \
    --row-cluster \
    --col-cluster \
    --row-annotations row_annot.json \
    --col-annotations col_annot.json \
    --title "Gene Expression"

# Demo mode (no CSV required)
python -m skills.heatmap_beautifier.scripts.main --demo --output demo_heatmap.pdf

# Save clustering metadata to JSON for agent consumption
python -m skills.heatmap_beautifier.scripts.main \
    --input expression_matrix.csv \
    --output heatmap.pdf \
    --output-json heatmap_metadata.json

Parameters

Parameter Type Default Required Description
--data-path, -d string - Yes* Path to input data file (CSV)
--demo flag - No Generate synthetic 20×10 demo matrix
--output-path, -o string heatmap.png No Output file path
--title string Gene Expression Heatmap No Heatmap title
--cmap string RdBu_r No Color map
--center float 0 No Color center value
--vmin float -2 No Minimum value for color scale
--vmax float 2 No Maximum value for color scale
--row-cluster bool true No Enable row clustering
--col-cluster bool true No Enable column clustering
--standard-scale string None No Standardization: row, col, None
--z-score int None No Z-score: 0 (row), 1 (col), None
--figsize tuple (12, 10) No Figure size (width, height)
--dpi int 300 No Resolution (dots per inch)
--format string pdf No Output format (pdf, png, svg)
--output-json string - No Save clustering metadata (gene_order, sample_order, annotation_colors) to JSON

*One of --data-path or --demo is required.

Input Data Format

Expression Matrix (CSV)

,sample1,sample2,sample3,sample4
Gene_A,2.5,-1.2,0.8,-0.5
Gene_B,-0.8,1.5,-2.1,0.3
Gene_C,1.2,0.5,-0.7,1.8
  • First column: Gene names (row index)
  • First row: Sample names (column names)
  • Data: Expression values (e.g., log2 fold change, TPM, FPKM)

Color Schemes

  • "RdBu_r" — Red-Blue (classic differential expression)
  • "viridis" — Yellow-Purple (continuous data)
  • "RdYlBu_r" — Red-Yellow-Blue
  • "coolwarm" — Cool-Warm
  • "seismic" — Seismic
  • "bwr" — Blue-White-Red

Error Handling

  • If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
  • If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
  • If scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
  • Do not fabricate files, citations, data, search results, or execution outcomes.
  • Exception handling: The script uses except (pd.errors.ParserError, UnicodeDecodeError, ValueError) for CSV parsing errors — not bare except. If you see a bare except in an older version, report it.
  • Error propagation: FileNotFoundError and ValueError are caught in main() with try/except (FileNotFoundError, ValueError) as e: print(f'Error: {e}', file=sys.stderr); sys.exit(1) and reported to stderr with exit code 1.

Fallback Behavior

If scripts/main.py fails or required inputs are incomplete:

  1. Report the exact failure point and error message.
  2. State what can still be completed (e.g., data validation without rendering).
  3. Manual fallback: verify CSV format has gene rows and sample columns, then re-run with minimal options: python -m skills.heatmap_beautifier.scripts.main --input data.csv --output out.png.
  4. Use --demo to verify the environment works without a real CSV.
  5. Do not fabricate execution outcomes or file contents.

Output Requirements

Every final response must make these items explicit when relevant:

  • Objective or requested deliverable
  • Inputs used and assumptions introduced
  • Workflow or decision path
  • Core result, recommendation, or artifact
  • Constraints, risks, caveats, or validation needs
  • Unresolved items and next-step checks

Response Template

Use the following fixed structure for non-trivial requests:

  1. Objective
  2. Inputs Received
  3. Assumptions
  4. Workflow
  5. Deliverable
  6. Risks and Limits
  7. Next Checks

For stress/multi-constraint requests, also include:

  • Constraints checklist (compliance, performance, error paths)
  • Unresolved items with explicit blocking reasons

If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.

Notes

  1. Recommended to perform log2 transformation or standardization on data first
  2. Large datasets (>5000 rows) may take longer to process
  3. When there are too many rows/columns, some labels will be automatically hidden
  4. Default clustering uses Euclidean distance and Ward method
安全使用建议
This skill appears to be a real heatmap beautifier and does not request credentials or external downloads, but there are two issues you should check before installing or running it: (1) the code contains a bare 'except:' in load_data() that can hide parsing or other errors—ask the maintainer to replace it with targeted exception types (e.g., pd.errors.ParserError, UnicodeDecodeError) or review the code yourself; (2) the SKILL.md usage examples assume an installed package import path which may not work if you only have the script file—verify how the skill will be deployed. To be safer, run the quick checks locally in an isolated environment: python -m py_compile scripts/main.py and python scripts/main.py --demo --output demo_heatmap.pdf, and inspect the script for any further unexpected behavior. If you plan to let the agent invoke this skill autonomously, prefer running it in a restricted environment (container or sandbox) until you confirm the code matches the documentation and exception handling is fixed.
能力评估
Purpose & Capability
Name, description, SKILL.md, requirements.txt and scripts/main.py consistently implement a gene-expression heatmap beautifier using seaborn/matplotlib/pandas/numpy. Declared features (clustering, annotation tracks, demo mode, output JSON) align with the code and documented CLI.
Instruction Scope
SKILL.md instructs running the included script and to only operate on CSV expression matrices; it does not ask for unrelated system files or credentials. However the code's load_data() uses a bare 'except:' to try alternate CSV separators (which can mask errors) while the POLISH_CHANGELOG/SKILL.md claim that bare excepts were replaced with specific exceptions—this is a direct doc/code mismatch. Also the usage examples import from 'skills.heatmap_beautifier.scripts.main', which assumes the skill is installed as a package; if it isn't, the import path may fail and the runtime advice is slightly inconsistent with a simple script layout.
Install Mechanism
No install spec; requirements.txt lists common scientific Python packages (matplotlib, numpy, pandas, seaborn). No downloads from external URLs or archive extraction are present in the package metadata. This is low-risk compared to arbitrary installer scripts.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The dependencies and parameters are proportionate to a visualization tool.
Persistence & Privilege
always:false, no platform-wide changes or claims to modify other skills. The skill is user-invocable and can be invoked autonomously (platform default); that is expected for skills and does not by itself raise a red flag here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install heatmap-beautifier
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /heatmap-beautifier 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of heatmap-beautifier — an automated tool for publishing-ready gene expression heatmaps. - Automatically adds clustering trees and color annotation tracks. - Intelligently optimizes row/column label layout to avoid overlap. - Supports multiple output formats (PDF, PNG, SVG) and professional color schemes. - Provides both Python API and command line interface, including a demo mode. - Explicit validation and error handling for required inputs and supported workflows. - Structured response templates for result reporting and troubleshooting.
元数据
Slug heatmap-beautifier
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Heatmap Beautifier 是什么?

Professional beautification tool for gene expression heatmaps, automatically adds clustering trees, color annotation tracks, and intelligently optimizes labe... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 112 次。

如何安装 Heatmap Beautifier?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install heatmap-beautifier」即可一键安装,无需额外配置。

Heatmap Beautifier 是免费的吗?

是的,Heatmap Beautifier 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Heatmap Beautifier 支持哪些平台?

Heatmap Beautifier 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Heatmap Beautifier?

由 AIpoch(@aipoch-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论