Using singularity with Nextflow
To use singularity on genotoul, you have to define by a config file the required options.
While using singularity with Nextflow, you don't have access to all
the mounted directory, such as /work or /save. To work around this problem use runOptions and -B
to define bind paths.
To activate usage of singularity with nextflow you can use
- option
-with-singularity
in command line or - write in
nextflow.config
following lines:singularity { enabled = true autoMount = true runOptions = '-B /bank -B /work2 -B /work -B /save -B /home' }
Run a workflow from a repository with dependancies
The workflow nextflow-io/rnaseq
have bowtie2
as dependancies. Try to run it whitout activating singularity :
$ nextflow run nextflow-io/rnaseq -r v1.5
N E X T F L O W ~ version 20.10.0
Launching `nextflow-io/rnaseq` [nasty_chandrasekhar] - revision: b5af40f295 [v1.5]
NOTE: Your local project version looks outdated - a different revision is available in the remote repository [329c1992a6]
R N A T O Y P I P E L I N E
=============================
genome: /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa
annot : /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/ggal_1_48850000_49020000.bed.gff
reads : /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/*_{1,2}.fq
outdir: results
executor > local (1)
executor > local (1)
[ce/62dab6] process > buildIndex (ggal_1_48850000_49020000.Ggal71.500bpflank) [100%] 1 of 1, failed: 1 ✘
[- ] process > mapping -
[- ] process > makeTranscript -
Error executing process > 'buildIndex (ggal_1_48850000_49020000.Ggal71.500bpflank)'
Caused by:
Process `buildIndex (ggal_1_48850000_49020000.Ggal71.500bpflank)` terminated with an error exit status (127)
Command executed:
bowtie2-build --threads 1 ggal_1_48850000_49020000.Ggal71.500bpflank.fa genome.index
Command exit status:
127
Command output:
(empty)
Command error:
.command.sh: ligne2: bowtie2-build : commande introuvable
Work dir:
/work/cnoirot/nextflow_tutoriak/work/ce/62dab6fc956aaa872b1af4690e261a
Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`
Get an error ? Dependencies are not present !
To work around this error,
load singularity module
module load system/singularity-3.0.1
and copy those lines into
nextflow.config
singularity { enabled = true autoMount = true runOptions = '-B /bank -B /work2 -B /work -B /save -B /home' }
Then rerun the command
module load system/singularity-3.0.1
$ nextflow run nextflow-io/rnaseq -r v1.5
N E X T F L O W ~ version 20.10.0
Launching `nextflow-io/rnaseq` [jolly_monod] - revision: b5af40f295 [v1.5]
NOTE: Your local project version looks outdated - a different revision is available in the remote repository [329c1992a6]
R N A T O Y P I P E L I N E
=============================
genome: /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa
annot : /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/ggal_1_48850000_49020000.bed.gff
reads : /home/cnoirot/.nextflow/assets/nextflow-io/rnaseq/data/ggal/*_{1,2}.fq
outdir: results
executor > local (5)
executor > local (5)
[6c/0c7376] process > buildIndex (ggal_1_48850000_49020000.Ggal71.500bpflank) [100%] 1 of 1 ✔
[f6/0e3bb4] process > mapping (ggal_liver) [100%] 2 of 2 ✔
[65/8cc4c3] process > makeTranscript (ggal_gut) [100%] 2 of 2 ✔
This configuration activate usage of a singularity image.
Exercise 7 :
Execute all steps describe in this page.