Skip to content

Commit 4160fcf

Browse files
authored
adds again removed initial sort
1 parent 6a64388 commit 4160fcf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

modules/01_prepare_bam.nf

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ process PREPARE_BAM {
1616
tag "${name}"
1717
publishDir "${params.output}/${name}/", mode: "copy", pattern: "software_versions.*"
1818

19-
conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null)
19+
conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0 bioconda::samtools=1.12" : null)
2020

2121
input:
2222
tuple val(name), val(type), file(bam)
@@ -30,10 +30,14 @@ process PREPARE_BAM {
3030
"""
3131
mkdir tmp
3232
33+
samtools sort \
34+
--threads ${params.prepare_bam_cpus} \
35+
-o ${name}.sorted.bam ${bam}
36+
3337
gatk AddOrReplaceReadGroups \
3438
--java-options '-Xmx${params.prepare_bam_memory} -Djava.io.tmpdir=./tmp' \
3539
--VALIDATION_STRINGENCY SILENT \
36-
--INPUT ${bam} \
40+
--INPUT ${name}.sorted.bam \
3741
--OUTPUT /dev/stdout \
3842
--REFERENCE_SEQUENCE ${reference} \
3943
--RGPU 1 \
@@ -51,6 +55,8 @@ process PREPARE_BAM {
5155
--OUTPUT ${name}.prepared.bam \
5256
--SEQUENCE_DICTIONARY ${reference}
5357
58+
rm -f ${name}.sorted.bam
59+
5460
echo ${params.manifest} >> software_versions.${task.process}.txt
5561
gatk --version >> software_versions.${task.process}.txt
5662
"""

nextflow.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ process.shell = ['/bin/bash', '-euo', 'pipefail']
4444

4545
cleanup = true
4646

47-
VERSION = '2.0.0'
47+
VERSION = '2.0.1'
4848
DOI = 'https://zenodo.org/badge/latestdoi/358400957'
4949

5050
manifest {

0 commit comments

Comments
 (0)