[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75KF94GB7EPJ8CNH8M3HWD7":3,"skill-same:01M75KF94GB7EPJ8CNH8M3HWD7":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M75KF94GB7EPJ8CNH8M3HWD7","snakemake-workflow-engine",null,"Python-based workflow manager for reproducible, scalable pipelines. Define rules with file-based dependencies; Snakemake resolves execution order and parallelism. Runs local, SLURM, LSF, AWS, GCP via profiles; per-rule conda\u002FSingularity envs. For NGS pipelines, ML training, and multi-step file processing. Use Nextflow for Groovy dataflow or nf-core integration.","pradyumnasagar\u002Fopen-research-skills","pradyumnasagar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10559871?v=4","01M75K78MYCCVKRTYGT8KKC380","Pradyumna Jayaram","01M75K78NTNE41F2PE1XBVFHAS",8,"MIT","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdata-engineering\u002Fsnakemake-workflow-engine\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\n\nname: snakemake-workflow-engine\ndescription: \"Python-based workflow manager for reproducible, scalable pipelines. Define rules with file-based dependencies; Snakemake resolves execution order and parallelism. Runs local, SLURM, LSF, AWS, GCP via profiles; per-rule conda\u002FSingularity envs. For NGS pipelines, ML training, and multi-step file processing. Use Nextflow for Groovy dataflow or nf-core integration.\"\nlicense: MIT\n---\n\u003C!-- metadata:\n  category: data-engineering\n  oversight: low\n  version: 1.0.0\n  author: Pradyumna Jayaram\n  tags: [data-engineering, research]\n  difficulty: intermediate\n-->\n\n# Snakemake Workflow Engine\n\n## Hard rules\n\n1. **No fabricated citations.** Every cited work must resolve to a verifiable\n   record (DOI, PMID, arXiv ID, ISBN, URL with retrieval date, or stable\n   identifier). If a source cannot be resolved, the skill must say so\n   explicitly rather than presenting the claim as established.\n2. **No claim without provenance.** Every quantitative or factual claim\n   must point to a file, line, table, figure, dataset, or external source\n   the agent can show. \"Trust me\" is not provenance.\n3. **No silent failure.** Every script invocation, API call, or tool use\n   must declare its exit status and what to do on non-zero. A skill that\n   silently swallows errors is a violation.\n\n## When to use\n\n- Building reproducible multi-step data pipelines (FASTQ → BAM → variants → annotation).\n- Scaling the same workflow from local development to a SLURM cluster without code changes.\n- Processing many samples identically using wildcard-based rules (`{sample}`).\n- Managing dependencies automatically — only re-run steps whose inputs changed.\n- Pinning tool versions per rule (Conda, pixi, or container) for full reproducibility.\n- Producing DAG visualisations and dry-run previews before committing compute.\n- Reusing validated community modules via `Snakemake Wrappers` and `snakemake-workflow-catalog`.\n\n## When NOT to use\n\n- The task graph is **dynamic** (fan-out from a database) or **time-scheduled** → use **Airflow** or **Prefect**.\n- The pipeline is **single tool, single output** → a shell script is simpler.\n- You need **containerised, cloud-native, Groovy dataflow** → use **Nextflow** (and `nf-core`).\n- You need **CWL\u002FWDL** standards compliance (clinical genomics, GA4GH) → use **cwltool** or **Cromwell\u002FWDL**.\n\n## Prerequisites\n\n- Python ≥ 3.11\n- `snakemake ≥ 8.x` (check `command -v snakemake` first)\n- `graphviz` (for `--dag` visualisation)\n- Conda\u002Fmamba, **pixi**, or Apptainer for per-rule environments\n- SLURM\u002FLSF\u002FPBS for HPC execution\n\n```bash\nconda install -c conda-forge -c bioconda snakemake\n# or: pip install snakemake\nsnakemake --version          # 8.x.x\n```\n\n## Core workflow\n\n1. **Declare a target `rule all`** with the final outputs you want to produce.\n2. **Write rules** mapping input files → output files via a `shell:`, `run:`, or `script:` block.\n3. **Use wildcards** (`{sample}`) for sample-agnostic rules and `expand()` to materialise the target list.\n4. **Add resources** (`mem_mb`, `runtime`, `threads`) to compute-heavy rules.\n5. **Pin environments** with `conda:`, `container:`, or `pixi:` per rule.\n6. **Dry-run** with `snakemake -n` to confirm the DAG.\n7. **Execute** with a profile (`--profile profiles\u002Fslurm`) for HPC\u002Fcloud.\n\n## Code patterns\n\n### Minimal two-rule pipeline\n\n```python\n# Snakefile\nSAMPLES = [\"sampleA\", \"sampleB\"]\n\nrule all:\n    input:\n        expand(\"results\u002F{sample}.sorted.bam\", sample=SAMPLES)\n\nrule align:\n    input:\n        fastq=\"data\u002F{sample}.fastq\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        bam=\"results\u002F{sample}.sorted.bam\"\n    threads: 4\n    shell:\n        \"bwa mem -t {threads} {input.ref} {input.fastq} \"\n        \"| samtools sort -@ {threads} -o {output.bam}\"\n```\n\n```bash\nsnakemake -n            # dry-run\nsnakemake --cores 8     # execute\n```\n\n### Wildcard constraints + multi-extension output\n\n```python\nrule process:\n    input:\n        \"data\u002F{sample}_{rep}.fastq\"\n    output:\n        \"results\u002F{sample}_{rep}.txt\"\n    wildcard_constraints:\n        sample=\"[A-Za-z]+\",\n        rep=\"\\d+\"\n\nrule bwa_index:\n    input:  \"refs\u002Fgenome.fa\"\n    output: multiext(\"refs\u002Fgenome.fa\", \".amb\", \".ann\", \".bwt\", \".pac\", \".sa\")\n    shell:  \"bwa index {input}\"\n```\n\n### Externalise configuration\n\n```python\n# config\u002Fconfig.yaml\n# samples: [ctrl, treat]\n# threads: {align: 8, sort: 4}\n# min_mapq: 20\n\nconfigfile: \"config\u002Fconfig.yaml\"\nSAMPLES = config[\"samples\"]\n\nrule filter_reads:\n    input:  \"results\u002F{sample}.bam\"\n    output: \"results\u002F{sample}.filtered.bam\"\n    params: mapq=config[\"min_mapq\"]\n    threads: config[\"threads\"][\"sort\"]\n    shell:  \"samtools view -q {params.mapq} -b {input} > {output}\"\n```\n\n### Per-rule resources (drives SLURM\u002FLSF profiles)\n\n```python\nrule variant_calling:\n    input:\n        bam=\"results\u002F{sample}.deduped.bam\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        vcf=\"variants\u002F{sample}.vcf.gz\"\n    resources:\n        mem_mb=16000,\n        runtime=240,\n        disk_mb=20000\n    threads: 8\n    shell:\n        \"bcftools mpileup -f {input.ref} {input.bam} \"\n        \"| bcftools call -m -Oz -o {output.vcf}\"\n```\n\n### Per-rule Conda environment\n\n```python\nrule star_align:\n    input:\n        reads=\"data\u002F{sample}.fastq\",\n        genome_dir=\"refs\u002Fstar_index\u002F\"\n    output:\n        bam=\"star_out\u002F{sample}\u002FAligned.sortedByCoord.out.bam\"\n    conda:  \"envs\u002Fstar.yaml\"\n    threads: 8\n    shell:\n        \"STAR --runThreadN {threads} --genomeDir {input.genome_dir} \"\n        \"--readFilesIn {input.reads} --outSAMtype BAM SortedByCoordinate\"\n```\n\n### Per-rule container (Docker\u002FApptainer)\n\n```python\nrule gatk_haplotypecaller:\n    input:\n        bam=\"results\u002F{sample}.bam\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        gvcf=\"gvcfs\u002F{sample}.g.vcf.gz\"\n    container: \"docker:\u002F\u002Fbroadinstitute\u002Fgatk:4.4.0.0\"\n    shell:\n        \"gatk HaplotypeCaller -I {input.bam} -R {input.ref} \"\n        \"-O {output.gvcf} -ERC GVCF\"\n```\n\n### Reusable modules via `configfile` includes\n\n```python\n# Snakefile\nmodule qc:\n    snakefile: \"modules\u002Fqc\u002FSnakefile\"\n    config: config\n\nuse rule * from qc as qc_*\n```\n\n### Run as a module (publish to PyPI \u002F share across projects)\n\n```python\n# workflow\u002FSnakefile — exported as `my_pipeline`\nconfigfile: \"config.yaml\"\nSAMPLES = config[\"samples\"]\n\nrule all:\n    input: expand(\"out\u002F{sample}.bam\", sample=SAMPLES)\n\nrule align:\n    input:  \"in\u002F{sample}.fastq\"\n    output: \"out\u002F{sample}.bam\"\n    shell:  \"bwa mem refs\u002Fgenome.fa {input} | samtools view -b > {output}\"\n```\n\n```bash\nsnakemake --module workdir my_pipeline       # install\n# In another Snakefile:\n# module my_pipeline:\n#     snakefile: \"workflow\u002FSnakefile\"\n```\n\n### Special output types\n\n```python\nrule sort_bam:\n    input:  \"results\u002F{sample}.raw.bam\"\n    output: temp(\"results\u002F{sample}.sorted_temp.bam\")  # auto-deleted after consumers run\n    shell:  \"samtools sort {input} -o {output}\"\n\nrule final_report:\n    input:  \"results\u002F{sample}.vcf.gz\"\n    output: protected(\"reports\u002F{sample}.final.vcf.gz\")  # write-protected\n    shell:  \"cp {input} {output}\"\n\nrule validate_bam:\n    input:  \"results\u002F{sample}.bam\"\n    output: touch(\"checkpoints\u002F{sample}.validated\")  # empty flag\n    shell:  \"samtools quickcheck {input} && echo OK\"\n```\n\n### Auto-discover samples from disk\n\n```python\nfrom pathlib import Path\nSAMPLES = sorted(p.stem.replace(\".fastq\", \"\") for p in Path(\"data\u002F\").glob(\"*.fastq\"))\n\nrule all:\n    input: expand(\"results\u002F{sample}.bam\", sample=SAMPLES)\n```\n\n### Aggregation rule across all samples\n\n```python\nrule multiqc:\n    input:\n        expand(\"qc\u002F{sample}_fastqc.zip\", sample=SAMPLES),\n        expand(\"results\u002F{sample}.flagstat.txt\", sample=SAMPLES)\n    output:\n        \"multiqc\u002Fmultiqc_report.html\"\n    shell:  \"multiqc qc\u002F results\u002F -o multiqc\u002F\"\n```\n\n## SLURM profile (the high-value step)\n\n```bash\nmkdir -p profiles\u002Fslurm\ncat > profiles\u002Fslurm\u002Fconfig.yaml \u003C\u003C'EOF'\nexecutor: slurm\njobs: 100\ndefault-resources:\n  mem_mb: 4000\n  runtime: 60\nuse-conda: true\nuse-apptainer: true\nlatency-wait: 30\nrerun-incomplete: true\nEOF\n\nsnakemake --profile profiles\u002Fslurm --cores 256 -n        # dry-run\nsnakemake --profile profiles\u002Fslurm --cores 256         # submit\nsnakemake --profile profiles\u002Fslurm --report report.html # post-run HTML report\n```\n\n## Common pitfalls\n\n- **No `rule all`** → Snakemake only runs the first rule. Always declare your final targets.\n- **Ambiguous wildcards** (`AmbiguousRuleException`) → add `wildcard_constraints:` or use `ruleorder`.\n- **Missing outputs** (`MissingOutputException`) → check the rule's `shell:` cwd and that all output paths are created.\n- **Cluster jobs OOM or timeout** → increase `mem_mb` \u002F `runtime`; check `benchmark:` to measure real use.\n- **Conda env build fails** → add `conda-forge` before `bioconda`, pin versions.\n- **Re-running unexpectedly** → output mtime older than input; `snakemake --touch` or delete and re-run.\n- **Protected output can't be overwritten** → remove the file or drop `protected()`.\n\n## Validation\n\n- `snakemake -n` → dry-run shows the expected DAG; run before every production launch.\n- `snakemake --dag | dot -Tpdf > workflow_dag.pdf` → visualise the DAG.\n- `snakemake --report report.html` → post-run HTML with stats per rule.\n- Per-rule `benchmark: \"benchmarks\u002F{rule}\u002F{sample}.txt\"` → real runtime and memory.\n\n## Open alternatives\n\n| Need | Tool |\n|------|------|\n| Groovy dataflow, container-native, cloud-first | **Nextflow** (DSL2, nf-core) |\n| CWL\u002FWDL standards (clinical, GA4GH) | **cwltool**, **Cromwell\u002FWDL** |\n| Dynamic fan-out from a database | **Airflow**, **Prefect**, **Dagster** |\n| Self-contained tool version per step | **pixi** (`pixi:` directive in v8+) |\n| Container engines | **Apptainer** (replaces Singularity on HPC) |\n\n## References\n\n- Snakemake docs: \u003Chttps:\u002F\u002Fsnakemake.readthedocs.io\u002F>\n- Snakemake paper: Mölder et al. 2021, *F1000Research* 10:33, `10.12688\u002Ff1000research.29032.2`\n- Snakemake workflow catalog: \u003Chttps:\u002F\u002Fsnakemake.github.io\u002Fsnakemake-workflow-catalog\u002F>\n- nf-core (parallel Nextflow ecosystem): \u003Chttps:\u002F\u002Fnf-co.re\u002F>\n- Companion skill: `ors-data-engineering-nextflow-workflow-engine`\n- Companion skill: `ors-data-engineering-fair-data-principles` (DVC integration)\n\n## Changelog\n\n- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram from `snakemake-workflow-engine` (SciAgent-Skills-main\u002Fscientific-computing\u002Fsnakemake-workflow-engine).\n\n## Cross-references\n\n_No related skills in this category yet. \nAdd sibling skills as they are created in this category. \nUniversal research-workflow skills live under `meta\u002F`._\n","\u003C!-- metadata:\n  category: data-engineering\n  oversight: low\n  version: 1.0.0\n  author: Pradyumna Jayaram\n  tags: [data-engineering, research]\n  difficulty: intermediate\n-->\n\n# Snakemake Workflow Engine\n\n## Hard rules\n\n1. **No fabricated citations.** Every cited work must resolve to a verifiable\n   record (DOI, PMID, arXiv ID, ISBN, URL with retrieval date, or stable\n   identifier). If a source cannot be resolved, the skill must say so\n   explicitly rather than presenting the claim as established.\n2. **No claim without provenance.** Every quantitative or factual claim\n   must point to a file, line, table, figure, dataset, or external source\n   the agent can show. \"Trust me\" is not provenance.\n3. **No silent failure.** Every script invocation, API call, or tool use\n   must declare its exit status and what to do on non-zero. A skill that\n   silently swallows errors is a violation.\n\n## When to use\n\n- Building reproducible multi-step data pipelines (FASTQ → BAM → variants → annotation).\n- Scaling the same workflow from local development to a SLURM cluster without code changes.\n- Processing many samples identically using wildcard-based rules (`{sample}`).\n- Managing dependencies automatically — only re-run steps whose inputs changed.\n- Pinning tool versions per rule (Conda, pixi, or container) for full reproducibility.\n- Producing DAG visualisations and dry-run previews before committing compute.\n- Reusing validated community modules via `Snakemake Wrappers` and `snakemake-workflow-catalog`.\n\n## When NOT to use\n\n- The task graph is **dynamic** (fan-out from a database) or **time-scheduled** → use **Airflow** or **Prefect**.\n- The pipeline is **single tool, single output** → a shell script is simpler.\n- You need **containerised, cloud-native, Groovy dataflow** → use **Nextflow** (and `nf-core`).\n- You need **CWL\u002FWDL** standards compliance (clinical genomics, GA4GH) → use **cwltool** or **Cromwell\u002FWDL**.\n\n## Prerequisites\n\n- Python ≥ 3.11\n- `snakemake ≥ 8.x` (check `command -v snakemake` first)\n- `graphviz` (for `--dag` visualisation)\n- Conda\u002Fmamba, **pixi**, or Apptainer for per-rule environments\n- SLURM\u002FLSF\u002FPBS for HPC execution\n\n```bash\nconda install -c conda-forge -c bioconda snakemake\n# or: pip install snakemake\nsnakemake --version          # 8.x.x\n```\n\n## Core workflow\n\n1. **Declare a target `rule all`** with the final outputs you want to produce.\n2. **Write rules** mapping input files → output files via a `shell:`, `run:`, or `script:` block.\n3. **Use wildcards** (`{sample}`) for sample-agnostic rules and `expand()` to materialise the target list.\n4. **Add resources** (`mem_mb`, `runtime`, `threads`) to compute-heavy rules.\n5. **Pin environments** with `conda:`, `container:`, or `pixi:` per rule.\n6. **Dry-run** with `snakemake -n` to confirm the DAG.\n7. **Execute** with a profile (`--profile profiles\u002Fslurm`) for HPC\u002Fcloud.\n\n## Code patterns\n\n### Minimal two-rule pipeline\n\n```python\n# Snakefile\nSAMPLES = [\"sampleA\", \"sampleB\"]\n\nrule all:\n    input:\n        expand(\"results\u002F{sample}.sorted.bam\", sample=SAMPLES)\n\nrule align:\n    input:\n        fastq=\"data\u002F{sample}.fastq\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        bam=\"results\u002F{sample}.sorted.bam\"\n    threads: 4\n    shell:\n        \"bwa mem -t {threads} {input.ref} {input.fastq} \"\n        \"| samtools sort -@ {threads} -o {output.bam}\"\n```\n\n```bash\nsnakemake -n            # dry-run\nsnakemake --cores 8     # execute\n```\n\n### Wildcard constraints + multi-extension output\n\n```python\nrule process:\n    input:\n        \"data\u002F{sample}_{rep}.fastq\"\n    output:\n        \"results\u002F{sample}_{rep}.txt\"\n    wildcard_constraints:\n        sample=\"[A-Za-z]+\",\n        rep=\"\\d+\"\n\nrule bwa_index:\n    input:  \"refs\u002Fgenome.fa\"\n    output: multiext(\"refs\u002Fgenome.fa\", \".amb\", \".ann\", \".bwt\", \".pac\", \".sa\")\n    shell:  \"bwa index {input}\"\n```\n\n### Externalise configuration\n\n```python\n# config\u002Fconfig.yaml\n# samples: [ctrl, treat]\n# threads: {align: 8, sort: 4}\n# min_mapq: 20\n\nconfigfile: \"config\u002Fconfig.yaml\"\nSAMPLES = config[\"samples\"]\n\nrule filter_reads:\n    input:  \"results\u002F{sample}.bam\"\n    output: \"results\u002F{sample}.filtered.bam\"\n    params: mapq=config[\"min_mapq\"]\n    threads: config[\"threads\"][\"sort\"]\n    shell:  \"samtools view -q {params.mapq} -b {input} > {output}\"\n```\n\n### Per-rule resources (drives SLURM\u002FLSF profiles)\n\n```python\nrule variant_calling:\n    input:\n        bam=\"results\u002F{sample}.deduped.bam\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        vcf=\"variants\u002F{sample}.vcf.gz\"\n    resources:\n        mem_mb=16000,\n        runtime=240,\n        disk_mb=20000\n    threads: 8\n    shell:\n        \"bcftools mpileup -f {input.ref} {input.bam} \"\n        \"| bcftools call -m -Oz -o {output.vcf}\"\n```\n\n### Per-rule Conda environment\n\n```python\nrule star_align:\n    input:\n        reads=\"data\u002F{sample}.fastq\",\n        genome_dir=\"refs\u002Fstar_index\u002F\"\n    output:\n        bam=\"star_out\u002F{sample}\u002FAligned.sortedByCoord.out.bam\"\n    conda:  \"envs\u002Fstar.yaml\"\n    threads: 8\n    shell:\n        \"STAR --runThreadN {threads} --genomeDir {input.genome_dir} \"\n        \"--readFilesIn {input.reads} --outSAMtype BAM SortedByCoordinate\"\n```\n\n### Per-rule container (Docker\u002FApptainer)\n\n```python\nrule gatk_haplotypecaller:\n    input:\n        bam=\"results\u002F{sample}.bam\",\n        ref=\"refs\u002Fgenome.fa\"\n    output:\n        gvcf=\"gvcfs\u002F{sample}.g.vcf.gz\"\n    container: \"docker:\u002F\u002Fbroadinstitute\u002Fgatk:4.4.0.0\"\n    shell:\n        \"gatk HaplotypeCaller -I {input.bam} -R {input.ref} \"\n        \"-O {output.gvcf} -ERC GVCF\"\n```\n\n### Reusable modules via `configfile` includes\n\n```python\n# Snakefile\nmodule qc:\n    snakefile: \"modules\u002Fqc\u002FSnakefile\"\n    config: config\n\nuse rule * from qc as qc_*\n```\n\n### Run as a module (publish to PyPI \u002F share across projects)\n\n```python\n# workflow\u002FSnakefile — exported as `my_pipeline`\nconfigfile: \"config.yaml\"\nSAMPLES = config[\"samples\"]\n\nrule all:\n    input: expand(\"out\u002F{sample}.bam\", sample=SAMPLES)\n\nrule align:\n    input:  \"in\u002F{sample}.fastq\"\n    output: \"out\u002F{sample}.bam\"\n    shell:  \"bwa mem refs\u002Fgenome.fa {input} | samtools view -b > {output}\"\n```\n\n```bash\nsnakemake --module workdir my_pipeline       # install\n# In another Snakefile:\n# module my_pipeline:\n#     snakefile: \"workflow\u002FSnakefile\"\n```\n\n### Special output types\n\n```python\nrule sort_bam:\n    input:  \"results\u002F{sample}.raw.bam\"\n    output: temp(\"results\u002F{sample}.sorted_temp.bam\")  # auto-deleted after consumers run\n    shell:  \"samtools sort {input} -o {output}\"\n\nrule final_report:\n    input:  \"results\u002F{sample}.vcf.gz\"\n    output: protected(\"reports\u002F{sample}.final.vcf.gz\")  # write-protected\n    shell:  \"cp {input} {output}\"\n\nrule validate_bam:\n    input:  \"results\u002F{sample}.bam\"\n    output: touch(\"checkpoints\u002F{sample}.validated\")  # empty flag\n    shell:  \"samtools quickcheck {input} && echo OK\"\n```\n\n### Auto-discover samples from disk\n\n```python\nfrom pathlib import Path\nSAMPLES = sorted(p.stem.replace(\".fastq\", \"\") for p in Path(\"data\u002F\").glob(\"*.fastq\"))\n\nrule all:\n    input: expand(\"results\u002F{sample}.bam\", sample=SAMPLES)\n```\n\n### Aggregation rule across all samples\n\n```python\nrule multiqc:\n    input:\n        expand(\"qc\u002F{sample}_fastqc.zip\", sample=SAMPLES),\n        expand(\"results\u002F{sample}.flagstat.txt\", sample=SAMPLES)\n    output:\n        \"multiqc\u002Fmultiqc_report.html\"\n    shell:  \"multiqc qc\u002F results\u002F -o multiqc\u002F\"\n```\n\n## SLURM profile (the high-value step)\n\n```bash\nmkdir -p profiles\u002Fslurm\ncat > profiles\u002Fslurm\u002Fconfig.yaml \u003C\u003C'EOF'\nexecutor: slurm\njobs: 100\ndefault-resources:\n  mem_mb: 4000\n  runtime: 60\nuse-conda: true\nuse-apptainer: true\nlatency-wait: 30\nrerun-incomplete: true\nEOF\n\nsnakemake --profile profiles\u002Fslurm --cores 256 -n        # dry-run\nsnakemake --profile profiles\u002Fslurm --cores 256         # submit\nsnakemake --profile profiles\u002Fslurm --report report.html # post-run HTML report\n```\n\n## Common pitfalls\n\n- **No `rule all`** → Snakemake only runs the first rule. Always declare your final targets.\n- **Ambiguous wildcards** (`AmbiguousRuleException`) → add `wildcard_constraints:` or use `ruleorder`.\n- **Missing outputs** (`MissingOutputException`) → check the rule's `shell:` cwd and that all output paths are created.\n- **Cluster jobs OOM or timeout** → increase `mem_mb` \u002F `runtime`; check `benchmark:` to measure real use.\n- **Conda env build fails** → add `conda-forge` before `bioconda`, pin versions.\n- **Re-running unexpectedly** → output mtime older than input; `snakemake --touch` or delete and re-run.\n- **Protected output can't be overwritten** → remove the file or drop `protected()`.\n\n## Validation\n\n- `snakemake -n` → dry-run shows the expected DAG; run before every production launch.\n- `snakemake --dag | dot -Tpdf > workflow_dag.pdf` → visualise the DAG.\n- `snakemake --report report.html` → post-run HTML with stats per rule.\n- Per-rule `benchmark: \"benchmarks\u002F{rule}\u002F{sample}.txt\"` → real runtime and memory.\n\n## Open alternatives\n\n| Need | Tool |\n|------|------|\n| Groovy dataflow, container-native, cloud-first | **Nextflow** (DSL2, nf-core) |\n| CWL\u002FWDL standards (clinical, GA4GH) | **cwltool**, **Cromwell\u002FWDL** |\n| Dynamic fan-out from a database | **Airflow**, **Prefect**, **Dagster** |\n| Self-contained tool version per step | **pixi** (`pixi:` directive in v8+) |\n| Container engines | **Apptainer** (replaces Singularity on HPC) |\n\n## References\n\n- Snakemake docs: \u003Chttps:\u002F\u002Fsnakemake.readthedocs.io\u002F>\n- Snakemake paper: Mölder et al. 2021, *F1000Research* 10:33, `10.12688\u002Ff1000research.29032.2`\n- Snakemake workflow catalog: \u003Chttps:\u002F\u002Fsnakemake.github.io\u002Fsnakemake-workflow-catalog\u002F>\n- nf-core (parallel Nextflow ecosystem): \u003Chttps:\u002F\u002Fnf-co.re\u002F>\n- Companion skill: `ors-data-engineering-nextflow-workflow-engine`\n- Companion skill: `ors-data-engineering-fair-data-principles` (DVC integration)\n\n## Changelog\n\n- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram from `snakemake-workflow-engine` (SciAgent-Skills-main\u002Fscientific-computing\u002Fsnakemake-workflow-engine).\n\n## Cross-references\n\n_No related skills in this category yet. \nAdd sibling skills as they are created in this category. \nUniversal research-workflow skills live under `meta\u002F`._\n",{"name":5,"license":15,"description":7},"main","9c0b41e2036cc5588c699f06e658ea6dc3b9685d","skills\u002Fdata-engineering\u002Fsnakemake-workflow-engine",2,"https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar","PhD Scholar,\r\nManipal School Of Life Sciences, Manipal\r\n #OpenSourceDeveloper #LifeSciences #ComputationalBiology","2026-10-30 01:30:52",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add pradyumnasagar\u002Fopen-research-skills --skill snakemake-workflow-engine",{"tool":38,"command":39},"bunx","bunx skills add pradyumnasagar\u002Fopen-research-skills --skill snakemake-workflow-engine",{"tool":41,"command":42},"pnpm","pnpm dlx skills add pradyumnasagar\u002Fopen-research-skills --skill snakemake-workflow-engine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fdata-engineering\u002Fsnakemake-workflow-engine\u002FSKILL.md",true,[],[47,54,60,67,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M75KTS5K9QNX8FQBTJW2GQSH","good-skill","A well-formed test fixture for the validation script.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M75KTR7FAT0MMMED2EGC9WZZ","BadSkill","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-skill\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M75KTN949EDF77GJDS8H6VR8","my-new-skill","One sentence (max 200 chars) — what the skill does and when to use it.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Ftemplate\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M75KTHTFS121SSF1Q5X2FXDA","thesis-structure","Use when planning or checking the architecture of a PhD \u002F MPhil thesis in the life sciences or bioinformatics — monograph vs article-based, chapter sequence, IMRaD-based chapters, abstract-to-conclusion flow, and the examiner expectations that the structure must meet.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-structure\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M75KTE3WKW46FXFHQ579H8YP","thesis-methods-reproducibility","Use when writing or checking the Methods, figures, data, and code of a bioinformatics \u002F microbiology \u002F life-science PhD thesis — the FAIR data, versioned code, report-generation, figure-and-table discipline, and the reproducibility expectations that examiners probe at viva.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-methods-reproducibility\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M75KTA033ZQCJY3DC8P5VQET","thesis-defense-viva","Use when preparing for the viva voce \u002F oral thesis defense — building the examiner's question set, rehearsing the presentation, and the pre-defense polish (slides, summary, the 'what if I'm stuck' responses) for a life-science or bioinformatics PhD.","https:\u002F\u002Fgithub.com\u002Fpradyumnasagar\u002Fopen-research-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthesis-writing\u002Fthesis-defense-viva\u002FSKILL.md",[],[]]