params { reference = null // Config options config_profile_name = null config_profile_description = null custom_config_version = 'master' custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" config_profile_contact = null config_profile_url = null // Max resource options // Defaults only, expecting to be overwritten max_memory = '128.GB' max_cpus = 16 max_time = '240.h' // Haplotyper options // By default, run all haplotypers cliquesnv = true haplink = true quasirecomb = true shorah = true viquas = true } process { cpus = { check_max(1 * task.attempt, 'cpus') } memory = { check_max(6.GB * task.attempt, 'memory') } time = { check_max(4.h * task.attempt, 'time') } errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } maxRetries = 1 maxErrors = '-1' withLabel:process_single { cpus = { check_max(1, 'cpus') } memory = { check_max( 6.GB * task.attempt, 'memory') } time = { check_max( 4.h * task.attempt, 'time') } } withLabel:process_low { cpus = { check_max( 2 * task.attempt, 'cpus') } memory = { check_max( 12.GB * task.attempt, 'memory') } time = { check_max( 4.h * task.attempt, 'time') } } withLabel:process_medium { cpus = { check_max( 6 * task.attempt, 'cpus') } memory = { check_max( 36.GB * task.attempt, 'memory') } time = { check_max( 8.h * task.attempt, 'time') } } withLabel:process_high { cpus = { check_max( 12 * task.attempt, 'cpus') } memory = { check_max( 72.GB * task.attempt, 'memory') } time = { check_max( 16.h * task.attempt, 'time') } } withName: 'HAPLINK_ML_HAPLOTYPES' { ext.ml_args = """ --simulated-reads \\ --overlap-min 20 \\ --overlap-max 8000 \\ """ } withLabel: 'cliquesnv' { ext.when = params.cliquesnv } withLabel: 'haplink' { ext.when = params.haplink } withLabel: 'quasirecomb' { ext.when = params.quasirecomb } withLabel: 'shorah' { ext.when = params.shorah } withLabel: 'viquas' { ext.when = params.viquas } } try { includeConfig "${params.custom_config_base}/nfcore_custom.config" } catch (Exception e) { System.err.println("WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config") } profiles { docker { docker.enabled = true docker.userEmulation = true conda.enabled = false singularity.enabled = false podman.enabled = false shifter.enabled = false charliecloud.enabled = false apptainer.enabled = false } singularity { singularity.enabled = true singularity.autoMounts = true conda.enabled = false docker.enabled = false podman.enabled = false shifter.enabled = false charliecloud.enabled = false apptainer.enabled = false } podman { podman.enabled = true conda.enabled = false docker.enabled = false singularity.enabled = false shifter.enabled = false charliecloud.enabled = false apptainer.enabled = false } shifter { shifter.enabled = true conda.enabled = false docker.enabled = false singularity.enabled = false podman.enabled = false charliecloud.enabled = false apptainer.enabled = false } charliecloud { charliecloud.enabled = true conda.enabled = false docker.enabled = false singularity.enabled = false podman.enabled = false shifter.enabled = false apptainer.enabled = false } apptainer { apptainer.enabled = true apptainer.autoMounts = true conda.enabled = false docker.enabled = false singularity.enabled = false podman.enabled = false shifter.enabled = false charliecloud.enabled = false } } env { R_PROFILE_USER = "/.Rprofile" R_ENVIRON_USER = "/.Renviron" } def check_max(obj, type) { if (type == 'memory') { try { if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1) return params.max_memory as nextflow.util.MemoryUnit else return obj } catch (all) { println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj" return obj } } else if (type == 'time') { try { if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1) return params.max_time as nextflow.util.Duration else return obj } catch (all) { println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj" return obj } } else if (type == 'cpus') { try { return Math.min( obj, params.max_cpus as int ) } catch (all) { println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj" return obj } } }