galaxy-automation
БесплатноБез исполняемых скриптовНе проверенBioBlend and Planemo expertise for Galaxy workflow automation. Galaxy API usage, workflow invocation, status checking, error handling, batch processing, and…
от Delphine-L★ 23 звезды на GitHubОб этом скилле
Galaxy Workflow Automation with BioBlend and Planemo
Purpose
This skill provides expert knowledge for automating Galaxy workflows using BioBlend (Python Galaxy API library) and Planemo (Galaxy workflow testing and execution tool).
When to Use This Skill
Use this skill when:
- Automating Galaxy workflow execution via API
- Building batch processing systems for Galaxy
- Using BioBlend to interact with Galaxy
- Testing workflows with Planemo
- Managing Galaxy histories, datasets, and collections programmatically
- Polling workflow invocation status
- Implementing error handling and retry logic for Galaxy operations
- Creating Galaxy automation pipelines
- Integrating Galaxy into larger bioinformatics workflows
This skill is NOT project-specific - it's useful for ANY Galaxy automation project.
Supporting Files
Detailed reference material is split into separate files:
- bioblend-reference.md -- BioBlend API patterns: connection, history management, workflow invocation, status checking, error handling, rerun API, dataset operations, and collections
- planemo-reference.md -- Planemo command structure, job YAML format, programmatic command generation, output parsing, and Galaxy API curl/authentication patterns
- automation-patterns.md -- Thread-safe operations, batch processing, resume capability, and debugging (history inspection, invocation step analysis)
Security Best Practices
1. API Key Management
Store in environment variables:
import os
api_key = os.environ.get('GALAXY_API_KEY')
if not api_key:
raise ValueError("GALAXY_API_KEY environment variable not set")
gi = GalaxyInstance(url, api_key)
Mask in logs:
def mask_api_key(key):
"""Mask API key for display"""
if len(key) <= 8:
return '*' * len(key)
return f"{key[:4]}{'*' * (len(key) - 8)}{key[-4:]}"
masked_key = mask_api_key(api_key)
print(f"Using API key: {masked_key}")
2. Path Handling
Always quote paths in shell commands:
# Good - handles spaces
command = f'planemo run "{workflow_path}" "{job_yaml}"'
# Bad - breaks with spaces
command = f'planemo run {workflow_path} {job_yaml}'
Common Pitfalls
Planemo failures vs Galaxy failures
- Planemo return code != 0: Workflow was NOT launched, no invocation exists
- Invocation state = 'failed': Workflow was launched but Galaxy job failed
- Don't confuse these two failure modes
Concurrent uploads
- Too many simultaneous uploads can overwhelm Galaxy
- Use max_concurrent limits (typically 3-5)
- Consider
--simultaneous_uploadsvs sequential
Dataset state checking
- Don't invoke workflows before uploads complete
- Always wait for dataset state = 'ok'
History name conflicts
- Use unique history names (add timestamps or suffixes)
- Check for existing histories before creating
Return code interpretation
os.system()shifts exit codes (exit 1 -> return 256)- Use
return_code >> 8to get actual exit code
Invocation ID recovery
- Terminal disconnection loses invocation ID
- Always save invocation IDs to file immediately
- Use
--test_output_jsonwith planemo
CRITICAL: Admin API key sees ALL users' data
get_invocations()without filters returns EVERY user's invocations, not just yours- NEVER cancel/delete/modify invocations based on broad queries (e.g., "recent and still running")
- Always use specific invocation IDs from your own tool output (planemo prints
Invocation <hex_id>) - Before any destructive action, verify the history/invocation owner matches your user
- If you must query broadly, filter by a history ID you own
- Cancelled invocations are IRRECOVERABLE — there is no undo
Planemo test invocation tracking
- Planemo prints invocation IDs during test runs:
Invocation <52bc9f6134abd589> - When cancelling orphaned invocations from killed planemo tests, use ONLY these IDs
- Do NOT scan all server invocations and guess which are yours based on timing
- Planemo prints invocation IDs during test runs:
Best Practices Summary
- Use environment variables for API keys
- Mask API keys in logs and output
- Quote all file paths in shell commands
- Implement thread-safety for concurrent operations
- Save state frequently for resume capability
- Wait for dataset uploads before invoking workflows
- Poll invocation status with reasonable intervals (30-60s)
- Distinguish planemo failures from Galaxy failures
- Implement proper error handling and retry logic
- Use unique history names to avoid conflicts
Galaxy MCP Connection
When using the Galaxy MCP tools (mcp__Galaxy__*), connect at the start of each session.
Connection Pattern
MCP tools cannot read shell environment variables directly. The URL is safe to resolve via Bash:
echo "$GXYVGP" # Galaxy instance
Установить galaxy-automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл galaxy-automation?
BioBlend and Planemo expertise for Galaxy workflow automation. Galaxy API usage, workflow invocation, status checking, error handling, batch processing, and dataset management. Essential for any Galaxy automation project.
Как установить скилл galaxy-automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл galaxy-automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic