Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions docs/hello_nextflow/01_hello_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,95 @@ More generally, you know how to interpret a simple Nextflow workflow, manage its

Take a little break, you've earned it!
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.

## Quiz

Test your knowledge of the concepts covered in Part 1 with this short quiz:

!!! info

<!-- mkdocs-quiz intro -->

<quiz>
What is the minimum requirement for a Nextflow process?

- [ ] Input and output blocks
- [x] Output and script blocks
- [ ] Only a script block
- [ ] Input block

</quiz>

<quiz>
What does the output block in a process do?

- [ ] Creates the output files automatically
- [x] Declares what output files to expect from the process
- [ ] Determines the format of the output
- [ ] Publishes outputs to a directory

</quiz>

<quiz>
What command is used to run a Nextflow workflow?

- [ ] `nextflow execute script.nf`
- [x] `nextflow run script.nf`
- [ ] `nextflow start script.nf`
- [ ] `nextflow launch script.nf`

</quiz>

<quiz>
What is stored in the `work/` directory?

- [ ] Only the final output files
- [ ] Configuration files
- [x] Temporary files for each process execution
- [x] Execution metadata like `.command.sh` and `.exitcode`
- [x] Output files from processes
- [ ] Container images

</quiz>

<quiz>
What does the `-resume` flag do?

- [ ] Restarts the entire workflow from scratch
- [x] Skips processes that already ran with the same code, settings, and inputs
- [ ] Resumes only failed processes
- [ ] Saves the workflow state for later

</quiz>

<quiz>
What is the default mode for the `publishDir` directive?

- [ ] copy
- [x] symlink
- [ ] move
- [ ] hardlink

</quiz>

<quiz>
How do you pass a parameter to a Nextflow workflow from the command line?

- [ ] `-parameter value`
- [x] `--parameter value`
- [ ] `params.parameter = value`
- [ ] `-p parameter=value`

</quiz>

<quiz>
Which quote type is required for variable interpolation in Nextflow?

