From dd0ba6b04385ab22bd1f3fddaf17cef6bdbc833a Mon Sep 17 00:00:00 2001 From: Christopher Hakkaart Date: Tue, 10 Dec 2024 11:04:14 +0100 Subject: [PATCH] Update sites/docs/src/content/docs/guidelines/components/modules.md Co-authored-by: James A. Fellows Yates --- .../src/content/docs/guidelines/components/modules.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sites/docs/src/content/docs/guidelines/components/modules.md b/sites/docs/src/content/docs/guidelines/components/modules.md index 53181dc722..46e8c9ba7c 100644 --- a/sites/docs/src/content/docs/guidelines/components/modules.md +++ b/sites/docs/src/content/docs/guidelines/components/modules.md @@ -326,17 +326,17 @@ Alternate suggestions include using `grep -c` to search for a valid string match ### Script inclusion -:::warning -You SHOULD NOT use [Nextflow module binaries](https://www.nextflow.io/docs/latest/module.html#module-binaries), as these are not fully portable across all execution contexts. +If a module's `script:` block contains a script rather than command invocations, regardless of the language (e.g., Bash, R, Python), and the content is more than approximately 20 lines, it MUST be provided through a [Nextflow module template](https://www.nextflow.io/docs/latest/module.html#module-templates). +Using module templates helps distinguish between changes made to the scientific logic within the script and those affecting the workflow-specific logic in the module. This separation improves the code's clarity and maintainability. + +:::note +We recommend use of Nextflow templates as they are the most portable method of the separate custom script execution across all execution contexts ::: :::note Where script content in a module becomes particularly extensive, we strongly encourage packaging and hosting the code externally and provisioning via Conda/Docker as a standalone tool(kit). ::: -If a module's `script:` block contains a script rather than command invocations, regardless of the language (e.g., Bash, R, Python), and the content is more than 20 lines, it MUST be provided through a [Nextflow module template](https://www.nextflow.io/docs/latest/module.html#module-templates). -Using module templates helps distinguish between changes made to the scientific logic within the script and those affecting the workflow-specific logic in the module. This separation improves the code's clarity and maintainability. - #### Inline script code If the script content is less than approximately 20 lines, the code MAY be embedded directly in the module without a dedicated template file. However, they should still follow the guidance content as with a template.