diff --git a/CHANGELOG.md b/CHANGELOG.md index 762bae8..ba130f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v1.1.3] +### Fixed +- Automated basecaller detection failing in some circumstances. + ## [v1.1.2] ### Fixed - The workflow failing in _de novo_ mode when all reads for a sample came from the same strand. diff --git a/lib/ingress.nf b/lib/ingress.nf index 4ba5ac9..6d14a83 100644 --- a/lib/ingress.nf +++ b/lib/ingress.nf @@ -621,6 +621,8 @@ process validateIndex { } +// Sort FOFN for samtools merge to ensure samtools sort breaks ties deterministically. +// Uses -c to ensure matching RG.IDs across multiple inputs are not unnecessarily modified to avoid collisions. process mergeBams { label "ingress" label "wf_common" @@ -632,11 +634,12 @@ process mergeBams { def merge_threads = Math.max(1, task.cpus - 1) """ samtools merge -@ ${merge_threads} \ - -b <(find input_bams -name 'reads*.bam') --write-index -o reads.bam##idx##reads.bam.bai + -c -b <(find input_bams -name 'reads*.bam' | sort) --write-index -o reads.bam##idx##reads.bam.bai """ } +// Sort FOFN for samtools cat to ensure samtools sort breaks ties deterministically. process catSortBams { label "ingress" label "wf_common" @@ -647,7 +650,7 @@ process catSortBams { script: def sort_threads = Math.max(1, task.cpus - 2) """ - samtools cat -b <(find input_bams -name 'reads*.bam') \ + samtools cat -b <(find input_bams -name 'reads*.bam' | sort) \ | samtools sort - -@ ${sort_threads} --write-index -o reads.bam##idx##reads.bam.bai """ } diff --git a/nextflow.config b/nextflow.config index 0b72eb2..ffd5378 100644 --- a/nextflow.config +++ b/nextflow.config @@ -62,7 +62,7 @@ params { "--fastq 'wf-amplicon-demo/fastq'", "--reference 'wf-amplicon-demo/reference.fa'" ] - common_sha = "sha8b5843d549bb210558cbb676fe537a153ce771d6" + common_sha = "shad399cf22079b5b153920ac39ee40095a677933f1" container_sha = "sha79b5ac4013195fec9809f2b71ef55b87bf9c7f16" container_sha_medaka = "sha3486abaab0d3b90351617eb8622acf2028edb154" agent = null @@ -76,7 +76,7 @@ manifest { description = 'Amplicon workflow' mainScript = 'main.nf' nextflowVersion = '>=23.04.2' - version = 'v1.1.2' + version = 'v1.1.3' } epi2melabs {