- [x] Double quotes `"`
- [ ] Single quotes `'`
- [ ] Backticks `` ` ``
- [ ] Triple quotes `"""`

</quiz>

<!-- mkdocs-quiz results -->
90 changes: 90 additions & 0 deletions docs/hello_nextflow/02_hello_channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,3 +904,93 @@ More generally, you have a basic understanding of how Nextflow uses **channels**

Take a big break, you worked hard in this one!
When you're ready, move on to Part 3 to learn how to add more steps and connect them together into a proper workflow.

## Quiz

Test your knowledge of the concepts covered in Part 2 with this short quiz:

!!! info

<!-- mkdocs-quiz intro -->

<quiz>
What is a channel in Nextflow?

- [ ] A file directory
- [x] A queue-based mechanism for passing data between processes
- [ ] A configuration parameter
- [ ] A container registry

</quiz>

<quiz>
Which channel factory creates a simple queue channel with values?

- [ ] `channel.fromPath()`
- [x] `channel.of()`
- [ ] `channel.from()`
- [ ] `channel.create()`

</quiz>

<quiz>
What happens when you pass a channel with multiple values to a process?

- [ ] Only the first value is processed
- [x] The process is called once for each value in the channel
- [ ] All values are processed together in a single call
- [ ] The workflow fails with an error

</quiz>

<quiz>
What does the `flatten()` operator do?

- [x] Unpacks array contents into individual items
- [ ] Removes duplicate items from a channel
- [ ] Sorts channel contents alphabetically
- [ ] Converts items to lowercase

</quiz>

<quiz>
What is the purpose of the `view()` operator?

- [ ] To visualize the workflow structure
- [x] To inspect and print channel contents for debugging
- [ ] To create graphical output
- [ ] To validate channel data types

</quiz>

<quiz>
What does the `splitCsv()` operator do?

- [ ] Creates a CSV file from channel data
- [x] Parses CSV-formatted content, reading each line into an array
- [ ] Splits a channel into multiple channels
- [ ] Validates CSV formatting

</quiz>

<quiz>
Which operator transforms channel contents element-by-element?

- [ ] `transform()`
- [ ] `apply()`
- [x] `map()`
- [ ] `modify()`

</quiz>

<quiz>
Why do you need dynamic filenames when processing multiple inputs?

- [ ] To save disk space
- [ ] To improve performance
- [x] To prevent output files from overwriting each other
- [ ] To make resume work correctly

</quiz>

<!-- mkdocs-quiz results -->
80 changes: 80 additions & 0 deletions docs/hello_nextflow/03_hello_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -867,3 +867,83 @@ More generally, you understand the key principles involved in connecting process

Take an extra long break, you've earned it.
When you're ready, move on to Part 4 to learn how to modularize your code for better maintainability and code efficiency.

## Quiz

Test your knowledge of the concepts covered in Part 3 with this short quiz:

!!! info

<!-- mkdocs-quiz intro -->

<quiz>
How do you access the output of a process in Nextflow?

- [ ] `processName.output`
- [x] `processName.out`
- [ ] `processName.result`
- [ ] `output.processName`

</quiz>

<quiz>
What determines the execution order of processes in a workflow?

- [ ] The order they are defined in the file
- [ ] Alphabetical order by process name
- [x] The dependencies between processes (output → input)
- [ ] The order they are called in the workflow block

</quiz>

<quiz>
What does the `collect()` operator do?

- [ ] Unpacks arrays into individual items
- [x] Packages many channel items into a single array element
- [ ] Removes null values from a channel
- [ ] Collects error messages

</quiz>

<quiz>
When should you use the `collect()` operator?

- [ ] Before processing items individually in parallel
- [x] Before a process that needs all results at once
- [ ] To speed up channel operations
- [ ] When publishing outputs

</quiz>

<quiz>
How do you access named outputs from a process?

- [ ] `processName.out[outputname]`
- [x] `processName.out.outputname`
- [ ] `processName.outputname`
- [ ] `output.processName.outputname`

</quiz>

<quiz>
What is the syntax for naming a process output?

- [x] `output: path "file.txt", emit: myoutput`
- [ ] `output: path "file.txt", name: myoutput`
- [ ] `output: path "file.txt" as myoutput`
- [ ] `output: path "file.txt" -> myoutput`

</quiz>

<quiz>
When passing multiple inputs to a process, what must match?

- [x] The order of inputs in the workflow call must match the input block order
- [ ] The data types must all be the same
- [ ] The variable names must match exactly
- [ ] The number of inputs must equal the number of outputs

</quiz>

<!-- mkdocs-quiz results -->
72 changes: 72 additions & 0 deletions docs/hello_nextflow/04_hello_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,75 @@ This is better than just copy-pasting the code, because if later you decide to i

Take a short break if you feel like it.
When you're ready, move on to Part 5 to learn how to use containers to manage software dependencies more conveniently and reproducibly.

## Quiz

Test your knowledge of the concepts covered in Part 4 with this short quiz:

!!! info

<!-- mkdocs-quiz intro -->

<quiz>
What is a Nextflow module?

- [ ] A configuration file
- [ ] A workflow definition
- [x] A standalone file containing a single process definition
- [ ] A container image

</quiz>

<quiz>
What is the recommended filename convention for modules?

- [ ] `module_processName.nf`
- [x] `processName.nf`
- [ ] `processName.module`
- [ ] `processName_module.nf`

</quiz>

<quiz>
Where should module files typically be stored?

- [ ] In the root directory
- [ ] In the `lib/` directory
- [x] In the `modules/` directory
- [ ] In the `processes/` directory

</quiz>

<quiz>
What is the correct syntax to import a module?

- [ ] `import { processName } from './modules/processName.nf'`
- [x] `include { processName } from './modules/processName.nf'`
- [ ] `require { processName } from './modules/processName.nf'`
- [ ] `use { processName } from './modules/processName.nf'`

</quiz>

<quiz>
What happens to resume functionality when you convert processes to modules?

- [ ] Resume stops working
- [ ] Resume only works for the main workflow
- [x] Resume continues to work normally
- [ ] Resume works but cache is reset

</quiz>

<quiz>
What are key benefits of using modules?

- [ ] Faster execution time
- [ ] Reduced memory usage
- [x] Reuse processes in multiple workflows without duplication
- [x] Easier maintenance - improve module once, all workflows benefit
- [x] Better code organization
- [ ] Automatic parallelization

</quiz>

<!-- mkdocs-quiz results -->
Loading