From 329807f0153749eea5718671374befa905d9ef00 Mon Sep 17 00:00:00 2001 From: verku Date: Tue, 14 Nov 2023 10:05:01 +0100 Subject: [PATCH] Add Xmx option to use allocated memory more efficiently --- workflow/rules/3.1_bam_rmdup_realign_indels.smk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workflow/rules/3.1_bam_rmdup_realign_indels.smk b/workflow/rules/3.1_bam_rmdup_realign_indels.smk index a876557..cbeaee6 100644 --- a/workflow/rules/3.1_bam_rmdup_realign_indels.smk +++ b/workflow/rules/3.1_bam_rmdup_realign_indels.smk @@ -516,7 +516,8 @@ rule indel_realigner_targets: "docker://broadinstitute/gatk3:3.7-0" shell: """ - java -jar /usr/GenomeAnalysisTK.jar -T RealignerTargetCreator -R {input.ref} -I {input.bam} -o {output.target_list} -nt {threads} 2> {log} + mem=$(((6 * {threads}) - 2)) + java -jar -Xmx${{mem}}g /usr/GenomeAnalysisTK.jar -T RealignerTargetCreator -R {input.ref} -I {input.bam} -o {output.target_list} -nt {threads} 2> {log} """ @@ -538,7 +539,8 @@ rule indel_realigner: "docker://broadinstitute/gatk3:3.7-0" shell: """ - java -jar /usr/GenomeAnalysisTK.jar -T IndelRealigner -R {input.ref} -I {input.bam} -targetIntervals {input.target_list} -o {output.realigned} 2> {log} + mem=$(((6 * {threads}) - 2)) + java -jar -Xmx${{mem}}g /usr/GenomeAnalysisTK.jar -T IndelRealigner -R {input.ref} -I {input.bam} -targetIntervals {input.target_list} -o {output.realigned} 2> {log} """