diff --git a/_episodes/05-processes-part1.md b/_episodes/05-processes-part1.md index 8239b98d..9e10c830 100644 --- a/_episodes/05-processes-part1.md +++ b/_episodes/05-processes-part1.md @@ -60,7 +60,7 @@ To add the process to a workflow add a `workflow` block, and call the process li **Note:** As we are using DSL2 we need to include `nextflow.enable.dsl=2` in the script. ~~~ -//process_index.nf +// process/process_index.nf nextflow.enable.dsl=2 process INDEX { @@ -118,10 +118,10 @@ Tip: you can try to figure out what's wrong by changing to the process work dir What happened? Well, in our case we can't see the `salmon` executable; the error indicates it is not found. -How do we address this? There are a number of options, but the general 'best practice' way would be to use a __directive__ which loads the software into the environment when the script is run. For example, this could be done by using the `module` directive and the appropriate [environment module](https://modules.sourceforge.net): +How do we address this? There are a number of options, but the general 'best practice' way would be to use a __directive__ which loads the software into the environment when the script is run. For example, this could be done by using the `module` directive and the appropriate [environment module](https://modules.sourceforge.net). Below is a modified version of the script in `./process/process_index.nf` which includes such a directive: ~~~ -//process_index.nf + nextflow.enable.dsl=2 process INDEX { @@ -244,8 +244,6 @@ For example: nextflow.enable.dsl=2 process PROCESSBAM { - module "SAMtools/1.17-IGB-gcc-8.2.0" - script: """ samtools sort -o ref1.sorted.bam ${projectDir}/data/yeast/bams/ref1.bam @@ -313,7 +311,7 @@ workflow { ~~~ {: .language-groovy } -This allows the use of a different programming languages which may better fit a particular job. However, for large chunks of code it is suggested to save them into separate files and invoke them from the process script. +This allows the use of a different programming languages which may better fit a particular job. However, for large chunks of code it is suggested to save them into separate files and invoke them from the process script. ~~~ nextflow.enable.dsl=2 @@ -332,6 +330,8 @@ workflow { ~~~ {: .language-groovy } +Note that you will need to ensure any libraries are also loaded in if they are needed (e.g, Python libraries like `pandas`, or R libraries like `ggplot2`). + > ## Associated scripts > Scripts such as the one in the example above, `myscript.py`, can be stored in a `bin` folder at the same directory level as the Nextflow workflow script that invokes them, and given execute permission. Nextflow will automatically add this folder to the `PATH` environment variable. To invoke the script in a Nextflow process, simply use its filename on its own rather than invoking the interpreter e.g. `myscript.py` instead of `python myscript.py`. {: .callout }