From ee584e2e0c207fdf38c51bd7b1c2f7184f35e62f Mon Sep 17 00:00:00 2001 From: priesgof Date: Thu, 15 Apr 2021 22:55:49 +0200 Subject: [PATCH] avoid writing too many intermediate BAM files --- main.nf | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/main.nf b/main.nf index ab5d59f..ae03dde 100755 --- a/main.nf +++ b/main.nf @@ -103,22 +103,16 @@ process prepareBam { gatk CleanSam \ --java-options '-Xmx${params.prepare_bam_memory}' \ --INPUT ${bam} \ - --OUTPUT ${bam.baseName}.cleaned.bam \ - --CREATE_INDEX true - + --OUTPUT /dev/stdout | \ gatk ReorderSam \ --java-options '-Xmx${params.prepare_bam_memory}' \ - --INPUT ${bam.baseName}.cleaned.bam \ - --OUTPUT ${bam.baseName}.reordered.bam \ - --SEQUENCE_DICTIONARY ${params.reference} \ - --CREATE_INDEX true - - rm -f ${bam.baseName}.cleaned.bam - + --INPUT /dev/stdin \ + --OUTPUT /dev/stdout \ + --SEQUENCE_DICTIONARY ${params.reference} | \ gatk AddOrReplaceReadGroups \ --java-options '-Xmx${params.prepare_bam_memory}' \ --VALIDATION_STRINGENCY SILENT \ - --INPUT ${bam.baseName}.reordered.bam \ + --INPUT /dev/stdin \ --OUTPUT ${bam.baseName}.prepared.bam \ --REFERENCE_SEQUENCE ${params.reference} \ --RGPU 1 \ @@ -128,8 +122,6 @@ process prepareBam { --RGPL ${params.platform} \ --SORT_ORDER coordinate \ --CREATE_INDEX true - - rm -f ${bam.baseName}.reordered.bam """ }