Skip to content

Commit

Permalink
Merge branch 'template-updates' into 'dev'
Browse files Browse the repository at this point in the history
template updates

See merge request epi2melabs/workflows/wf-amplicon!92
  • Loading branch information
nrhorner committed Aug 23, 2024
2 parents 4ed66f0 + deb697c commit a7c770a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions lib/ingress.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
"""
}
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -76,7 +76,7 @@ manifest {
description = 'Amplicon workflow'
mainScript = 'main.nf'
nextflowVersion = '>=23.04.2'
version = 'v1.1.2'
version = 'v1.1.3'
}

epi2melabs {
Expand Down

0 comments on commit a7c770a

Please sign in to comment.