NextflowSnippets
This repository hosts a large collection of Nextflow snippets
Install / Use
/learn @mribeirodantas/NextflowSnippetsREADME
<img width=25 height=25 src="https://github.com/nextflow-io/trademark/blob/master/nextflow-icon-128x128.png?raw=true"> Nextflow Snippets
Snippet is a programming term for a small region of re-usable source code, machine code, or text, and Nextflow is both a Domain-Specific Language for writing data pipelines and a pipeline orchestrator. For more information about Nextflow, check the official site and documentation. For community training material, this link is a greaaaaaat place to start! :smiley:
This repository contains a collection of numerous solutions I have worked on throughout the past months as a Nextflow and nf-core Developer Advocate at Seqera Labs providing community support to numerous users around the world. I haven't saved all the snippets I created, but as I have now answered over 500 questions in this period, there are indeed quite a few I have kept when I found the solution interesting enough :satisfied:
List of snippets by category
Below, you'll find links to Markdown documents in this repository explaining the issue followed by the snippet that solves it.
Using Channel Operators and Factories
- Get first N elements from a channel
- Get last N elements from a channel
- Filter items within a list in tuples within your channels
- Filter tuples within your channel
- Flatten multiple-item tuple to 2-item tuple keeping key
- Recreate
countByoperator for channels consisting of single elements or tuples - Set operations with channels
- Filter output channel elements based on file size or file content
- Sort lexicographically paths in a list within a tuple
- Provide multiple paths from a channel as a string to a command
- Guarantee tuple structure in a channel
- Group based on two keys, sort based on another one
- Add ending condition to
watchPath
Misc
- Prepare assets without running the pipeline
- Organize output files according to some pattern, and organize everything else in a different path
- Capture multiple values provided with a pipeline parameter
- Query attributes of objects
- Piping with multiple processes at the same time
- Get the
publishDirpaths for a specific task - Request the maximum number of available CPU cores for a process
- Pass config settings as a command line argument instead of a config file
- Multiple instances of the same file provided to the same task
- Save configuration files used in a specific run
- Compose configurations in the
nextflow.configfile - Run some processes outside containers
- Run containers of specific processes without root access
Nextflow Patterns
If you're looking for more snippets, you can find plenty at Nextflow Patterns.
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
Security Score
Audited on Oct 1, 2025
