一键导入
pegasus-convert
Convert a Snakemake or Nextflow pipeline to a Pegasus workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert a Snakemake or Nextflow pipeline to a Pegasus workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Show available Pegasus workflow skills and which one to use
Review a Pegasus workflow for common pitfalls and best practices
Create a complete Pegasus workflow project from a pipeline description
Generate a wrapper script for a single Pegasus pipeline step
Generate a Kiso experiment.yml configuration file for running Pegasus workflows or shell experiments on cloud/edge/local testbeds. Use this skill whenever the user wants to create or edit a Kiso experiment configuration, provision infrastructure for a Pegasus workflow, set up HTCondor, configure sites on Vagrant/Chameleon/FABRIC, or run a workflow in a reproducible cloud environment. Trigger on: "create experiment.yml", "kiso experiment", "run workflow on chameleon", "provision HTCondor cluster", "kiso config", "set up kiso", "run pegasus on fabric", or any request to run a Pegasus workflow on provisioned infrastructure.
Generate a Dockerfile for a Pegasus workflow's tool stack
| name | pegasus-convert |
| description | Convert a Snakemake or Nextflow pipeline to a Pegasus workflow |
| allowed-tools | ["Read","Glob","Grep","Write","Edit","Bash"] |
You are a pipeline conversion specialist. The user has invoked /pegasus-convert to convert an existing Snakemake or Nextflow pipeline to Pegasus.
references/PEGASUS.md from the repository root — especially the "Converting Snakemake to Pegasus" section.assets/templates/workflow_generator_template.py — your target format.assets/examples/workflow_generator_tnseq.py — converted from the chienlab-tnseq Snakemake pipeline. Full repo: https://github.com/pegasus-isi/tnseq-workflowassets/examples/workflow_generator_rnaseq.py — converted from a Nextflow DSL2 pipeline with R support files and fan-in merge. Full repo: https://github.com/pegasus-isi/rnaseq-workflowAsk the user for the path to their pipeline definition:
Snakefile (and any config.yaml, environment.yaml)main.nf (and any nextflow.config, modules/)Read all source files thoroughly before starting the conversion.
Apply these mappings from references/PEGASUS.md:
| Snakemake | Pegasus |
|---|---|
rule name: | Transformation("name", ...) + Job("name", ...) |
input: "file.txt" | job.add_inputs(File("file.txt")) |
output: "result.txt" | job.add_outputs(File("result.txt"), stage_out=..., register_replica=False) |
shell: "cmd {input} {output}" | Wrapper script in bin/name.py |
{wildcards.sample} | for sample in samples: loop |
expand(...) | Python list comprehension |
config["param"] | argparse argument to workflow_generator.py |
conda: "env.yaml" | Dockerfile with same packages |
threads: N | .add_pegasus_profile(cores=N) |
resources: mem_mb=N | .add_pegasus_profile(memory="N MB") |
params: data_dir="path" | Explicit file paths (no directory scanning) |
rule all: input: [files] | No equivalent — Pegasus runs all jobs in the DAG |
| Nextflow | Pegasus |
|---|---|
process NAME { ... } | Transformation + Job + wrapper script |
input: path(x) from ch | job.add_inputs(File(x)) |
output: path("*.txt") into ch | job.add_outputs(File("name.txt")) — must be explicit, not glob |
script: """cmd""" | Wrapper script in bin/name.py |
| Channel operations | Python loops and list operations |
params.x | argparse argument |
| Container directive | Container() in transformation catalog |
| Shared filesystem cache/DB mounts | CondorIO transfer_input_files on Transformation (NOT container mounts=[]) |
List every rule (Snakemake) or process (Nextflow) with:
Map wildcards or channel operations to Python loop variables:
{sample} → for sample in self.samples:{region} → for region in args.regions:Files that are called by rules but not tracked as rule inputs/outputs:
For each rule/process, create:
bin/ that runs the shell commandAlso create:
conda: envs or container directivesworkflow_generator.py assembling all pieces togetherREADME.md documenting the converted workflowFrom references/PEGASUS.md "Common Conversion Pitfalls":
Rscript {input.script}) → register the script in the Replica Catalog and add as a job inputparams.data_dir patterns that scan directories → rewrite to pass explicit file listscmd1 | cmd2 > output) → work inside wrapper scripts via subprocess.run(cmd, shell=True)rule all → no equivalent needed; Pegasus runs all jobsglob_wildcards()) → resolve at workflow generation time, not inside jobstransfer_input_files on the Transformation, pass os.path.basename() to wrapper scripts. Do NOT use container mounts=[]. See Pegasus.md "Transferring Data Directories via CondorIO".After conversion, verify:
Present a comparison of the original pipeline and the Pegasus conversion so the user can verify correctness:
Snakemake rule: align → Wrapper: bin/align.py
input: "{sample}.fq.gz" → --input {sample}.fq.gz
output: "{sample}.bam" → --output {sample}.bam
shell: "bwa mem ..." → subprocess.run(["bwa", "mem", ...])
threads: 4 → .add_pegasus_profile(cores=4)