Skip to content

Commit

Permalink
Added full script at the end, reorganized Nextflow powerpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
apca committed Nov 8, 2024
1 parent d38ce30 commit 7f0796d
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
Binary file modified course_contents/IntroNextflowFundamentals.pptx
Binary file not shown.
67 changes: 67 additions & 0 deletions course_contents/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,73 @@ nextflow run hello-world.nf
>
>More generally, you've learned how to use the essential components of Nextflow and you have a basic grasp of the logic of how to build a workflow and manage inputs and outputs.
## Full script

Here you have you first nextflow script in full!

```{code-block} groovy
#!/usr/bin/env nextflow
/*
* Pipeline parameters
*/
params.input_file = "data/greetings.csv"
/*
* Process 1: Use echo to print 'Hello World!' to an output file
*/
process sayHello {
//directives
publishDir 'results', mode: 'copy'
input:
path input_file
output:
path "${greeting}-output.txt"
script:
"""
echo '$greeting' > '$greeting-output.txt'
"""
}
/*
* Process 2: Use a text replace utility as we will do it in bash to convert the greeting to uppercase
*/
process convertToUpper {
publishDir 'results', mode: 'copy'
input:
path input_file
// we modify the output file name
output:
path "UPPER-${input_file}"
// now we add the bash code to convert the greeting to uppercase
script:
"""
cat '$input_file' | tr '[a-z]' '[A-Z]' > UPPER-${input_file}
"""
}
workflow {
// create a channel for inputs from a CSV file
greeting_ch = Channel.fromPath(params.input_file)
.splitCsv()
.flatten()
// emit a greeting
sayHello(greeting_ch)
// convert the greeting to uppercase
convertToUpper(sayHello.out)
}
```

## Run Nextflow CLI with Seqera Platform visualizing and capturing logs

Run a Nextflow workflow with the addition of the -with-tower command:
Expand Down
4 changes: 4 additions & 0 deletions resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Nextflow documentation: <https://www.nextflow.io/docs/latest/index.html>

Nf-core pipelines: <https://nf-co.re/>

## Asking for help, following specific developements
Nextflow community forum: <https://community.seqera.io/>
Nextflow slack channel: <https://nextflow.slack.com/join/shared_invite/>

## Nextflow events

Upcoming events: <https://summit.nextflow.io/>
Expand Down

0 comments on commit 7f0796d

Please sign in to comment.