Skip to content

Commit 2722592

Browse files
committed
Merge branch 'software_version_fix' of github.com:nf-core/eager into software_version_fix
2 parents 953367f + dd4869c commit 2722592

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020
- [#750](https://github.com/nf-core/eager/issues/750) - Fixed piped commands requesting the same number of CPUs at each command step
2121
- [#757](https://github.com/nf-core/eager/issues/757) - Removed confusing 'Data Type' variable from MultiQC workflow summary (not consistent with TSV input)
2222
- [#759](https://github.com/nf-core/eager/pull/759) - Fixed malformed software scraping regex that resulted in N/A in MultiQC report
23+
- [#761](https://github.com/nf-core/eager/pull/759) - Fixed issues related to instability of samtools filtering related CI tests
2324

2425
### `Dependencies`
2526

main.nf

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,17 +1542,17 @@ process samtools_filter {
15421542
// Using shell block rather than script because we are playing with awk
15431543
script:
15441544

1545-
size = params.large_ref ? '-c' : ''
1545+
def size = params.large_ref ? '-c' : ''
15461546

15471547
// Unmapped/MAPQ Filtering WITHOUT min-length filtering
15481548
if ( "${params.bam_unmapped_type}" == "keep" && params.bam_filter_minreadlength == 0 ) {
15491549
"""
1550-
samtools view -h -b ${bam} -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} > ${libraryid}.filtered.bam
1550+
samtools view -h ${bam} -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -b > ${libraryid}.filtered.bam
15511551
samtools index ${libraryid}.filtered.bam ${size}
15521552
"""
15531553
} else if ( "${params.bam_unmapped_type}" == "discard" && params.bam_filter_minreadlength == 0 ){
15541554
"""
1555-
samtools view -h -b ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} > ${libraryid}.filtered.bam
1555+
samtools view -h ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -b > ${libraryid}.filtered.bam
15561556
samtools index ${libraryid}.filtered.bam ${size}
15571557
"""
15581558
} else if ( "${params.bam_unmapped_type}" == "bam" && params.bam_filter_minreadlength == 0 ){
@@ -1563,14 +1563,9 @@ process samtools_filter {
15631563
"""
15641564
} else if ( "${params.bam_unmapped_type}" == "fastq" && params.bam_filter_minreadlength == 0 ){
15651565
"""
1566-
echo "Samtools Filter Mapped"
1567-
samtools view -h ${bam} -@ ${task.cpus} -f4 -b -o ${libraryid}.unmapped.bam
1568-
echo "Samtools Filter Unmapped"
1566+
samtools view -h ${bam} -@ ${task.cpus} -f4 -b > ${libraryid}.unmapped.bam
15691567
samtools view -h ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -b > ${libraryid}.filtered.bam
1570-
echo "Samtools Indexing"
15711568
samtools index ${libraryid}.filtered.bam ${size}
1572-
1573-
echo "Samtools BAM2FASTQ"
15741569
## FASTQ
15751570
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus - 1} > ${libraryid}.unmapped.fastq.gz
15761571
rm ${libraryid}.unmapped.bam
@@ -1587,16 +1582,13 @@ process samtools_filter {
15871582
// Unmapped/MAPQ Filtering WITH min-length filtering
15881583
} else if ( "${params.bam_unmapped_type}" == "keep" && params.bam_filter_minreadlength != 0 ) {
15891584
"""
1590-
echo "Samtools quality filtering"
1591-
samtools view -h -b ${bam} -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} > tmp_mapped.bam
1592-
echo "Length filtering"
1585+
samtools view -h ${bam} -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -b > tmp_mapped.bam
15931586
filter_bam_fragment_length.py -a -l ${params.bam_filter_minreadlength} -o ${libraryid} tmp_mapped.bam
1594-
echo "Indexing"
15951587
samtools index ${libraryid}.filtered.bam ${size}
15961588
"""
15971589
} else if ( "${params.bam_unmapped_type}" == "discard" && params.bam_filter_minreadlength != 0 ){
15981590
"""
1599-
samtools view -h -b ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} > tmp_mapped.bam
1591+
samtools view -h ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -b > tmp_mapped.bam
16001592
filter_bam_fragment_length.py -a -l ${params.bam_filter_minreadlength} -o ${libraryid} tmp_mapped.bam
16011593
samtools index ${libraryid}.filtered.bam ${size}
16021594
"""
@@ -1609,11 +1601,10 @@ process samtools_filter {
16091601
"""
16101602
} else if ( "${params.bam_unmapped_type}" == "fastq" && params.bam_filter_minreadlength != 0 ){
16111603
"""
1612-
echo "Samtools Filter Mapped"
16131604
samtools view -h ${bam} -@ ${task.cpus} -f4 -b > ${libraryid}.unmapped.bam
1614-
echo "Samtools Filter Unmapped"
1615-
16161605
samtools view -h ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -b > tmp_mapped.bam
1606+
filter_bam_fragment_length.py -a -l ${params.bam_filter_minreadlength} -o ${libraryid} tmp_mapped.bam
1607+
samtools index ${libraryid}.filtered.bam ${size}
16171608
16181609
echo "Samtools Fragment Length Filtering"
16191610
filter_bam_fragment_length.py -a -l ${params.bam_filter_minreadlength} -o ${libraryid} tmp_mapped.bam
@@ -1628,15 +1619,11 @@ process samtools_filter {
16281619
"""
16291620
} else if ( "${params.bam_unmapped_type}" == "both" && params.bam_filter_minreadlength != 0 ){
16301621
"""
1631-
echo "Samtools Filter Mapped"
16321622
samtools view -h ${bam} -@ ${task.cpus} -f4 -b > ${libraryid}.unmapped.bam
1633-
echo "Samtools Filter Unmapped"
16341623
samtools view -h ${bam} -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -b > tmp_mapped.bam
1635-
echo "Samtools Fragment Length Filtering"
16361624
filter_bam_fragment_length.py -a -l ${params.bam_filter_minreadlength} -o ${libraryid} tmp_mapped.bam
1637-
echo "Samtools Indexing"
16381625
samtools index ${libraryid}.filtered.bam ${size}
1639-
echo "Samtools BAM2FASTQ"
1626+
16401627
## FASTQ
16411628
samtools fastq -tn ${libraryid}.unmapped.bam | pigz -p ${task.cpus} > ${libraryid}.unmapped.fastq.gz
16421629
"""

0 commit comments

Comments
 (0)