DSL2 Coding guidelines and best practices
Disclaimer
- We're trying to forge the best practices
- Syntax and/or logic might (and probably will) evolve
- Add them
- It's useful for:
- π future you π
- your collaborators
- whoever will look at your code at any point
How, if and when to use if
and when
to control modules
- Use
if
logic in the main workflow
- or even better
branch
, which follows the data flow paradigm
- All subworkflows should be simpler and have no need for such logic
- Use
when
in modules.config
to control modules
- Expect if too many empty process thant clutter the terminal
- Then ok to use
if
Channel Assignment
-
Use explicit channel assignment rather than .set{}
for readability. E.g.,
is easier to identify input/output than
Collect files to use in a process
Error messages
Naming conventions
- Channel variables should start with
ch_
snake_case
for variables
Add CI Tests