Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#216](https://github.com/nf-core/seqinspector/pull/216) Fixed meta.id that resulted in all SEQFU_STATS processes with the same tag name
- [#224](https://github.com/nf-core/seqinspector/pull/224) Fix workflow output syntax for future Nextflow releases
- [#226](https://github.com/nf-core/seqinspector/pull/226) Fix parameter `tools_bundle` not accepting `null` for custom tool selection
- Fix `CollectHsMetrics` running for only a subset of input samples by broadcasting bait/target interval channels via `.first()` and forking `ch_bam_bai` with `multiMap` so both `PICARD_COLLECTHSMETRICS` and `PICARD_COLLECTMULTIPLEMETRICS` receive every emission

### `Changed`

Expand Down
17 changes: 15 additions & 2 deletions subworkflows/local/bam_qc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ workflow BAM_QC {

main:

ch_hsmetrics_in = ch_bam_bai.combine(ch_bait_intervals).combine(ch_target_intervals)
// Fork ch_bam_bai into two named branches so both downstream consumers
// receive every emission. Without this, the queue channel is
// distributed (rather than broadcast) between the .combine() operator
// feeding CollectHsMetrics and the direct process input feeding
// CollectMultipleMetrics, causing some samples to be silently dropped
// from one of the two paths.
ch_bam_bai_branched = ch_bam_bai.multiMap { meta, bam, bai ->
for_hsmetrics: tuple(meta, bam, bai)
for_multimetrics: tuple(meta, bam, bai)
}

ch_hsmetrics_in = ch_bam_bai_branched.for_hsmetrics
.combine(ch_bait_intervals)
.combine(ch_target_intervals)

PICARD_COLLECTHSMETRICS(
ch_hsmetrics_in.filter { ("picard_collecthsmetrics" in tools) },
Expand All @@ -28,7 +41,7 @@ workflow BAM_QC {
)

PICARD_COLLECTMULTIPLEMETRICS(
ch_bam_bai.filter { ("picard_collectmultiplemetrics" in tools) },
ch_bam_bai_branched.for_multimetrics.filter { ("picard_collectmultiplemetrics" in tools) },
ch_reference_fasta,
ch_reference_fai,
)
Expand Down
4 changes: 2 additions & 2 deletions workflows/seqinspector.nf
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ workflow SEQINSPECTOR {
bam_bai,
fasta,
fai,
bait_intervals ? channel.fromPath(bait_intervals).collect() : channel.empty(),
target_intervals ? channel.fromPath(target_intervals).collect() : channel.empty(),
bait_intervals ? channel.fromPath(bait_intervals).first() : channel.empty(),
target_intervals ? channel.fromPath(target_intervals).first() : channel.empty(),
dict,
tools,
)
Expand Down
Loading