From 800931bff22fb4c466cf41ae0fe8ea60e2f5085f Mon Sep 17 00:00:00 2001 From: SPearce Date: Thu, 1 Sep 2022 11:13:23 +0100 Subject: [PATCH] Add Sarek specific config --- conf/pipeline/sarek/crukmi.config | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 conf/pipeline/sarek/crukmi.config diff --git a/conf/pipeline/sarek/crukmi.config b/conf/pipeline/sarek/crukmi.config new file mode 100644 index 0000000..0b2aecd --- /dev/null +++ b/conf/pipeline/sarek/crukmi.config @@ -0,0 +1,33 @@ +// Profile config names for nf-core/configs + +params { + // Specific nf-core/configs params + config_profile_description = 'Cancer Research UK Manchester Institute HPC cluster profile provided by nf-core/configs' + config_profile_contact = 'Stephen Kitcatt, Simon Pearce (@skitcattCRUKMI, @sppearce)' + config_profile_url = 'http://scicom.picr.man.ac.uk/projects/user-support/wiki' +} + +// Specific nf-core/sarek process configuration +process { + + withName: 'SAMTOOLS_MPILEUP' { + cpus = 1 + memory = { check_resource( 5.GB * task.attempt) } + } + +} + +def check_resource(obj) { + try { + if (obj.getClass() == nextflow.util.MemoryUnit && obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1) + return params.max_memory as nextflow.util.MemoryUnit + else if (obj.getClass() == nextflow.util.Duration && obj.compareTo(params.max_time as nextflow.util.Duration) == 1) + return params.max_time as nextflow.util.Duration + else if (obj.getClass() == java.lang.Integer) + return Math.min(obj, params.max_cpus as int) + else + return obj + } catch (all) { + println " ### ERROR ### Max params max_memory:'${params.max_memory}', max_time:'${params.max_time}' or max_cpus:'${params.max_cpus}' is not valid! Using default value: $obj" + } +}