1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-12-22 02:38:16 +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"
singularityModule = "singularity/3.2.1"
squashfsModule = "squashfs/4.3"
def singularityDir = set_singularity_path()
def singularityModule = "singularity/3.2.1"
def squashfsModule = "squashfs/4.3"
params {
config_profile_description = """
@ -13,11 +13,21 @@ params {
}
singularity {
enabled = true
cacheDir = singularityDir
enabled = true
cacheDir = singularityDir
}
process {
beforeScript = "module load $singularityModule $squashfsModule"
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"
}
}