Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource requirement tweaks #107

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/local/amber/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ process AMBER {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def reference_arg = meta.containsKey('normal_id') ? "-reference ${meta.normal_id}" : ''
def reference_bam_arg = normal_bam ? "-reference_bam ${normal_bam}" : ''

def target_regions_bed_arg = target_region_bed ? "-target_regions_bed ${target_region_bed}" : ''

"""
amber \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-tumor ${meta.tumor_id} \\
-tumor_bam ${tumor_bam} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/bamtools/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ process BAMTOOLS {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
bamtools \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
com.hartwig.hmftools.bamtools.metrics.BamMetrics \\
${args} \\
-sample ${meta.sample_id} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/cobalt/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ process COBALT {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def reference_arg = meta.containsKey('normal_id') ? "-reference ${meta.normal_id}" : ''
def reference_bam_arg = normal_bam ? "-reference_bam ${normal_bam}" : ''

Expand All @@ -31,7 +33,7 @@ process COBALT {

"""
cobalt \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-tumor ${meta.tumor_id} \\
-tumor_bam ${tumor_bam} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/cuppa/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ process CUPPA {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
# Symlink input files into a single directory
mkdir -p sample_data/
Expand All @@ -45,7 +47,7 @@ process CUPPA {
mkdir -p cuppa/

cuppa \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-sample_data_dir sample_data/ \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/gripss/germline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ process GRIPSS_GERMLINE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
gripss \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.normal_id} \\
-reference ${meta.tumor_id} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/gripss/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ process GRIPSS_SOMATIC {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def reference_arg = meta.containsKey('normal_id') ? "-reference ${meta.normal_id}" : ''
def target_regions_bed_arg = target_region_bed ? "-target_regions_bed ${target_region_bed}" : ''
def output_id_arg = meta.containsKey('normal_id') ? '-output_id somatic' : ''

"""
gripss \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.tumor_id} \\
${reference_arg} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/isofox/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ process ISOFOX {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def functions_arg = functions ? "-functions \'${functions}\'" : ''

def exp_counts_arg = exp_counts ? "-exp_counts_file ${exp_counts}" : ''
Expand All @@ -42,7 +44,7 @@ process ISOFOX {
mkdir -p isofox/

isofox \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-bam_file ${bam} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/lilac/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ process LILAC {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def sample_name = getSampleName(meta, tumor_dna_bam, normal_dna_bam)

def normal_bam_arg = normal_dna_bam ? "-reference_bam ${normal_dna_bam}" : ''
Expand All @@ -33,7 +35,7 @@ process LILAC {

"""
lilac \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${sample_name} \\
${normal_bam_arg} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/linx/germline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ process LINX_GERMLINE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
linx \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-sv_vcf ${sv_vcf} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/linx/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ process LINX_SOMATIC {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
linx \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-sv_vcf ${purple_dir}/${meta.sample_id}.purple.sv.vcf.gz \\
Expand Down
6 changes: 4 additions & 2 deletions modules/local/linx/visualiser/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ process LINX_VISUALISER {
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
# NOTE(SW): the output plot directories are always required for ORANGE, which is straightfoward to handle with POSIX
# fs but more involved with FusionFS since it will not write empty directories to S3. A placeholder file can't be
Expand All @@ -43,7 +45,7 @@ process LINX_VISUALISER {
# Generate all chromosome and cluster plots by default

linx \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
com.hartwig.hmftools.linx.visualiser.SvVisualiser \\
${args} \\
-sample ${meta.sample_id} \\
Expand All @@ -66,7 +68,7 @@ process LINX_VISUALISER {
# https://github.com/hartwigmedical/hmftools/blob/linx-v1.24.1/linx/src/main/java/com/hartwig/hmftools/linx/visualiser/SampleData.java#L220-L236

linx \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
com.hartwig.hmftools.linx.visualiser.SvVisualiser \\
${args2} \\
-sample ${meta.sample_id} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/markdups/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ process MARKDUPS {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.95

def umi_flags = has_umis ? '-umi_enabled -umi_duplex -umi_duplex_delim +' : ''

"""
markdups \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
\\
-samtools \$(which samtools) \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/orange/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ process ORANGE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.95

def pipeline_version_str = pipeline_version ?: 'not specified'

def virus_dir_arg = virusinterpreter_dir ? "-virus_dir ${virusinterpreter_dir}" : ''
Expand Down Expand Up @@ -104,7 +106,7 @@ process ORANGE {

java \\
--add-opens java.base/java.time=ALL-UNNAMED \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
-jar \${orange_jar} \\
${args} \\
\\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/pave/germline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ process PAVE_GERMLINE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def gnomad_args
if (genome_ver.toString() == '37') {
gnomad_args = "-gnomad_freq_file ${gnomad_resource}"
Expand All @@ -46,7 +48,7 @@ process PAVE_GERMLINE {

"""
pave \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-vcf_file ${sage_vcf} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/pave/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ process PAVE_SOMATIC {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def pon_filters
def gnomad_args
if (genome_ver.toString() == '37') {
Expand All @@ -48,7 +50,7 @@ process PAVE_SOMATIC {

"""
pave \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-vcf_file ${sage_vcf} \\
Expand Down
6 changes: 4 additions & 2 deletions modules/local/purple/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process PURPLE {
tag "${meta.id}"
label 'process_low'
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand Down Expand Up @@ -33,6 +33,8 @@ process PURPLE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def reference_arg = meta.containsKey('normal_id') ? "-reference ${meta.normal_id}" : ''

def sv_tumor_vcf_arg = sv_tumor_vcf ? "-somatic_sv_vcf ${sv_tumor_vcf}" : ''
Expand All @@ -52,7 +54,7 @@ process PURPLE {

"""
purple \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-tumor ${meta.tumor_id} \\
${reference_arg} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/sage/append/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ process SAGE_APPEND {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
sage \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
com.hartwig.hmftools.sage.append.SageAppendApplication \\
${args} \\
-input_vcf ${vcf} \\
Expand Down
6 changes: 4 additions & 2 deletions modules/local/sage/germline/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process SAGE_GERMLINE {
tag "${meta.id}"
label 'process_medium'
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand Down Expand Up @@ -30,11 +30,13 @@ process SAGE_GERMLINE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.95

"""
mkdir germline/

sage \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-tumor ${meta.normal_id} \\
-tumor_bam ${normal_bam} \\
Expand Down
6 changes: 4 additions & 2 deletions modules/local/sage/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

process SAGE_SOMATIC {
tag "${meta.id}"
label 'process_medium'
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand Down Expand Up @@ -32,14 +32,16 @@ process SAGE_SOMATIC {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.95

def reference_arg = meta.containsKey('normal_id') ? "-reference ${meta.normal_id}" : ''
def reference_bam_arg = normal_bam ? "-reference_bam ${normal_bam}" : ''

"""
mkdir -p somatic/

sage \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
${reference_arg} \\
${reference_bam_arg} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/sigs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ process SIGS {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

"""
mkdir -p sigs/

sigs \\
-Xmx${Math.round(task.memory.bytes * 0.95)} \\
-Xmx${Math.round(task.memory.bytes * xmx_mod)} \\
${args} \\
-sample ${meta.sample_id} \\
-somatic_vcf_file ${smlv_vcf} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/svprep/assemble/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ process GRIDSS_ASSEMBLE {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.95

def config_arg = gridss_config ? "--configuration ${gridss_config}" : ''
def output_dirname = 'gridss_assemble'
def labels_list = labels instanceof List ? labels : [labels]
Expand Down Expand Up @@ -74,7 +76,7 @@ process GRIDSS_ASSEMBLE {
# Run
gridss_svprep \\
${args} \\
--jvmheap ${Math.round((task.memory.bytes - otherJvmHeap) * 0.95)} \\
--jvmheap ${Math.round((task.memory.bytes - otherJvmHeap) * xmx_mod)} \\
--otherjvmheap ${otherJvmHeap} \\
--steps assemble \\
--labels ${labels_arg} \\
Expand Down
4 changes: 3 additions & 1 deletion modules/local/svprep/call/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ process GRIDSS_CALL {
script:
def args = task.ext.args ?: ''

def xmx_mod = task.ext.xmx_mod ?: 0.75

def config_arg = gridss_config ? "--configuration ${gridss_config}" : ''
def output_dirname = 'gridss_call'
def labels_list = labels instanceof List ? labels : [labels]
Expand Down Expand Up @@ -72,7 +74,7 @@ process GRIDSS_CALL {
# Run
gridss_svprep \\
${args} \\
--jvmheap ${Math.round((task.memory.bytes - otherJvmHeap) * 0.95)} \\
--jvmheap ${Math.round((task.memory.bytes - otherJvmHeap) * xmx_mod)} \\
--otherjvmheap ${otherJvmHeap} \\
--steps call \\
--labels ${labels_arg} \\
Expand Down
Loading
Loading