diff --git a/conf/base.config b/conf/base.config index 9e586d2c..e9d89e1e 100755 --- a/conf/base.config +++ b/conf/base.config @@ -130,9 +130,21 @@ process { } withName: '.*:.*:GENE_ALIGNMENT:.*:MINIMAP2_ALIGN' { - cpus = { 6 * task.attempt } - memory = { 1.GB * ( reference.size() < 2e9 ? 70 : Math.ceil( ( reference.size() / 1e+9 ) * 50 ) * Math.ceil( task.attempt * 1 ) ) } - time = { 10.h * task.attempt } + cpus = { check_max( 6 * task.attempt, 'cpus' ) } + memory = { + check_max( + 1.GB * ( + reference.size() < 2e9 ? 30 : + (reference.size() < 5e9 ? 50 : + (reference.size() < 10e9 ? 60 : + Math.ceil((reference.size() / 1e9) * 3) + ) + ) + ) * Math.ceil(task.attempt * 1), + 'memory' + ) + } + time = { check_max( 10.h * task.attempt, 'time' ) } } withName: '.*:.*:GENE_ALIGNMENT:.*:MINIPROT_INDEX' { @@ -143,9 +155,21 @@ process { // Standard parameters, covers most insecta. However the memory should be approx 10 * genome size withName: '.*:.*:READ_COVERAGE:MINIMAP2_ALIGN' { - cpus = { 20 * 1 } - memory = { 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 2.5 ) * Math.ceil( task.attempt * 1 ) ) } - time = { 1.h * ( reference.size() < 1e9 ? 10 : reference.size() < 10e9 ? 30 : 48) } + cpus = { check_max( 20 * 1, 'cpus' ) } + memory = { + check_max( + 1.GB * ( + reference.size() < 2e9 ? 30 : + (reference.size() < 5e9 ? 40 : + (reference.size() < 10e9 ? 60 : + Math.ceil((reference.size() / 1e9) * 3) + ) + ) + ) * Math.ceil(task.attempt * 1), + 'memory' + ) + } + time = { check_max( 1.h * ( reference.size() < 1e9 ? 10 : reference.size() < 10e9 ? 30 : 48), 'time' ) } } withName: '.*:.*:READ_COVERAGE:BEDTOOLS_GENOMECOV' { @@ -170,8 +194,20 @@ process { } withName: CRAM_FILTER_MINIMAP2_FILTER5END_FIXMATE_SORT { - cpus = { 16 * 1 } - memory = { 1.GB * ( reference.size() < 2e9 ? 50 : Math.ceil( ( reference.size() / 1e+9 ) * 3 ) * Math.ceil( task.attempt * 1 ) ) } + cpus = { check_max( 16 * 1 , 'cpus' ) } + memory = { + check_max( + 1.GB * ( + reference.size() < 2e9 ? 30 : + (reference.size() < 5e9 ? 40 : + (reference.size() < 10e9 ? 60 : + Math.ceil((reference.size() / 1e9) * 3) + ) + ) + ) * Math.ceil(task.attempt * 1), + 'memory' + ) + } } withName: SNAPSHOT_SRES { diff --git a/conf/modules.config b/conf/modules.config index 5d09463c..6874fb8f 100755 --- a/conf/modules.config +++ b/conf/modules.config @@ -104,7 +104,7 @@ process { } withName: 'GAWK_RENAME_IDS' { - ext.args2 = { "' gsub(/\\./, \"0\"); print '" } + ext.args2 = "'{ gsub(/\\./, \"0\"); print }'" ext.prefix = { "${meta.id}_renamed" } ext.suffix = 'bed' } diff --git a/workflows/treeval.nf b/workflows/treeval.nf index b88031cd..f2f5c796 100755 --- a/workflows/treeval.nf +++ b/workflows/treeval.nf @@ -242,9 +242,7 @@ workflow TREEVAL { ) ch_versions = ch_versions.mix( READ_COVERAGE.out.versions ) ch_coverage_bg_norm = READ_COVERAGE.out.ch_covbw_nor - ch_coverage_bg_avg = READ_COVERAGE.out.ch_covbw_avg } else { - ch_coverage_bg_avg = Channel.of([[],[]]) ch_coverage_bg_norm = Channel.of([[],[]]) } @@ -303,7 +301,6 @@ workflow TREEVAL { assembly_id, ch_gap_file, ch_coverage_bg_norm, - ch_coverage_bg_avg, ch_telo_bedgraph, ch_repeat_density, params.mode