Skip to content

Commit

Permalink
Add Xmx option to use allocated memory more efficiently
Browse files Browse the repository at this point in the history
  • Loading branch information
verku committed Nov 14, 2023
1 parent 11df9ed commit 329807f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions workflow/rules/3.1_bam_rmdup_realign_indels.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""


Expand All @@ -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}
"""


Expand Down

0 comments on commit 329807f

Please sign in to comment.