1
0
Fork 0
mirror of https://github.com/MillironX/nf-configs.git synced 2024-11-22 00:26:03 +00:00

Merge pull request #286 from FriederikeHanssen/cfc

Update sarek - cfc specific config
This commit is contained in:
FriederikeHanssen 2021-10-05 10:50:08 +02:00 committed by GitHub
commit 4f8b0d6478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,17 +9,34 @@ params {
// Specific nf-core/sarek process configuration // Specific nf-core/sarek process configuration
process { process {
withName:'StrelkaSingle|Strelka|StrelkaBP|MantaSingle|Manta' { withName:'StrelkaSingle|Strelka|StrelkaBP|MantaSingle|Manta' {
memory = 59.GB cpus = { check_resource( 20 * task.attempt) }
cpus = 20 memory = { check_resource( 59.GB * task.attempt) }
} }
withName:'MSIsensor_scan|MSIsensor_msi' { withName:'MSIsensor_scan|MSIsensor_msi' {
memory = 55.GB memory = { check_resource( 55.GB * task.attempt ) }
} }
withName:BamQC { withName:BamQC {
memory = 372.GB memory = { check_resource( 372.GB * task.attempt) }
} }
withName:MapReads{ withName:MapReads{
cpus = 20 cpus = { check_resource( 20 * task.attempt ) }
memory = 59.GB memory = { check_resource( 59.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"
}
}