Skip to content

Commit bcf14eb

Browse files
pinin4fjordsclaude
andcommitted
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]>
1 parent 49b6945 commit bcf14eb

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

docs/hello_nf-core/03_use_module.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Now we need to modify our workflow code to use `CAT_CAT` instead of `collectGree
336336

337337
Open [core-hello/workflows/hello.nf](core-hello/workflows/hello.nf) and make the following changes to the workflow logic in the `main` block.
338338

339-
#### Step 1: Create a metadata map
339+
#### 1.9.1. Create a metadata map
340340

341341
First, we need to create a metadata map for `CAT_CAT`. Remember that nf-core modules require metadata with at least an `id` field.
342342

@@ -376,7 +376,7 @@ Add these lines after the `convertToUpper` call, removing the `collectGreetings`
376376

377377
This creates a simple metadata map where the `id` is set to our batch name (which will be "test" when using the test profile).
378378

379-
#### Step 2: Create a channel with metadata tuples
379+
#### 1.9.2. Create a channel with metadata tuples
380380

381381
Next, transform the channel of files into a channel of tuples containing metadata and files:
382382

@@ -419,7 +419,7 @@ This line does two things:
419419
- `.collect()` gathers all files from the `convertToUpper` output into a single list
420420
- `.map { files -> tuple(cat_meta, files) }` creates a tuple of `[metadata, files]` in the format `CAT_CAT` expects
421421

422-
#### Step 3: Call CAT_CAT
422+
#### 1.9.3. Call CAT_CAT
423423

424424
Now call `CAT_CAT` with the properly formatted channel:
425425

@@ -460,7 +460,7 @@ Now call `CAT_CAT` with the properly formatted channel:
460460
cowpy(collectGreetings.out.outfile, params.character)
461461
```
462462

463-
#### Step 4: Remove the legacy collectGreetings import
463+
#### 1.9.4. Remove the legacy collectGreetings import
464464

465465
Since we're no longer using the `collectGreetings` module, remove its import statement from the top of the file:
466466

@@ -497,7 +497,7 @@ Since we're no longer using the `collectGreetings` module, remove its import sta
497497
include { CAT_CAT } from '../modules/nf-core/cat/cat/main'
498498
```
499499

500-
#### Step 5: Update cowpy to use CAT_CAT output
500+
#### 1.9.5. Update cowpy to use CAT_CAT output
501501

502502
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:
503503

docs/hello_nf-core/04_make_module.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Now let's address another nf-core pattern: simplifying module interfaces by usin
166166

167167
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`.
168168

169-
#### Understanding ext.args
169+
#### 1.2.1. Understanding ext.args
170170

171171
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.
172172

@@ -182,7 +182,7 @@ Benefits of this approach:
182182
- **Portability**: Modules can be reused without hardcoded tool options
183183
- **No workflow changes**: Adding or changing tool options doesn't require updating workflow code
184184

185-
#### Centralized publishing configuration
185+
#### 1.2.2. Centralized publishing configuration
186186

187187
Before we update the module to use `ext.args`, let's address an important nf-core convention: **modules should not contain hardcoded `publishDir` directives**.
188188

@@ -211,7 +211,7 @@ Benefits of this approach:
211211
- **Easy customization**: Override publishing behavior in config, not in module code
212212
- **Portable modules**: Modules don't hardcode output locations
213213

214-
#### Update the module
214+
#### 1.2.3. Update the module
215215

216216
Now let's update the cowpy module to use `ext.args` and remove the local `publishDir`.
217217

@@ -278,7 +278,7 @@ Key changes:
278278

