Chapter 7: Development workflow
This chapter outlines the workflow for contributing to the nf-core/modules repository.
This training used a fork of that repository, but you can apply everything you have learnt to your own private module repository or to local modules inside a pipeline. The nf-core community encourages you to contribute modules upstream so others can benefit.
Check
Before writing a module, check that someone has not already built it or started on it:
- Search the modules page on the nf-core website.
- Search open pull requests on the nf-core/modules repository.
- Search open issues on the nf-core/modules repository.
Based on what you find:
- Module exists: skip the writing and install it into your pipeline.
- Open PR: offer to help out, or take over if development has stalled.
- Open issue: assign yourself, or ask the current assignee if they want help.
- Nothing yet: open an issue to signal you are working on it.
Once you claim a module, fork and clone the repository, create a new branch, and follow the previous chapters to write and test the module.
Write
Generate the boilerplate template files:
nf-core modules create <toolname>/<subcommand>Fill in each file by following the TODO comments, the nf-core module specifications, and this training material.
Test
Run the tests and generate the snapshot:
nf-core modules test <toolname>/<subcommand>Check the snapshot file looks correct before moving on.
Lint
Standardisation is central to nf-core. The linting tool flags issues before submission:
nf-core modules lint <toolname>/<subcommand>The console output lists any issues to fix. Some issues can be auto-fixed with --fix, in which case the linter prints the command to run.
Check each fix carefully. The linter may add empty sections that you still need to populate.
Linting is optional for private custom modules, but still recommended to catch small issues.
The linter cannot check every aspect of the nf-core module specification. Review the specification yourself before submission.
Submit
Commit and push your module to your fork:
git commit -am "Add new module <toolname>/<subcommand>"
git pushOpen a pull request from your fork and branch to the nf-core/modules repository.
To attract a reviewer, ask in the nf-core Slack #request-review channel. See the join instructions if you are not already on Slack.
If a reviewer asks for changes, do not close the PR. Push updates to the same branch, then request another review.
Once the PR is approved, merge it and the module is available to everyone.
If you get stuck, ask on the #modules channel or the #nostupidquestions channel.
Thank you for contributing to the community.
The final chapter covers how to use modules in your own pipelines.