Skip to content

Commit f028d3e

Browse files
authored
Changed Picard memory config and fix tmpdir path in BuildBamIndex (#24)
* Changed Picard memory config and fix tmpdir path in BuildBamIndex * Put 'g' in params Co-authored-by: bugh1 <>
1 parent 6b81505 commit f028d3e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pipeline/align-DNA.nf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ if (amount_of_memory < 1) {
2323
}
2424
amount_of_memory = amount_of_memory.toString() + " GB"
2525

26+
// Default memory configuration for Picard's Java commands
27+
params.mem_command_sort_sam = "4g"
28+
params.mem_command_mark_duplicates = "4g"
29+
params.mem_command_build_bam_index = "4g"
2630

2731
// output details of the pipeline run to stdout
2832
log.info """\
@@ -217,7 +221,7 @@ process PicardTools_SortSam {
217221
"""
218222
set -euo pipefail
219223
220-
java -Xmx100g -Djava.io.tmpdir=/temp_dir \
224+
java -Xmx${params.mem_command_sort_sam} -Djava.io.tmpdir=/temp_dir \
221225
-jar /picard-tools/picard.jar \
222226
SortSam \
223227
--VALIDATION_STRINGENCY LENIENT \
@@ -252,7 +256,7 @@ process PicardTools_MarkDuplicates {
252256
# add picard option prefix, '--INPUT' to each input bam
253257
declare -r INPUT=$(echo '!{input_bams}' | sed -e 's/ / --INPUT /g' | sed '1s/^/--INPUT /')
254258
255-
java -Xmx100g -Djava.io.tmpdir=/temp_dir/ \
259+
java -Xmx!{params.mem_command_mark_duplicates} -Djava.io.tmpdir=/temp_dir \
256260
-jar /picard-tools/picard.jar \
257261
MarkDuplicates \
258262
--VALIDATION_STRINGENCY LENIENT \
@@ -270,7 +274,7 @@ output_ch_PicardTools_MarkDuplicates
270274
// index bams with picard
271275
process PicardTools_BuildBamIndex {
272276
container docker_image_PicardTools
273-
containerOptions "--volume ${params.java_temp_dir}:/java_temp_dir"
277+
containerOptions "--volume ${params.temp_dir}:/temp_dir"
274278

275279
publishDir path: params.output_dir, mode: 'copy'
276280

@@ -288,7 +292,7 @@ process PicardTools_BuildBamIndex {
288292
"""
289293
set -euo pipefail
290294
291-
java -Xmx100g -Djava.io.tmpdir=/java_temp_dir \
295+
java -Xmx${params.mem_command_build_bam_index} -Djava.io.tmpdir=/temp_dir \
292296
-jar /picard-tools/picard.jar \
293297
BuildBamIndex \
294298
--VALIDATION_STRINGENCY LENIENT \

0 commit comments

Comments
 (0)