You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace step labels and bold text with numbered headings in hello_nf-core
Convert all instances of step labels and bold text pseudo-headings to proper
numbered headings for consistency and better navigation.
Changes:
- 03_use_module.md: Convert 5 "Step X:" labels to numbered headings (1.9.1-1.9.5)
- 04_make_module.md: Number 15 subsection headings (1.2.1-1.2.6, 1.3.1-1.3.4, 2.1.1-2.1.2, 2.2.1-2.2.3)
- 05_input_validation.md: Convert 3 bold labels to numbered headings (2.2.1, 3.7.1-3.7.2)
and fix incorrectly numbered intro sections
Benefits:
- Consistent numbered heading structure throughout documentation
- All subsections appear in table of contents and sidebar navigation
- Sections can be directly linked with anchor links
- Easier to maintain with automated heading validation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
#### Step 4: Remove the legacy collectGreetings import
463
+
#### 1.9.4. Remove the legacy collectGreetings import
464
464
465
465
Since we're no longer using the `collectGreetings` module, remove its import statement from the top of the file:
466
466
@@ -497,7 +497,7 @@ Since we're no longer using the `collectGreetings` module, remove its import sta
497
497
include { CAT_CAT } from '../modules/nf-core/cat/cat/main'
498
498
```
499
499
500
-
#### Step 5: Update cowpy to use CAT_CAT output
500
+
#### 1.9.5. Update cowpy to use CAT_CAT output
501
501
502
502
Finally, update the `cowpy` call to use the output from `CAT_CAT`. Since `cowpy` doesn't accept metadata tuples yet (we'll fix this in the next section), we need to extract just the file:
Copy file name to clipboardExpand all lines: docs/hello_nf-core/04_make_module.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ Now let's address another nf-core pattern: simplifying module interfaces by usin
166
166
167
167
Currently, our `cowpy` module requires the `character` parameter to be passed as a separate input. While this works, nf-core modules use a different approach for **tool configuration arguments**: instead of adding input parameters for every tool option, they use `ext.args` to pass these via configuration. This keeps the module interface focused on essential data (files, metadata, and any mandatory per-sample parameters), while tool configuration options are handled through `ext.args`.
168
168
169
-
#### Understanding ext.args
169
+
#### 1.2.1. Understanding ext.args
170
170
171
171
The `task.ext.args` pattern is an nf-core convention for passing command-line arguments to tools through configuration rather than as process inputs. Instead of adding input parameters for tool options, nf-core modules accept arguments through the `ext.args` configuration directive.
172
172
@@ -182,7 +182,7 @@ Benefits of this approach:
182
182
-**Portability**: Modules can be reused without hardcoded tool options
Before we update the module to use `ext.args`, let's address an important nf-core convention: **modules should not contain hardcoded `publishDir` directives**.
188
188
@@ -211,7 +211,7 @@ Benefits of this approach:
211
211
-**Easy customization**: Override publishing behavior in config, not in module code
Now let's update the cowpy module to use `ext.args` and remove the local `publishDir`.
217
217
@@ -278,7 +278,7 @@ Key changes:
278
278
279
279
The module interface is now simpler - it only accepts the essential metadata and file inputs. By removing the local `publishDir`, we follow the nf-core convention of centralizing all publishing configuration in `modules.config`.
280
280
281
-
#### Configure ext.args
281
+
#### 1.2.4. Configure ext.args
282
282
283
283
Now we need to configure the `ext.args` to pass the character option. This allows us to keep the module interface simple while still providing the character option at the pipeline level.
284
284
@@ -321,7 +321,7 @@ Key points:
321
321
322
322
The `modules.config` file is where nf-core pipelines centralize per-module configuration. This separation of concerns makes modules more reusable across different pipelines.
323
323
324
-
#### Update the workflow
324
+
#### 1.2.5. Update the workflow
325
325
326
326
Since the cowpy module no longer requires the `character` parameter as an input, we need to update the workflow call.
327
327
@@ -343,7 +343,7 @@ Open `workflows/hello.nf` and update the cowpy call:
343
343
344
344
The workflow code is now cleaner - we don't need to pass `params.character` directly to the process. The module interface is kept minimal, making it more portable, while the pipeline still provides the explicit option through configuration.
345
345
346
-
#### Test
346
+
#### 1.2.6. Test
347
347
348
348
Test that the workflow still works with the ext.args configuration. Let's specify a different character to verify the configuration is working (using `kosh`, one of the more... enigmatic options):
There's one more nf-core pattern we can apply: using `ext.prefix` for configurable output file naming.
407
407
408
-
#### Understanding ext.prefix
408
+
#### 1.3.1. Understanding ext.prefix
409
409
410
410
The `task.ext.prefix` pattern is another nf-core convention for standardizing output file naming across modules while keeping it configurable.
411
411
@@ -416,7 +416,7 @@ Benefits:
416
416
-**Consistent**: All nf-core modules follow this pattern
417
417
-**Predictable**: Easy to know what output files will be called
418
418
419
-
#### Update the module
419
+
#### 1.3.2. Update the module
420
420
421
421
Let's update the cowpy module to use `ext.prefix` for output file naming.
422
422
@@ -481,7 +481,7 @@ Key changes:
481
481
482
482
Note that the local `publishDir` has already been removed in the previous step, so we're continuing with the centralized configuration approach.
483
483
484
-
#### Configure ext.prefix
484
+
#### 1.3.3. Configure ext.prefix
485
485
486
486
To maintain the same output file naming as before (`cowpy-<id>.txt`), we can configure `ext.prefix` in modules.config.
487
487
@@ -510,7 +510,7 @@ Note that we use a closure (`{ "cowpy-${meta.id}" }`) which has access to `meta`
510
510
511
511
The `ext.prefix` closure has access to `meta` because the configuration is evaluated in the context of the process execution, where metadata is available.
512
512
513
-
#### Test and verify
513
+
#### 1.3.4. Test and verify
514
514
515
515
Test the workflow once more:
516
516
@@ -595,7 +595,7 @@ You'll be prompted for:
595
595
596
596
The tool handles the complexity of finding package information and setting up the structure, allowing you to focus on implementing the tool's specific logic.
597
597
598
-
#### What gets generated
598
+
#### 2.1.1. What gets generated
599
599
600
600
The tool creates a complete module structure in `modules/local/` (or `modules/nf-core/` if you're in the nf-core/modules repository):
601
601
@@ -684,7 +684,7 @@ The template also includes several additional nf-core conventions that we didn't
684
684
685
685
These additional conventions make modules more maintainable and provide better visibility into pipeline execution.
686
686
687
-
#### Completing the environment and container setup
687
+
#### 2.1.2. Completing the environment and container setup
688
688
689
689
In the case of cowpy, the tool warned that it couldn't find the package in Bioconda (the primary channel for bioinformatics tools).
690
690
However, cowpy is available in conda-forge, so you would complete the `environment.yml` like this:
@@ -716,7 +716,7 @@ Once you've completed the environment setup and filled in the command logic, the
716
716
717
717
The [nf-core/modules](https://github.com/nf-core/modules) repository welcomes contributions of well-tested, standardized modules.
718
718
719
-
#### Why contribute?
719
+
#### 2.2.1. Why contribute?
720
720
721
721
Contributing your modules to nf-core:
722
722
@@ -725,7 +725,7 @@ Contributing your modules to nf-core:
725
725
- Provides quality assurance through code review and automated testing
726
726
- Gives your work visibility and recognition
727
727
728
-
#### Contributing workflow
728
+
#### 2.2.2. Contributing workflow
729
729
730
730
To contribute a module to nf-core:
731
731
@@ -739,7 +739,7 @@ To contribute a module to nf-core:
739
739
740
740
For detailed instructions, see the [nf-core components tutorial](https://nf-co.re/docs/tutorials/nf-core_components/components).
741
741
742
-
#### Resources
742
+
#### 2.2.3. Resources
743
743
744
744
-**Components tutorial**: [Complete guide to creating and contributing modules](https://nf-co.re/docs/tutorials/nf-core_components/components)
745
745
-**Module specifications**: [Technical requirements and guidelines](https://nf-co.re/docs/guidelines/components/modules)
Copy file name to clipboardExpand all lines: docs/hello_nf-core/05_input_validation.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,14 +36,18 @@ The pipeline fails immediately with clear, actionable error messages. This saves
36
36
37
37
nf-core pipelines validate two different kinds of input:
38
38
39
-
**Parameter validation**: Validates command-line parameters (flags like `--outdir`, `--batch`, `--input`)
39
+
### Parameter validation
40
+
41
+
This validates command-line parameters (flags like `--outdir`, `--batch`, `--input`):
40
42
41
43
- Checks parameter types, ranges, and formats
42
44
- Ensures required parameters are provided
43
45
- Validates file paths exist
44
46
- Defined in `nextflow_schema.json`
45
47
46
-
**Input data validation**: Validates the contents of input files (like sample sheets or CSV files)
48
+
### Input data validation
49
+
50
+
This validates the contents of input files (like sample sheets or CSV files)
47
51
48
52
- Checks column structure and data types
49
53
- Validates file references within the input file
@@ -279,7 +283,7 @@ Press `Ctrl+C` to exit the schema builder.
279
283
280
284
The tool has now updated your `nextflow_schema.json` file with the new `batch` parameter, handling all the JSON Schema syntax correctly.
281
285
282
-
**Verify the changes:**
286
+
#### 2.2.1. Verify the changes
283
287
284
288
```bash
285
289
grep -A 25 '"input_output_options"' nextflow_schema.json
@@ -636,7 +640,7 @@ Now nf-schema will validate both parameter types AND the input file contents.
636
640
637
641
Let's verify that our validation works by testing both valid and invalid inputs.
638
642
639
-
**Test with valid input:**
643
+
#### 3.7.1. Test with valid input
640
644
641
645
First, confirm the pipeline runs successfully with valid input:
642
646
@@ -663,7 +667,7 @@ executor > local (10)
663
667
664
668
Great! The pipeline runs successfully and validation passes silently. The warning about `--character` is just informational since it's not defined in the schema. If you want, use what you've learned to add validation for that parameter too!
665
669
666
-
**Test with invalid input:**
670
+
#### 3.7.2. Test with invalid input
667
671
668
672
Now let's test that validation catches errors. Create a test file with an invalid column name:
0 commit comments