Skip to content

Commit

Permalink
avoid writing too many intermediate BAM files
Browse files Browse the repository at this point in the history
  • Loading branch information
priesgo committed Apr 15, 2021
1 parent 1686aca commit ee584e2
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -128,8 +122,6 @@ process prepareBam {
--RGPL ${params.platform} \
--SORT_ORDER coordinate \
--CREATE_INDEX true
rm -f ${bam.baseName}.reordered.bam
"""
}

Expand Down

0 comments on commit ee584e2

Please sign in to comment.