279279
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`.
280280

281-
#### Configure ext.args
281+
#### 1.2.4. Configure ext.args
282282

283283
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.
284284

@@ -321,7 +321,7 @@ Key points:
321321

322322
The `modules.config` file is where nf-core pipelines centralize per-module configuration. This separation of concerns makes modules more reusable across different pipelines.
323323

324-
#### Update the workflow
324+
#### 1.2.5. Update the workflow
325325

326326
Since the cowpy module no longer requires the `character` parameter as an input, we need to update the workflow call.
327327

@@ -343,7 +343,7 @@ Open `workflows/hello.nf` and update the cowpy call:
343343

344344
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.
345345

346-
#### Test
346+
#### 1.2.6. Test
347347

348348
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):
349349

@@ -405,7 +405,7 @@ cat work/bd/0abaf8*/cowpy-test.txt
405405

406406
There's one more nf-core pattern we can apply: using `ext.prefix` for configurable output file naming.
407407

408-
#### Understanding ext.prefix
408+
#### 1.3.1. Understanding ext.prefix
409409

410410
The `task.ext.prefix` pattern is another nf-core convention for standardizing output file naming across modules while keeping it configurable.
411411

@@ -416,7 +416,7 @@ Benefits:
416416
- **Consistent**: All nf-core modules follow this pattern
417417
- **Predictable**: Easy to know what output files will be called
418418

419-
#### Update the module
419+
#### 1.3.2. Update the module
420420

421421
Let's update the cowpy module to use `ext.prefix` for output file naming.
422422

@@ -481,7 +481,7 @@ Key changes:
481481

482482
Note that the local `publishDir` has already been removed in the previous step, so we're continuing with the centralized configuration approach.
483483

484-
#### Configure ext.prefix
484+
#### 1.3.3. Configure ext.prefix
485485

486486
To maintain the same output file naming as before (`cowpy-<id>.txt`), we can configure `ext.prefix` in modules.config.
487487

@@ -510,7 +510,7 @@ Note that we use a closure (`{ "cowpy-${meta.id}" }`) which has access to `meta`
510510

511511
The `ext.prefix` closure has access to `meta` because the configuration is evaluated in the context of the process execution, where metadata is available.
512512

513-
#### Test and verify
513+
#### 1.3.4. Test and verify
514514

515515
Test the workflow once more:
516516

@@ -595,7 +595,7 @@ You'll be prompted for:
595595

596596
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.
597597

598-
#### What gets generated
598+
#### 2.1.1. What gets generated
599599

600600
The tool creates a complete module structure in `modules/local/` (or `modules/nf-core/` if you're in the nf-core/modules repository):
601601

@@ -684,7 +684,7 @@ The template also includes several additional nf-core conventions that we didn't
684684

685685
These additional conventions make modules more maintainable and provide better visibility into pipeline execution.
686686

687-
#### Completing the environment and container setup
687+
#### 2.1.2. Completing the environment and container setup
688688

689689
In the case of cowpy, the tool warned that it couldn't find the package in Bioconda (the primary channel for bioinformatics tools).
690690
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
716716

717717
The [nf-core/modules](https://github.com/nf-core/modules) repository welcomes contributions of well-tested, standardized modules.
718718

719-
#### Why contribute?
719+
#### 2.2.1. Why contribute?
720720

721721
Contributing your modules to nf-core:
722722

@@ -725,7 +725,7 @@ Contributing your modules to nf-core:
725725
- Provides quality assurance through code review and automated testing
726726
- Gives your work visibility and recognition
727727

728-
#### Contributing workflow
728+
#### 2.2.2. Contributing workflow
729729

730730
To contribute a module to nf-core:
731731

@@ -739,7 +739,7 @@ To contribute a module to nf-core:
739739

740740
For detailed instructions, see the [nf-core components tutorial](https://nf-co.re/docs/tutorials/nf-core_components/components).
741741

742-
#### Resources
742+
#### 2.2.3. Resources
743743

744744
- **Components tutorial**: [Complete guide to creating and contributing modules](https://nf-co.re/docs/tutorials/nf-core_components/components)
745745
- **Module specifications**: [Technical requirements and guidelines](https://nf-co.re/docs/guidelines/components/modules)

docs/hello_nf-core/05_input_validation.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ The pipeline fails immediately with clear, actionable error messages. This saves
3636

3737
nf-core pipelines validate two different kinds of input:
3838

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`):
4042

4143
- Checks parameter types, ranges, and formats
4244
- Ensures required parameters are provided
4345
- Validates file paths exist
4446
- Defined in `nextflow_schema.json`
4547

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)
4751

4852
- Checks column structure and data types
4953
- Validates file references within the input file
@@ -279,7 +283,7 @@ Press `Ctrl+C` to exit the schema builder.
279283

280284
The tool has now updated your `nextflow_schema.json` file with the new `batch` parameter, handling all the JSON Schema syntax correctly.
281285

282-
**Verify the changes:**
286+
#### 2.2.1. Verify the changes
283287

284288
```bash
285289
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.
636640

637641
Let's verify that our validation works by testing both valid and invalid inputs.
638642

639-
**Test with valid input:**
643+
#### 3.7.1. Test with valid input
640644

641645
First, confirm the pipeline runs successfully with valid input:
642646

@@ -663,7 +667,7 @@ executor > local (10)
663667

664668
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!
665669

666-
**Test with invalid input:**
670+
#### 3.7.2. Test with invalid input
667671

668672
Now let's test that validation catches errors. Create a test file with an invalid column name:
669673

0 commit comments

Comments
 (0)