Skip to content

Commit 4d056c0

Browse files
committed
Split hello_nextflow quiz into each chapter
1 parent f6915f8 commit 4d056c0

File tree

8 files changed

+549
-623
lines changed

8 files changed

+549
-623
lines changed

docs/hello_nextflow/01_hello_world.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,95 @@ More generally, you know how to interpret a simple Nextflow workflow, manage its
697697

698698
Take a little break, you've earned it!
699699
When you're ready, move on to Part 2 to learn how to use channels to feed inputs into your workflow, which will allow you to take advantage of Nextflow's built-in dataflow parallelism and other powerful features.
700+
701+
## Quiz
702+
703+
Test your knowledge of the concepts covered in Part 1 with this short quiz:
704+
705+
!!! info
706+
707+
<!-- mkdocs-quiz intro -->
708+
709+
<quiz>
710+
What is the minimum requirement for a Nextflow process?
711+
712+
- [ ] Input and output blocks
713+
- [x] Output and script blocks
714+
- [ ] Only a script block
715+
- [ ] Input block
716+
717+
</quiz>
718+
719+
<quiz>
720+
What does the output block in a process do?
721+
722+
- [ ] Creates the output files automatically
723+
- [x] Declares what output files to expect from the process
724+
- [ ] Determines the format of the output
725+
- [ ] Publishes outputs to a directory
726+
727+
</quiz>
728+
729+
<quiz>
730+
What command is used to run a Nextflow workflow?
731+
732+
- [ ] `nextflow execute script.nf`
733+
- [x] `nextflow run script.nf`
734+
- [ ] `nextflow start script.nf`
735+
- [ ] `nextflow launch script.nf`
736+
737+
</quiz>
738+
739+
<quiz>
740+
What is stored in the `work/` directory?
741+
742+
- [ ] Only the final output files
743+
- [ ] Configuration files
744+
- [x] Temporary files for each process execution
745+
- [x] Execution metadata like `.command.sh` and `.exitcode`
746+
- [x] Output files from processes
747+
- [ ] Container images
748+
749+
</quiz>
750+
751+
<quiz>
752+
What does the `-resume` flag do?
753+
754+
- [ ] Restarts the entire workflow from scratch
755+
- [x] Skips processes that already ran with the same code, settings, and inputs
756+
- [ ] Resumes only failed processes
757+
- [ ] Saves the workflow state for later
758+
759+
</quiz>
760+
761+
<quiz>
762+
What is the default mode for the `publishDir` directive?
763+
764+
- [ ] copy
765+
- [x] symlink
766+
- [ ] move
767+
- [ ] hardlink
768+
769+
</quiz>
770+
771+
<quiz>
772+
How do you pass a parameter to a Nextflow workflow from the command line?
773+
774+
- [ ] `-parameter value`
775+
- [x] `--parameter value`
776+
- [ ] `params.parameter = value`
777+
- [ ] `-p parameter=value`
778+
779+
</quiz>
780+
781+
<quiz>
782+
Which quote type is required for variable interpolation in Nextflow?
783+
784+
- [x] Double quotes `"`
785+
- [ ] Single quotes `'`
786+
- [ ] Backticks `` ` ``
787+
- [ ] Triple quotes `"""`
788+
789+
</quiz>
790+
791+
<!-- mkdocs-quiz results -->

docs/hello_nextflow/02_hello_channels.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,3 +904,93 @@ More generally, you have a basic understanding of how Nextflow uses **channels**
904904

905905
Take a big break, you worked hard in this one!
906906
When you're ready, move on to Part 3 to learn how to add more steps and connect them together into a proper workflow.
907+
908+
## Quiz
909+
910+
Test your knowledge of the concepts covered in Part 2 with this short quiz:
911+
912+
!!! info
913+
914+
<!-- mkdocs-quiz intro -->
915+
916+
<quiz>
917+
What is a channel in Nextflow?
918+
919+
- [ ] A file directory
920+
- [x] A queue-based mechanism for passing data between processes
921+
- [ ] A configuration parameter
922+
- [ ] A container registry
923+
924+
</quiz>
925+
926+
<quiz>
927+
Which channel factory creates a simple queue channel with values?
928+
929+
- [ ] `channel.fromPath()`
930+
- [x] `channel.of()`
931+
- [ ] `channel.from()`
932+
- [ ] `channel.create()`
933+
934+
</quiz>
935+
936+
<quiz>
937+
What happens when you pass a channel with multiple values to a process?
938+
939+
- [ ] Only the first value is processed
940+
- [x] The process is called once for each value in the channel
941+
- [ ] All values are processed together in a single call
942+
- [ ] The workflow fails with an error
943+
944+
</quiz>
945+
946+
<quiz>
947+
What does the `flatten()` operator do?
948+
949+
- [x] Unpacks array contents into individual items
950+
- [ ] Removes duplicate items from a channel
951+
- [ ] Sorts channel contents alphabetically
952+
- [ ] Converts items to lowercase
953+
954+
</quiz>
955+
956+
<quiz>
957+
What is the purpose of the `view()` operator?
958+
959+
- [ ] To visualize the workflow structure
960+
- [x] To inspect and print channel contents for debugging
961+
- [ ] To create graphical output
962+
- [ ] To validate channel data types
963+
964+
</quiz>
965+
966+
<quiz>
967+
What does the `splitCsv()` operator do?
968+
969+
- [ ] Creates a CSV file from channel data
970+
- [x] Parses CSV-formatted content, reading each line into an array
971+
- [ ] Splits a channel into multiple channels
972+
- [ ] Validates CSV formatting
973+
974+
</quiz>
975+
976+
<quiz>
977+
Which operator transforms channel contents element-by-element?
978+
979+
- [ ] `transform()`
980+
- [ ] `apply()`
981+
- [x] `map()`
982+
- [ ] `modify()`
983+
984+
</quiz>
985+
986+
<quiz>
987+
Why do you need dynamic filenames when processing multiple inputs?
988+
989+
- [ ] To save disk space
990+
- [ ] To improve performance
991+
- [x] To prevent output files from overwriting each other
992+
- [ ] To make resume work correctly
993+
994+
</quiz>
995+
996+
<!-- mkdocs-quiz results -->

docs/hello_nextflow/03_hello_workflow.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,3 +867,83 @@ More generally, you understand the key principles involved in connecting process
867867

868868
Take an extra long break, you've earned it.
869869
When you're ready, move on to Part 4 to learn how to modularize your code for better maintainability and code efficiency.
870+
871+
## Quiz
872+
873+
Test your knowledge of the concepts covered in Part 3 with this short quiz:
874+
875+
!!! info
876+
877+
<!-- mkdocs-quiz intro -->
878+
879+
<quiz>
880+
How do you access the output of a process in Nextflow?
881+
882+
- [ ] `processName.output`
883+
- [x] `processName.out`
884+
- [ ] `processName.result`
885+
- [ ] `output.processName`
886+
887+
</quiz>
888+
889+
<quiz>
890+
What determines the execution order of processes in a workflow?
891+
892+
- [ ] The order they are defined in the file
893+
- [ ] Alphabetical order by process name
894+
- [x] The dependencies between processes (output → input)
895+
- [ ] The order they are called in the workflow block
896+
897+
</quiz>
898+
899+
<quiz>
900+
What does the `collect()` operator do?
901+
902+
- [ ] Unpacks arrays into individual items
903+
- [x] Packages many channel items into a single array element
904+
- [ ] Removes null values from a channel
905+
- [ ] Collects error messages
906+
907+
</quiz>
908+
909+
<quiz>
910+
When should you use the `collect()` operator?
911+
912+
- [ ] Before processing items individually in parallel
913+
- [x] Before a process that needs all results at once
914+
- [ ] To speed up channel operations
915+
- [ ] When publishing outputs
916+
917+
</quiz>
918+
919+
<quiz>
920+
How do you access named outputs from a process?
921+
922+
- [ ] `processName.out[outputname]`
923+
- [x] `processName.out.outputname`
924+
- [ ] `processName.outputname`
925+
- [ ] `output.processName.outputname`
926+
927+
</quiz>
928+
929+
<quiz>
930+
What is the syntax for naming a process output?
931+
932+
- [x] `output: path "file.txt", emit: myoutput`
933+
- [ ] `output: path "file.txt", name: myoutput`
934+
- [ ] `output: path "file.txt" as myoutput`
935+
- [ ] `output: path "file.txt" -> myoutput`
936+
937+
</quiz>
938+
939+
<quiz>
940+
When passing multiple inputs to a process, what must match?
941+
942+
- [x] The order of inputs in the workflow call must match the input block order
943+
- [ ] The data types must all be the same
944+
- [ ] The variable names must match exactly
945+
- [ ] The number of inputs must equal the number of outputs
946+
947+
</quiz>
948+
949+
<!-- mkdocs-quiz results -->

docs/hello_nextflow/04_hello_modules.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,75 @@ This is better than just copy-pasting the code, because if later you decide to i
382382

383383
Take a short break if you feel like it.
384384
When you're ready, move on to Part 5 to learn how to use containers to manage software dependencies more conveniently and reproducibly.
385+
386+
## Quiz
387+
388+
Test your knowledge of the concepts covered in Part 4 with this short quiz:
389+
390+
!!! info
391+
392+
<!-- mkdocs-quiz intro -->
393+
394+
<quiz>
395+
What is a Nextflow module?
396+
397+
- [ ] A configuration file
398+
- [ ] A workflow definition
399+
- [x] A standalone file containing a single process definition
400+
- [ ] A container image
401+
402+
</quiz>
403+
404+
<quiz>
405+
What is the recommended filename convention for modules?
406+
407+
- [ ] `module_processName.nf`
408+
- [x] `processName.nf`
409+
- [ ] `processName.module`
410+
- [ ] `processName_module.nf`
411+
412+
</quiz>
413+
414+
<quiz>
415+
Where should module files typically be stored?
416+
417+
- [ ] In the root directory
418+
- [ ] In the `lib/` directory
419+
- [x] In the `modules/` directory
420+
- [ ] In the `processes/` directory
421+
422+
</quiz>
423+
424+
<quiz>
425+
What is the correct syntax to import a module?
426+
427+
- [ ] `import { processName } from './modules/processName.nf'`
428+
- [x] `include { processName } from './modules/processName.nf'`
429+
- [ ] `require { processName } from './modules/processName.nf'`
430+
- [ ] `use { processName } from './modules/processName.nf'`
431+
432+
</quiz>
433+
434+
<quiz>
435+
What happens to resume functionality when you convert processes to modules?
436+
437+
- [ ] Resume stops working
438+
- [ ] Resume only works for the main workflow
439+
- [x] Resume continues to work normally
440+
- [ ] Resume works but cache is reset
441+
442+
</quiz>
443+
444+
<quiz>
445+
What are key benefits of using modules?
446+
447+
- [ ] Faster execution time
448+
- [ ] Reduced memory usage
449+
- [x] Reuse processes in multiple workflows without duplication
450+
- [x] Easier maintenance - improve module once, all workflows benefit
451+
- [x] Better code organization
452+
- [ ] Automatic parallelization
453+
454+
</quiz>
455+
456+
<!-- mkdocs-quiz results -->

0 commit comments

Comments
 (0)