TASK 3: Add a Singularity profile - MRC-CLIMB/modules GitHub Wiki

Background reading:

  1. https://www.nextflow.io/docs/latest/config.html#scope-docker
  2. https://www.nextflow.io/docs/latest/config.html#scope-singularity

Similarly, to the docker profile defined in the nextflow.config, we’re next going to add in a singularity profile.

Declare a singularity{} profile in nextflow.config. Add in the following settings (with flags set to true):

singularity.enabled
singularity.autoMounts

We also want to define a singularity.cacheDir for Singularity. Singularity images take the form of .sif files, by default Nextflow will cache these images files in the work directory. Instead use the cacheDir setting to set the cache location to ${baseDir}/singularity. If you check the contents of ${baseDir}/singularity after running the pipeline with singularity, you’ll see the .sif image files (these have been converted from the original docker images by Nextflow/Singularity).

Let's also add the following in nextflow.config

cleanup = true

This will delete the contents of the work directory on completion of the pipeline.

Try running the pipeline again (remember to use -bg and redirect STDOUT to an output file), only this time set the profile to singularity