Skip to content

fix: EPICORE runs only once when --fasta is used#446

Merged
jonasscheid merged 2 commits into
devfrom
fix/epicore-single-sample
Apr 22, 2026
Merged

fix: EPICORE runs only once when --fasta is used#446
jonasscheid merged 2 commits into
devfrom
fix/epicore-single-sample

Conversation

@axelwalter
Copy link
Copy Markdown
Contributor

Symptom

When running the pipeline with --epicore and --fasta <file>, only one results/<sample>.tsv file is produced, regardless of how many samples were processed. For an N-sample run, only the first sample to reach SUMMARIZE_RESULTS gets an EPICORE output; the rest are silently dropped. No error is raised.

Confirmed on a user run: 14 SUMMARIZE_RESULTS tasks completed, but only 1 EPICORE task was ever submitted.

Root cause

In subworkflows/local/utils_nfcore_mhcquant_pipeline/main.nf (~line 139), when --fasta is set, ch_fasta is built with channel.fromPath(params.fasta, ...) — a queue channel carrying a single item, not a value channel.

In workflows/mhcquant.nf:207, that one-item queue channel is paired with SUMMARIZE_RESULTS.out.epicore_input (an N-item queue channel, one item per sample/condition group). Nextflow pairs queue-to-queue positionally: the fasta channel drains after the first iteration and the remaining N-1 epicore_input items never trigger an EPICORE task.

Because conf/modules.config sets SUMMARIZE_RESULTS.publishDir.enabled = !params.epicore, EPICORE's TSV is what the user sees in results/ when --epicore is on — so the missing runs translate directly into missing output files.

Introduced in the fix/summarize-result-quant merge (#444, commit b046949), which first wired EPICORE in with this call signature.

Fix

One character — .first() converts the single-item queue channel into a value channel, which broadcasts to every matching item in the other channel:

-        EPICORE(ch_fasta.map{ fasta -> fasta.last()}, SUMMARIZE_RESULTS.out.epicore_input)
+        EPICORE(ch_fasta.map{ fasta -> fasta.last()}.first(), SUMMARIZE_RESULTS.out.epicore_input)

Behavior

  • Multi-sample runs with --fasta --epicore: now produces one results/<sample>.tsv per sample (previously one total).
  • Single-sample runs: unchanged — broadcasting a one-item value channel to a one-item queue channel produces the same single pairing as before.
  • Samplesheet-provided FASTA (no --fasta): unchanged — this code path constructs ch_fasta differently and is not affected by this fix.

Files changed

  • workflows/mhcquant.nf — one-character fix on line 207
  • CHANGELOG.md### Fixed entry under 3.2.0dev

ch_fasta is a queue channel with one item when --fasta is set.
Paired positionally with SUMMARIZE_RESULTS.out.epicore_input
(N items), EPICORE runs only once instead of per sample. Convert
ch_fasta to a value channel with .first() so it broadcasts.

Symptom: with --epicore, only one results/<sample>.tsv file is
produced regardless of sample count.
@nf-core-bot
Copy link
Copy Markdown
Member

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 3.5.1.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 18c9e6a

+| ✅ 303 tests passed       |+
#| ❔   1 tests were ignored |#
!| ❗   3 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: conf/igenomes_ignored.config
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here

❔ Tests ignored:

  • files_unchanged - File ignored due to lint config: .github/CONTRIBUTING.md

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2026-04-22 07:19:38

@axelwalter
Copy link
Copy Markdown
Contributor Author

Just confirmed the fix works as intended.

@jonasscheid jonasscheid merged commit 5cd351a into dev Apr 22, 2026
19 checks passed
@jonasscheid jonasscheid mentioned this pull request Apr 22, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants