agentleFS
fmschulzfmschulz/omics-skills/skills/bio-prefect-dask-nextflow/SKILL.md

bio-prefect-dask-nextflow

Skill9 starsChanged 4 months agoMITView on GitHub

Choose and scaffold Prefect+Dask or Nextflow pipelines. Use when designing a local, distributed, or Slurm-backed bioinformatics workflow.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Run heavy work through the scheduler, never on a login node.

    line 18

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bio Prefect + Dask + Nextflow

Choose a workflow engine for a local, distributed, or HPC bioinformatics pipeline and scaffold it.

Supplementary docs last verified: 2026-10-01 against Prefect 3.8.7, prefect-dask 0.3.7 (maintained in the Prefect repository; install with prefect[dask]), Dask/distributed 2026.8.0, and Nextflow v26.04.6.

Instructions

  1. Collect requirements: scheduler, container policy, data location, scale, and whether steps are CLI tools or Python functions.
  2. Choose the engine with decision-matrix.md: Nextflow for file-based CLI tools on a scheduler, Prefect+Dask for Python-heavy or dynamic work, or a hybrid with Prefect as the control plane and Nextflow as the compute plane.
  3. Generate a runnable scaffold with a clear data layout, per-step resources, and explicit thread counts (task.cpus in Nextflow, threads_per_worker in Dask).
  4. Pin the software: pixi for tool stacks or Apptainer images on HPC, uv for Python (uv add "prefect[dask]"). Nextflow v26.04+ parses scripts and configs with the strict syntax by default; write code that passes nextflow lint.
  5. Run heavy work through the scheduler, never on a login node. Submit the Nextflow launcher with scripts/submit_nextflow.sh; it runs from the current directory, so call it from the project root.
  6. Validate with a small test dataset, then check resume (-resume, or Prefect retries plus idempotent outputs) before scaling.

Quick Reference

TaskAction
Engine choicedecision-matrix.md
Prefect+Dask scaffoldprefect-dask.md
Prefect on Slurmprefect-hpc-slurm.md
Nextflow on HPCnextflow-hpc.md
Submit Nextflow through SlurmSLURM_ACCOUNT=... scripts/submit_nextflow.sh main.nf 'data/*.fastq.gz' results
Multi-cluster sitesExport SBATCH_CLUSTERS, SBATCH_PARTITION, and SBATCH_QOS before the wrapper; --parsable then prints jobid;cluster, so strip the suffix and pass the cluster to squeue -M and sacct -M
Examplesexamples.md

Input Requirements

  • Workflow requirements and steps
  • Target environment (local, cluster, cloud)
  • Scheduler, account, partition, and container constraints
  • Data locations and expected volumes

Output

  • Engine recommendation with rationale
  • Runnable scaffold (files and commands)
  • Resource plan per step (CPUs, memory, walltime)
  • Validation plan and checkpoints

Quality Gates

  • A tiny test run completes end-to-end through the same launcher used for production.
  • Resume and retry behavior is verified; Prefect and Nextflow retries are not stacked without a stated policy.
  • The resource plan matches the cluster's limits, and every tool receives an explicit thread count.
  • Temporary Dask clusters are created by the task runner at flow runtime and closed with the flow.
  • Compound FASTQ suffixes (.fastq.gz) do not leak into sample output names.
  • The Nextflow launch runs through sbatch and verifies the trace file and non-empty result artifacts.

Examples

Example 1: Engine recommendation

Choice: Nextflow
Why: CLI-heavy pipeline, HPC scheduler required, reproducible cache/resume needed.

Troubleshooting

Issue: Workflow fails on HPC because of an environment mismatch Solution: Pin the tool stack (pixi lockfile or Apptainer image) and validate with a minimal test dataset on a compute node.

Issue: Nextflow v26.04+ rejects a script or config that ran on an older version Solution: The strict parser is now the default. Fix the reported pattern (see the Nextflow strict-syntax migration guide), or set NXF_SYNTAX_PARSER=v1 as a temporary workaround and record it.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.