snakemake-workflow-engine
Skill8 starsChanged 5 months agoMITView on GitHub
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/Singularity envs. For NGS pipelines, ML training, and multi-step file processing. Use Nextflow for Groovy dataflow or nf-core integration.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- jaechang-hits/SciAgent-Skillsedited, first seen Jul 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- jaechang-hits/SciAgent-Skills★ 38618% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- batch-processingSkill
- bowtie2-alignmentSkill
- bwa-alignmentSkill
- bwa-mem2-alignmentSkill
- codon-usageSkill
- compressed-sequence-filesSkill
- fastq-quality-scoresSkill
- filter-sequencesSkill
- format-conversionSkill
- hisat2-alignmentSkill
- motif-searchSkill
- paired-end-fastqSkill
- pysam-genomicsSkill
- read-write-sequencesSkill
- reverse-complementSkill
- sam-bam-basicsSkill
- samtools-bam-processingSkill
- seq-objectsSkill
- sequence-propertiesSkill
- sequence-slicingSkill
- sequence-statisticsSkill
- star-alignmentSkill
- transcription-translationSkill
- academic-cvSkill
- faculty-interviewSkill
- fellowship-applicationSkill
- industry-transitionSkill
- negotiationSkill
- tenure-dossierSkill
- admet-predictionSkill
- conformer-generationSkill
- covalent-designSkill
- docking-rescoringSkill
- free-energy-calculationsSkill
- generative-designSkill
- molecular-descriptorsSkill
- molecular-ioSkill
- molecular-standardizationSkill
- pharmacophore-modelingSkill
- pose-validationSkill
- protac-degradersSkill
- qsar-modelingSkill
- retrosynthesisSkill
- scaffold-analysisSkill
- shape-similaritySkill
- similarity-searchingSkill
- substructure-searchSkill
- virtual-screeningSkill
- ai-disclosureSkill
- data-privacySkill
- image-integritySkill
- irb-protocolSkill
- ai-detection-awarenessSkill
- ai-disclosure-statementSkill
- scientific-voice-styleSkill
- text-humanizing-editorialSkill
- cellprofiler-pipelinesSkill
- image-analysis-best-practicesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
No fabricated citations: Every cited work must resolve to a verifiable record (DOI, PMID, arXiv ID, ISBN, URL with retrieval date, or …
- Distinctive: line 24
No claim without provenance: Every quantitative or factual claim must point to a file, line, table, figure, dataset, or external source the …
- Distinctive: line 27
No silent failure: Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero.
- Very specific: line 327
Add sibling skills as they are created in this category.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- metadata:
category: data-engineering
oversight: low
version: 1.0.0
author: Pradyumna Jayaram
tags: [data-engineering, research]
difficulty: intermediate
-->Snakemake Workflow Engine
Hard rules
- No fabricated citations. Every cited work must resolve to a verifiable record (DOI, PMID, arXiv ID, ISBN, URL with retrieval date, or stable identifier). If a source cannot be resolved, the skill must say so explicitly rather than presenting the claim as established.
- No claim without provenance. Every quantitative or factual claim must point to a file, line, table, figure, dataset, or external source the agent can show. "Trust me" is not provenance.
- No silent failure. Every script invocation, API call, or tool use must declare its exit status and what to do on non-zero. A skill that silently swallows errors is a violation.
When to use
- Building reproducible multi-step data pipelines (FASTQ → BAM → variants → annotation).
- Scaling the same workflow from local development to a SLURM cluster without code changes.
- Processing many samples identically using wildcard-based rules (
{sample}). - Managing dependencies automatically — only re-run steps whose inputs changed.
- Pinning tool versions per rule (Conda, pixi, or container) for full reproducibility.
- Producing DAG visualisations and dry-run previews before committing compute.
- Reusing validated community modules via
Snakemake Wrappersandsnakemake-workflow-catalog.
When NOT to use
- The task graph is dynamic (fan-out from a database) or time-scheduled → use Airflow or Prefect.
- The pipeline is single tool, single output → a shell script is simpler.
- You need containerised, cloud-native, Groovy dataflow → use Nextflow (and
nf-core). - You need CWL/WDL standards compliance (clinical genomics, GA4GH) → use cwltool or Cromwell/WDL.
Prerequisites
- Python ≥ 3.11
snakemake ≥ 8.x(checkcommand -v snakemakefirst)graphviz(for--dagvisualisation)- Conda/mamba, pixi, or Apptainer for per-rule environments
- SLURM/LSF/PBS for HPC execution
conda install -c conda-forge -c bioconda snakemake
# or: pip install snakemake
snakemake --version # 8.x.xCore workflow
- Declare a target
rule allwith the final outputs you want to produce. - Write rules mapping input files → output files via a
shell:,run:, orscript:block. - Use wildcards (
{sample}) for sample-agnostic rules andexpand()to materialise the target list. - Add resources (
mem_mb,runtime,threads) to compute-heavy rules. - Pin environments with
conda:,container:, orpixi:per rule. - Dry-run with
snakemake -nto confirm the DAG. - Execute with a profile (
--profile profiles/slurm) for HPC/cloud.
Code patterns
Minimal two-rule pipeline
# Snakefile
SAMPLES = ["sampleA", "sampleB"]
rule all:
input:
expand("results/{sample}.sorted.bam", sample=SAMPLES)
rule align:
input:
fastq="data/{sample}.fastq",
ref="refs/genome.fa"
output:
bam="results/{sample}.sorted.bam"
threads: 4
shell:
"bwa mem -t {threads} {input.ref} {input.fastq} "
"| samtools sort -@ {threads} -o {output.bam}"snakemake -n # dry-run
snakemake --cores 8 # executeWildcard constraints + multi-extension output
rule process:
input:
"data/{sample}_{rep}.fastq"
output:
"results/{sample}_{rep}.txt"
wildcard_constraints:
sample="[A-Za-z]+",
rep="\d+"
rule bwa_index:
input: "refs/genome.fa"
output: multiext("refs/genome.fa", ".amb", ".ann", ".bwt", ".pac", ".sa")
shell: "bwa index {input}"Externalise configuration
# config/config.yaml
# samples: [ctrl, treat]
# threads: {align: 8, sort: 4}
# min_mapq: 20
configfile: "config/config.yaml"
SAMPLES = config["samples"]
rule filter_reads:
input: "results/{sample}.bam"
output: "results/{sample}.filtered.bam"
params: mapq=config["min_mapq"]
threads: config["threads"]["sort"]
shell: "samtools view -q {params.mapq} -b {input} > {output}"Per-rule resources (drives SLURM/LSF profiles)
rule variant_calling:
input:
bam="results/{sample}.deduped.bam",
ref="refs/genome.fa"
output:
vcf="variants/{sample}.vcf.gz"
resources:
mem_mb=16000,
runtime=240,
disk_mb=20000
threads: 8
shell:
"bcftools mpileup -f {input.ref} {input.bam} "
"| bcftools call -m -Oz -o {output.vcf}"Per-rule Conda environment
rule star_align:
input:
reads="data/{sample}.fastq",
genome_dir="refs/star_index/"
output:
bam="star_out/{sample}/Aligned.sortedByCoord.out.bam"
conda: "envs/star.yaml"
threads: 8
shell:
"STAR --runThreadN {threads} --genomeDir {input.genome_dir} "
"--readFilesIn {input.reads} --outSAMtype BAM SortedByCoordinate"Per-rule container (Docker/Apptainer)
rule gatk_haplotypecaller:
input:
bam="results/{sample}.bam",
ref="refs/genome.fa"
output:
gvcf="gvcfs/{sample}.g.vcf.gz"
container: "docker://broadinstitute/gatk:4.4.0.0"
shell:
"gatk HaplotypeCaller -I {input.bam} -R {input.ref} "
"-O {output.gvcf} -ERC GVCF"Reusable modules via configfile includes
# Snakefile
module qc:
snakefile: "modules/qc/Snakefile"
config: config
use rule * from qc as qc_*Run as a module (publish to PyPI / share across projects)
# workflow/Snakefile — exported as `my_pipeline`
configfile: "config.yaml"
SAMPLES = config["samples"]
rule all:
input: expand("out/{sample}.bam", sample=SAMPLES)
rule align:
input: "in/{sample}.fastq"
output: "out/{sample}.bam"
shell: "bwa mem refs/genome.fa {input} | samtools view -b > {output}"snakemake --module workdir my_pipeline # install
# In another Snakefile:
# module my_pipeline:
# snakefile: "workflow/Snakefile"Special output types
rule sort_bam:
input: "results/{sample}.raw.bam"
output: temp("results/{sample}.sorted_temp.bam") # auto-deleted after consumers run
shell: "samtools sort {input} -o {output}"
rule final_report:
input: "results/{sample}.vcf.gz"
output: protected("reports/{sample}.final.vcf.gz") # write-protected
shell: "cp {input} {output}"
rule validate_bam:
input: "results/{sample}.bam"
output: touch("checkpoints/{sample}.validated") # empty flag
shell: "samtools quickcheck {input} && echo OK"Auto-discover samples from disk
from pathlib import Path
SAMPLES = sorted(p.stem.replace(".fastq", "") for p in Path("data/").glob("*.fastq"))
rule all:
input: expand("results/{sample}.bam", sample=SAMPLES)Aggregation rule across all samples
rule multiqc:
input:
expand("qc/{sample}_fastqc.zip", sample=SAMPLES),
expand("results/{sample}.flagstat.txt", sample=SAMPLES)
output:
"multiqc/multiqc_report.html"
shell: "multiqc qc/ results/ -o multiqc/"SLURM profile (the high-value step)
mkdir -p profiles/slurm
cat > profiles/slurm/config.yaml <<'EOF'
executor: slurm
jobs: 100
default-resources:
mem_mb: 4000
runtime: 60
use-conda: true
use-apptainer: true
latency-wait: 30
rerun-incomplete: true
EOF
snakemake --profile profiles/slurm --cores 256 -n # dry-run
snakemake --profile profiles/slurm --cores 256 # submit
snakemake --profile profiles/slurm --report report.html # post-run HTML reportCommon pitfalls
- No
rule all→ Snakemake only runs the first rule. Always declare your final targets. - Ambiguous wildcards (
AmbiguousRuleException) → addwildcard_constraints:or useruleorder. - Missing outputs (
MissingOutputException) → check the rule'sshell:cwd and that all output paths are created. - Cluster jobs OOM or timeout → increase
mem_mb/runtime; checkbenchmark:to measure real use. - Conda env build fails → add
conda-forgebeforebioconda, pin versions. - Re-running unexpectedly → output mtime older than input;
snakemake --touchor delete and re-run. - Protected output can't be overwritten → remove the file or drop
protected().
Validation
snakemake -n→ dry-run shows the expected DAG; run before every production launch.snakemake --dag | dot -Tpdf > workflow_dag.pdf→ visualise the DAG.snakemake --report report.html→ post-run HTML with stats per rule.- Per-rule
benchmark: "benchmarks/{rule}/{sample}.txt"→ real runtime and memory.
Open alternatives
| Need | Tool |
| Groovy dataflow, container-native, cloud-first | Nextflow (DSL2, nf-core) |
| CWL/WDL standards (clinical, GA4GH) | cwltool, Cromwell/WDL |
| Dynamic fan-out from a database | Airflow, Prefect, Dagster |
| Self-contained tool version per step | pixi (pixi: directive in v8+) |
| Container engines | Apptainer (replaces Singularity on HPC) |
References
- Snakemake docs: https://snakemake.readthedocs.io/
- Snakemake paper: Mölder et al. 2021, F1000Research 10:33,
10.12688/f1000research.29032.2 - Snakemake workflow catalog: https://snakemake.github.io/snakemake-workflow-catalog/
- nf-core (parallel Nextflow ecosystem): https://nf-co.re/
- Companion skill:
ors-data-engineering-nextflow-workflow-engine - Companion skill:
ors-data-engineering-fair-data-principles(DVC integration)
Changelog
- 1.0.0 (2026-06-10): Initial adaptation by Pradyumna Jayaram from
snakemake-workflow-engine(SciAgent-Skills-main/scientific-computing/snakemake-workflow-engine).
Cross-references
No related skills in this category yet.
Add sibling skills as they are created in this category.
Universal research-workflow skills live under meta/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

