diff --git a/sites/docs/src/content/docs/guidelines/components/modules.md b/sites/docs/src/content/docs/guidelines/components/modules.md index d4d09b4c7e..cc142e95ab 100644 --- a/sites/docs/src/content/docs/guidelines/components/modules.md +++ b/sites/docs/src/content/docs/guidelines/components/modules.md @@ -390,13 +390,19 @@ Channel names MUST follow `snake_case` convention and be all lower case. Output file (and/or directory) names SHOULD just consist of only `${prefix}` and the file-format suffix (e.g. `${prefix}.fq.gz` or `${prefix}.bam`). - This is primarily for re-usability so that other developers have complete flexibility to name their output files however they wish when using the same module. -- As a result of using this syntax, if the module has the same named inputs and outputs then you can add a line in the `script` section like below (another example [here](https://github.com/nf-core/modules/blob/e20e57f90b6787ac9a010a980cf6ea98bd990046/modules/lima/main.nf#L37)) which will raise an error asking the developer to change the `args.prefix` variable to rename the output files so they don't clash. +- As a result of using this syntax, if the module could _potentially_ have the same named inputs and outputs add a line in the `script` section like below (another example [here](https://github.com/nf-core/modules/blob/e20e57f90b6787ac9a010a980cf6ea98bd990046/modules/lima/main.nf#L37)) which will raise an error asking the developer to change the `args.prefix` variable to rename the output files so they don't clash. ```nextflow script: if ("$bam" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!" ``` +- If the input and output files are likely to have the same name, then an appropriate default prefix may be set, for example: + + ```nextflow + def prefix = task.ext.prefix ?: "${meta.id}_sorted" + ``` + ## Input/output options ### Required `path` channel inputs