Skip to content

Commit 26a0503

Browse files
committed
Correct -n with -N in samtools fastq to retain paired information in BAM2FASTQ fiels when paired-end mapping
1 parent bf7e101 commit 26a0503

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- [#828](https://github.com/nf-core/eager/issues/828) Improved error message if required metagenomic screening parameters not set correctly
1313
- [#836](https://github.com/nf-core/eager/issues/836) Remove deprecated parameters from test profiles
14-
- [#838](https://github.com/nf-core/eager/issues/836) Fix --snpcapture_bed files not being picked up by Nextflow (thanks to @meganemichel for reporting)
14+
- [#838](https://github.com/nf-core/eager/issues/836) Fix --snpcapture_bed files not being picked up by Nextflow ( to @meganemichel for reporting)
1515
- [#843](https://github.com/nf-core/eager/issues/843) Re-add direct piping of AdapterRemovalFixPrefix to pigz
1616
- [#844](https://github.com/nf-core/eager/issues/844) Fixed reference masking prior to pmdtools
1717
- [#845](https://github.com/nf-core/eager/issues/845) Updates parameter documention to specify `-s` preseq parameter also applies to lc_extrap
1818
- [#851](https://github.com/nf-core/eager/issues/851) Fixes a file-name clash during additional_library_merge, post-BAM trimming of different UDG treated libraries of a sample
1919
- Renamed a range of MultiQC general stats table headers to improve clarity, documentation has been updated accordingly
20-
- [#858](https://github.com/nf-core/eager/pull/858) Corrected tutorials to reflect updated BAM trimming flags (thanks to @marcel-keller for reporting)
20+
- [#857](https://github.com/nf-core/eager/issues/857) Corrected samtools fastq flag to retain read-pair information when converting off-target BAM files to fastq (❤ to @alexhbnr for reporting)
21+
- [#858](https://github.com/nf-core/eager/pull/858) Corrected tutorials to reflect updated BAM trimming flags (❤ to @marcel-keller for reporting)
2122

2223
### `Dependencies`
2324

main.nf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ process convertBam {
638638
script:
639639
base = "${bam.baseName}"
640640
"""
641-
samtools fastq -tn ${bam} | pigz -p ${task.cpus} > ${base}.converted.fastq.gz
641+
samtools fastq -t ${bam} | pigz -p ${task.cpus} > ${base}.converted.fastq.gz
642642
"""
643643
}
644644

@@ -1683,7 +1683,7 @@ process samtools_filter {
16831683
samtools index ${libraryid}.filtered.bam ${size}
16841684
16851685
## FASTQ
1686-
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus - 1} > ${libraryid}.unmapped.fastq.gz
1686+
samtools fastq -tN ${libraryid}.unmapped.bam | pigz -p ${task.cpus - 1} > ${libraryid}.unmapped.fastq.gz
16871687
rm ${libraryid}.unmapped.bam
16881688
"""
16891689
} else if ( "${params.bam_unmapped_type}" == "both" && params.bam_filter_minreadlength == 0 ){
@@ -1693,7 +1693,7 @@ process samtools_filter {
16931693
samtools index ${libraryid}.filtered.bam ${size}
16941694
16951695
## FASTQ
1696-
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus -1} > ${libraryid}.unmapped.fastq.gz
1696+
samtools fastq -tN ${libraryid}.unmapped.bam | pigz -p ${task.cpus -1} > ${libraryid}.unmapped.fastq.gz
16971697
"""
16981698
// Unmapped/MAPQ Filtering WITH min-length filtering
16991699
} else if ( "${params.bam_unmapped_type}" == "keep" && params.bam_filter_minreadlength != 0 ) {
@@ -1723,7 +1723,7 @@ process samtools_filter {
17231723
samtools index ${libraryid}.filtered.bam ${size}
17241724
17251725
## FASTQ
1726-
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus - 1} > ${libraryid}.unmapped.fastq.gz
1726+
samtools fastq -tN ${libraryid}.unmapped.bam | pigz -p ${task.cpus - 1} > ${libraryid}.unmapped.fastq.gz
17271727
rm ${libraryid}.unmapped.bam
17281728
"""
17291729
} else if ( "${params.bam_unmapped_type}" == "both" && params.bam_filter_minreadlength != 0 ){
@@ -1734,7 +1734,7 @@ process samtools_filter {
17341734
samtools index ${libraryid}.filtered.bam ${size}
17351735
17361736
## FASTQ
1737-
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus} > ${libraryid}.unmapped.fastq.gz
1737+
samtools fastq -tN ${libraryid}.unmapped.bam | pigz -p ${task.cpus} > ${libraryid}.unmapped.fastq.gz
17381738
"""
17391739
}
17401740
}

0 commit comments

Comments
 (0)