1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-11-24 09:09:56 +00:00

Prince config - use function to check if env SCRATCH is set

This commit is contained in:
Phil Ewels 2020-06-26 14:22:32 +02:00
parent da46b1cd9a
commit 28027a8489

View file

@ -1,6 +1,6 @@
singularityDir = "$SCRATCH/singularity_images_nextflow" def singularityDir = set_singularity_path()
singularityModule = "singularity/3.2.1" def singularityModule = "singularity/3.2.1"
squashfsModule = "squashfs/4.3" def squashfsModule = "squashfs/4.3"
params { params {
config_profile_description = """ config_profile_description = """
@ -13,11 +13,21 @@ params {
} }
singularity { singularity {
enabled = true enabled = true
cacheDir = singularityDir cacheDir = singularityDir
} }
process { process {
beforeScript = "module load $singularityModule $squashfsModule" beforeScript = "module load $singularityModule $squashfsModule"
executor = 'slurm' executor = 'slurm'
} }
def set_singularity_path() {
def scratch = System.getenv('SCRATCH')
if(scratch == null){
System.err.println("WARNING: prince.config requires the SCRATCH env var to be set.")
return null
} else {
return "$SCRATCH/singularity_images_nextflow"
}
}