From 7d7bf24bb9962a52a172a6a0230de97422262e00 Mon Sep 17 00:00:00 2001 From: W LI Date: Sun, 25 Oct 2026 08:08:09 -0400 Subject: [PATCH] Split mates in fastq-dump retry fallback On retry, SRATOOLS_FASTERQDUMP falls back to fastq-dump, which does not split mates by default. Paired runs came back as a single file of concatenated mates: multi-run samples failed in mergeRuns with a paired/single mix, and single-run samples would silently pass as single-end with double-length reads. Use --split-3 so the fallback produces the same _1/_2/unpaired layout as fasterq-dump. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 +- modules/nf-core/sratools/fasterqdump/main.nf | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 73d3ae6..eccd6b0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -140,7 +140,7 @@ Expected CSV format with header: ### Error Handling -- `SRATOOLS_FASTERQDUMP` has retry logic: falls back from `fasterq-dump` to `fastq-dump` on failure +- `SRATOOLS_FASTERQDUMP` has retry logic: falls back from `fasterq-dump` to `fastq-dump --split-3` on failure, keeping the same `_1`/`_2` mate layout - `SRATOOLS_PREFETCH` uses retry template with exponential backoff - Maximum 2 concurrent processes (`maxForks = 2`) - `SKETCH_REFERENCE` fails loudly (rather than producing a bogus genome size) if diff --git a/modules/nf-core/sratools/fasterqdump/main.nf b/modules/nf-core/sratools/fasterqdump/main.nf index 9508e67..ac71782 100644 --- a/modules/nf-core/sratools/fasterqdump/main.nf +++ b/modules/nf-core/sratools/fasterqdump/main.nf @@ -24,7 +24,8 @@ process SRATOOLS_FASTERQDUMP { task.ext.when == null || task.ext.when script: - def sraCommand = task.attempt > 1 ? "fastq-dump" : "fasterq-dump"; + // fastq-dump does not split mates by default; --split-3 matches fasterq-dump's output layout. + def sraCommand = task.attempt > 1 ? "fastq-dump --split-3" : "fasterq-dump"; def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}"