Skip to content

Commit 9ffcd98

Browse files
pinin4fjordsFriederikeHanssenadamrtalbot
authored
Add debugging side quest content (#639)
* Add debugging side quest content * End of file fix * Add periods to headings * shorten intro * Update docs/side_quests/debugging.md * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * Apply suggestions from code review Co-authored-by: Adam Talbot <[email protected]> * remove duplication * change to inputs * add nextflow run and change order to invalid_process.nf * add line highlighting, expand explanation * add solution * add nextflow run to bad_bash_var * move into workflow * propagate fixes into code * suffle explanation to include run command, add collect * expand on the value channel explanation * add before after block * call out to containers training * Update docs/side_quests/debugging.md Co-authored-by: Adam Talbot <[email protected]> * note about syntax error * have people add in stub themselves * remove code commenting step * note on host system error propagation * simplify debugging journey by removing trace, report, timeline * testing with nf-test * linting * fix formatting * fix formatting * Update docs/side_quests/debugging.md * Update contents, trial before/ after type syntax for error * Revert "Update contents, trial before/ after type syntax for error" This reverts commit efcf91a. * Update contents * Reformat exercise * try adding consistency * Fixes down to bad_bash_var * syntax fix * Misc fixes and Nextflow versions * Fix highlight * Fix highlight * Add incorrect_num_args screenshot * Fix highlight * Misc fixes * Misc fixes * Fix wording, highlight * Update run message * Turn on some line numberings to check it works * Tidy up view() coverage * More refinements * formatting fix * More fixes * Tidy up stubs etc * Last fixes before exercise * Remove bug comment * Fix debugging phases * Fix exercise formatting * Fix exercise formatting * Try to finalise solution * Fix formatting * Move summary out of solution * Prettier * Fix listing * Fix misc errors * Add missing line nums * Add process debugging techniques * prettier * Update docs/side_quests/debugging.md * Update docs/side_quests/debugging.md * Update docs/side_quests/debugging.md * fix prettier linting * reduce level of numbering to prevent autonumbering by the renderer * numbering * try indenting text further to fix numbering * revert to using bold numbers * Improve syntax debugging ending --------- Co-authored-by: FriederikeHanssen <[email protected]> Co-authored-by: Adam Talbot <[email protected]>
1 parent 3f249f6 commit 9ffcd98

29 files changed

+2718
-0
lines changed

docs/side_quests/debugging.md

Lines changed: 2095 additions & 0 deletions
Large diffs are not rendered by default.
55.3 KB
Loading
32.7 KB
Loading
40.9 KB
Loading

docs/side_quests/img/nonlethal.png

102 KB
Loading

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ nav:
5757
- side_quests/ide_features.md
5858
- side_quests/workflows_of_workflows.md
5959
- side_quests/splitting_and_grouping.md
60+
- side_quests/debugging.md
6061
- side_quests/nf-test.md
6162
- side_quests/nf-core.md
6263
- Fundamentals Training:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env nextflow
2+
3+
process PROCESS_FILES {
4+
input:
5+
val sample_name
6+
7+
output:
8+
path "${sample_name}_output.txt"
9+
10+
script:
11+
"""
12+
prefix="${sample_name}_output"
13+
echo "Processing ${sample_name}" > ${prefix}.txt
14+
"""
15+
}
16+
17+
workflow {
18+
19+
// Create input channel
20+
input_ch = Channel.of('sample1', 'sample2', 'sample3')
21+
22+
// Call the process with the input channel
23+
PROCESS_FILES(input_ch)
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env nextflow
2+
3+
process PROCESS_FILES {
4+
input:
5+
val sample_name
6+
7+
output:
8+
path "${sample_name}_output.txt"
9+
10+
script:
11+
"""
12+
echo "Processing ${sample_name}" > ${sample_name}_output.txt
13+
"""
14+
}
15+
16+
workflow {
17+
18+
input_ch = Channel.of(
19+
['sample1', 'file1.txt'],
20+
['sample2', 'file2.txt'],
21+
['sample3', 'file3.txt'],
22+
)
23+
PROCESS_FILES(input_ch)
24+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env nextflow
2+
3+
process PROCESS_FILES {
4+
input:
5+
val sample_name
6+
7+
output:
8+
path "${sample_name}_output.txt"
9+
10+
script:
11+
"""
12+
echo "Processing ${sample_name}" > ${sample_name}_output.txt
13+
"""
14+
}
15+
16+
workflow {
17+
18+
input_ch = Channel.of(
19+
['sample1', 'file1.txt'],
20+
['sample2', 'file2.txt'],
21+
['sample3', 'file3.txt'],
22+
)
23+
.view { "Channel content: ${it}" }
24+
.map { tuple -> tuple[0] }
25+
.view { "After mapping: ${it}" }
26+
27+
PROCESS_FILES(input_ch)
28+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env nextflow
2+
3+
process PROCESS_FILES {
4+
debug true
5+
6+
input:
7+
val sample_name
8+
9+
output:
10+
path "${sample_name}_output.txt"
11+
12+
script:
13+
"""
14+
echo "Sample name inside process is ${sample_name}"
15+
echo "Processing ${sample_name}" > ${sample_name}_output.txt
16+
"""
17+
}
18+
19+
workflow {
20+
21+
input_ch = Channel.of(
22+
['sample1', 'file1.txt'],
23+
['sample2', 'file2.txt'],
24+
['sample3', 'file3.txt'],
25+
)
26+
.view { "Channel content: ${it}" }
27+
.map { tuple -> tuple[0] }
28+
.view { "After mapping: ${it}" }
29+
30+
PROCESS_FILES(input_ch)
31+
}

0 commit comments

Comments
 (0)