nextflow-implementor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNextflow Implementor Skill
Nextflow 开发者技能
Read and follow agent-conduct and nextflow-conventions before starting.
开始前请阅读并遵循agent-conduct和nextflow-conventions规范。
TDD Cycle
TDD 循环
For each acceptance test, follow every step:
- Write a failing nf-test in .
modules/local/<tool>/tests/main.nf.test - Run:
nf-test test modules/local/<tool>/tests/main.nf.test - Write minimal process/workflow to pass.
- Ensure the process emits with tool version(s).
versions.yml - Verify container is specified (prefer nf-core module, then Seqera Wave / BioContainers, then Docker Hub).
- Run: and fix issues.
nf-core pipelines lint - Re-run nf-test to confirm it passes.
针对每个验收测试,请遵循以下所有步骤:
- 在中编写一个会失败的nf-test测试用例。
modules/local/<tool>/tests/main.nf.test - 运行:
nf-test test modules/local/<tool>/tests/main.nf.test - 编写最小化的流程/工作流以通过测试。
- 确保流程输出包含工具版本信息的文件。
versions.yml - 确认已指定容器(优先使用nf-core模块,其次是Seqera Wave / BioContainers,最后是Docker Hub)。
- 运行:并修复问题。
nf-core pipelines lint - 重新运行nf-test以确认测试通过。
Module-per-Function Rule
单功能单模块规则
Split each tool/function into its own module under
with a corresponding . One process per file, one test file
per module.
modules/local/<tool>/main.nftests/main.nf.test将每个工具/功能拆分为独立模块,存放在,并对应编写测试文件。每个文件对应一个流程,每个模块对应一个测试文件。
modules/local/<tool>/main.nftests/main.nf.testnf-core Module Re-use
复用nf-core模块
Before creating a local module, check nf-core:
bash
nf-core modules list remote | grep <tool>If a suitable module exists, install it ()
instead of writing a local one. Only create local modules when no nf-core
module covers the requirement.
nf-core modules install <tool>在创建本地模块前,请先检查nf-core:
bash
nf-core modules list remote | grep <tool>如果存在合适的模块,使用安装它,而非编写本地模块。仅当没有nf-core模块满足需求时,才创建本地模块。
nf-core modules install <tool>Container Discovery
容器查找
For local modules without nf-core equivalents, find open-source containers:
- Search https://seqera.io/wave/ for the tool.
- Search https://biocontainers.pro/.
- Fall back to Docker Hub / Quay.io official images.
Specify both docker and singularity container paths.
对于没有对应nf-core模块的本地模块,查找开源容器的步骤:
- 在https://seqera.io/wave/搜索该工具。
- 在https://biocontainers.pro/搜索。
- 最后选择Docker Hub / Quay.io的官方镜像。
同时指定docker和singularity的容器路径。
Workflow
工作流
Implement ONE item at a time: write nf-tests for the spec.md acceptance
tests, then write implementation to make them pass, strictly following the
TDD cycle above. Consult spec.md for full details.
After all modules pass, ensure:
- has default params.
nextflow.config - has resource labels.
conf/base.config - has publishDir directives.
conf/modules.config - Profiles work: ,
docker,singularity.test - All versions collected into final .
versions.yml - and
docs/usage.mdare written for end-users.docs/output.md
一次实现一个任务:为spec.md中的验收测试编写nf-tests用例,然后编写实现代码使其通过测试,严格遵循上述TDD循环。详细信息请参考spec.md。
所有模块测试通过后,请确保:
- 包含默认参数。
nextflow.config - 包含资源标签。
conf/base.config - 包含publishDir指令。
conf/modules.config - 配置文件正常工作:、
docker、singularity。test - 所有版本信息已收集到最终的中。
versions.yml - 已为终端用户编写和
docs/usage.md文档。docs/output.md