← 返回 Skills 市场
aipoch-ai

Gene Structure Mapper

作者 AIpoch · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
183
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gene-structure-mapper
功能描述
Visualize gene structure with exon-intron diagrams, domain annotations, and mutation position markers. Produces SVG, PNG, or PDF figures suitable for publica...
使用说明 (SKILL.md)

Gene Structure Mapper

Generate exon-intron structure diagrams for any gene symbol using the Ensembl REST API. Optionally overlay protein domain annotations (UniProt) and mark mutation hotspot positions. Outputs publication-ready SVG, PNG, or PDF figures.

IMPLEMENTEDscripts/main.py is fully functional. Ensembl REST API, caching, matplotlib visualization, --domains, --mutations, and --demo are all implemented.

Quick Check

python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py --demo --output demo.png

When to Use

  • Creating gene structure figures for manuscripts or presentations
  • Visualizing splice variants and isoform differences
  • Marking mutation positions on a gene diagram for functional annotation
  • Overlaying domain boundaries on exon-intron maps

Workflow

  1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
  2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
  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.

Fallback template: If scripts/main.py fails or the gene symbol is unrecognized, report: (a) the failure point, (b) whether a manual Ensembl/UCSC lookup can substitute, (c) which output formats are still generatable.

Parameters

Parameter Type Required Description
--gene, -g string Yes* Gene symbol or Ensembl ID (e.g., TP53, BRCA1, ENSG00000141510)
--species string No Species name for Ensembl lookup (default: homo_sapiens)
--format string No Output format: png, svg, pdf (default: png)
--output, -o string No Output file path (default: \x3Cgene>_structure.\x3Cformat>)
--domains flag No Fetch and overlay UniProt protein domain annotations
--mutations string No Comma-separated codon positions to mark (e.g., 248,273)
--demo flag No Use hardcoded TP53 GRCh38 data — no internet required

*Required unless --demo is used.

Usage

python scripts/main.py --gene TP53 --format png
python scripts/main.py --gene BRCA1 --format png --domains --output brca1_structure.png
python scripts/main.py --gene KRAS --mutations 12,13,61 --format pdf
python scripts/main.py --demo
python scripts/main.py --demo --output demo.png --format svg

Implementation Notes (for script developer)

The script must implement:

  1. Gene lookupGET https://rest.ensembl.org/lookup/symbol/homo_sapiens/{gene}?expand=1 to fetch exon coordinates. Cache response to .cache/{gene}_ensembl.json to avoid repeated API calls. Add a 0.1 s delay between requests for batch lookups. The unauthenticated rate limit is 15 requests/second.
  2. Unknown gene handling — catch HTTP 400/404 from Ensembl and exit with code 1: Error: Gene not found: {gene_name}. Check the gene symbol and try again.
  3. SVG/PNG/PDF output — use matplotlib or svgwrite to draw exon blocks (filled rectangles) and intron lines scaled to genomic coordinates.
  4. --domains flag — fetch UniProt domain annotations and overlay colored domain blocks on the gene structure.
  5. --mutations flag — accept comma-separated codon positions; map to exon coordinates and draw vertical markers.
  6. --demo flag — use hardcoded TP53 GRCh38 exon coordinates (no internet required) to generate a demo visualization.

Known Limitations

  • For genes with multiple isoforms, the script uses the canonical transcript (Ensembl is_canonical flag). Other isoforms are not visualized.
  • Domain overlay (--domains) maps UniProt amino acid positions to genomic coordinates using CDS length; accuracy may vary for genes with complex splicing.
  • Ensembl API responses are cached to .cache/{gene}_ensembl.json. Delete the cache file to force a fresh lookup.
  • The unauthenticated Ensembl REST API rate limit is 15 requests/second; a 0.1 s delay is applied between batch requests.

Features

  • Exon-intron visualization scaled to genomic coordinates
  • Protein domain annotation overlay via UniProt (optional, --domains)
  • Mutation position markers with configurable labels (--mutations)
  • Publication-ready output in SVG, PNG, or PDF
  • Demo mode for offline testing (--demo)
  • Ensembl API response caching to avoid rate-limit issues

Output Requirements

Every response must make these explicit:

  • Objective and deliverable
  • Inputs used and assumptions introduced (e.g., genome build, transcript isoform selected)
  • Workflow or decision path taken
  • Core result: gene structure figure file path
  • Constraints, risks, caveats (e.g., multi-isoform genes, annotation version)
  • Unresolved items and next-step checks

Input Validation

