Skip to content

Commit

Permalink
Add java options to picard tools
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Jan 11, 2023
1 parent a4fbe00 commit 7531c8a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,14 @@ params:
# Valid values: "processed", "merged"
CollectMultipleMetrics-bams: "processed"

# For some specific error cases, it might be necessary to adjust java settings for the tools,
# such as `-Xmx10g` to increase the available memory within the Java virtual machine
# (because it limits itself otherwise, instead of using the available memory...).
# The last option, SortVcf-java-opts, is used by bcftools when using contig-group-size > 0.
MarkDuplicates-java-opts: ""
CollectMultipleMetrics-java-opts: ""
SortVcf-java-opts: ""

# ----------------------------------------------------------------------
# dedup
# ----------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions rules/calling-bcftools.smk
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ if config["settings"].get("contig-group-size"):
" USE_JDK_DEFLATER=true USE_JDK_INFLATER=true"
if platform.system() == "Darwin"
else ""
)
),
java_opts=config["params"]["picard"]["SortVcf-java-opts"]
log:
"logs/vcflib/sort-genotyped.log"
"logs/picard/sort-genotyped.log"
benchmark:
"benchmarks/picard/sort-genotyped.bench.log"
conda:
"../envs/picard.yaml"
shell:
# Weird new picard syntax...
"picard SortVcf "
"{params.java_opts} "
"INPUT={input.vcf} "
"OUTPUT={output.vcf} "
"SEQUENCE_DICTIONARY={input.refdict} "
Expand Down
1 change: 1 addition & 0 deletions rules/duplicates-picard.smk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rule mark_duplicates:
# and some system libraries, leading the JRE to exit with fatal error SIGSEGV caused by
# libgkl_compression, see https://github.com/broadinstitute/picard/issues/1329.
# Hence, on MacOS, we add the two settings recommended by the github issue.
config["params"]["picard"]["MarkDuplicates-java-opts"] + " " +
config["params"]["picard"]["MarkDuplicates"] + (
" USE_JDK_DEFLATER=true USE_JDK_INFLATER=true"
if platform.system() == "Darwin"
Expand Down
1 change: 1 addition & 0 deletions rules/qc-bam.smk
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ rule picard_collectmultiplemetrics:
log:
"logs/picard/multiple_metrics/{sample}.log"
params:
config["params"]["picard"]["CollectMultipleMetrics-java-opts"] + " " +
config["params"]["picard"]["CollectMultipleMetrics-extra"] + (
" USE_JDK_DEFLATER=true USE_JDK_INFLATER=true"
if platform.system() == "Darwin"
Expand Down

0 comments on commit 7531c8a

Please sign in to comment.