This skill accepts: gene symbol inputs for structure visualization, with optional domain and mutation overlays.

If the request does not involve gene structure visualization — for example, asking to perform sequence alignment, predict protein structure, or analyze expression data — do not proceed. Instead respond:

"gene-structure-mapper is designed to visualize gene exon-intron structure. Your request appears to be outside this scope. Please provide a gene symbol and desired output format, or use a more appropriate tool for your task."

Error Handling

  • If --gene is missing, state that the gene symbol is required and provide an example.
  • If the gene symbol is not found in Ensembl (HTTP 400/404), print: Error: Gene not found: {gene_name}. Check the gene symbol and try again. and exit with code 1.
  • If --mutations contains non-numeric values, reject with: Error: --mutations must be comma-separated integers (codon positions).
  • 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.

Response Template

  1. Objective
  2. Inputs Received
  3. Assumptions
  4. Workflow
  5. Deliverable
  6. Risks and Limits
  7. Next Checks
安全使用建议
This skill appears to be what it claims: a Python script that fetches Ensembl (and optionally EBI/UniProt) data to produce gene diagrams. Before installing or running it, consider: (1) Network access — live mode makes outbound requests to https://rest.ensembl.org and https://www.ebi.ac.uk; if you need to run offline, use --demo which uses hardcoded TP53 data. (2) Local files — the script creates/reads .cache/{gene}_ensembl.json and writes image files to the output path; check that this is acceptable in your environment. (3) No credentials are requested, but verify that running code from an unknown source is acceptable for your risk posture; review the script (scripts/main.py) if you need higher assurance. (4) Domain-to-genome mapping is approximate (as documented); validate figures for publication. If you want extra caution, run the demo first, inspect the code, and consider executing inside an isolated environment (container or VM) before using it on sensitive systems.
功能分析
Type: OpenClaw Skill Name: gene-structure-mapper Version: 0.1.0 The skill bundle is a legitimate bioinformatics tool designed to visualize gene exon-intron structures. The Python script (scripts/main.py) uses standard libraries to fetch genomic data from public, unauthenticated APIs (Ensembl and EBI) and generates diagrams using Matplotlib. There is no evidence of malicious intent, data exfiltration, or dangerous execution patterns like shell injection or dynamic code evaluation. The documentation (SKILL.md) includes robust input validation and clear instructions for the AI agent that align with the stated purpose.
能力评估
Purpose & Capability
Name and description (gene exon/intron visualization with optional domain/mutation overlays) match the included script and SKILL.md. Required operations (Ensembl REST lookup, optional UniProt/EBI features fetch, matplotlib drawing, caching) are appropriate and expected for this functionality.
Instruction Scope
SKILL.md and scripts/main.py stick to the declared task. The runtime instructions and script fetch data from Ensembl and EBI Proteins APIs, cache responses to .cache/{gene}_ensembl.json, and write image output — all coherent with the stated purpose. Note: the skill performs network I/O and file writes (cache + generated figures); these are expected but worth being aware of.
Install Mechanism
No install specification is provided and no external installers are pulled. The skill is delivered as source (Python script) that uses standard libraries plus requests and matplotlib; nothing is downloaded during installation beyond normal runtime network calls to data APIs.
Credentials
The skill requests no environment variables, no credentials, and no unusual config paths. Network access to public Ensembl and EBI endpoints is required for live runs; the --demo mode avoids network use. No secrets/external credentials are asked for or embedded.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges. It writes its own cache file under .cache/ and output files as requested — behavior appropriate for a data-caching visualization tool. It does not modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gene-structure-mapper
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gene-structure-mapper 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
- Initial public release (v0.1.0) of gene-structure-mapper. - Visualizes gene structures from a gene symbol using Ensembl API. - Supports exon-intron diagrams, optional UniProt domain overlays (--domains), and mutation marker positions (--mutations). - Outputs publication-ready SVG, PNG, or PDF figures. - Includes demo mode (--demo) using TP53 without internet and implements API response caching. - Comprehensive error handling, scope limits, and fallback procedures provided in documentation.
元数据
Slug gene-structure-mapper
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gene Structure Mapper 是什么?

Visualize gene structure with exon-intron diagrams, domain annotations, and mutation position markers. Produces SVG, PNG, or PDF figures suitable for publica... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 183 次。

如何安装 Gene Structure Mapper?

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

Gene Structure Mapper 是免费的吗?

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

Gene Structure Mapper 支持哪些平台?

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

谁开发了 Gene Structure Mapper?

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

💬 留言讨论