Skip to content

fq/lint: constrain reads input to arity 1..2#11227

Merged
pinin4fjords merged 1 commit intomasterfrom
pinin4fjords/fq-lint-arity
Apr 20, 2026
Merged

fq/lint: constrain reads input to arity 1..2#11227
pinin4fjords merged 1 commit intomasterfrom
pinin4fjords/fq-lint-arity

Conversation

@pinin4fjords
Copy link
Copy Markdown
Member

Summary

fq lint only accepts <R1> or <R1> <R2>. Downstream pipelines that accidentally forward more than two FASTQs into this module currently fail inside the container with a cryptic message like:

error: unexpected argument 'sample_val_2.fq.gz' found
Usage: fq lint [OPTIONS] <R1_SRC> [R2_SRC]

Declaring arity: '1..2' on the input surfaces the cardinality mismatch as a clear Nextflow-level error at channel bind:

Incorrect number of input files for process `FQ_LINT (1)` -- expected 1..2, found 3

Makes accidental over-forwarding (e.g. a path(...) glob that picks up more files than the user realised) fail fast and obvious, rather than requiring someone to read the container stderr.

Reported by @edmundmiller in nf-core/rnaseq#1807.

Changes

  • modules/nf-core/fq/lint/main.nf: add arity: '1..2' to the fastq input.
  • modules/nf-core/fq/lint/tests/main.nf.test: add test_fq_lint_rejects_more_than_two_fastqs to lock the constraint in place.

Test

$ nf-test test modules/nf-core/fq/lint/tests/main.nf.test --profile docker
Test Process FQ_LINT
  Test [d1f52092] 'test_fq_lint_success'                        PASSED (5.708s)
  Test [b262fadb] 'test_fq_lint_rejects_more_than_two_fastqs'   PASSED (4.359s)
  Test [ad922e58] 'test_fq_lint_fail'                           PASSED (6.033s)

SUCCESS: Executed 3 tests in 16.106s

PR checklist

  • This comment contains a description of changes (with reason).
  • CHANGELOG.md is updated.
  • If you've fixed a bug or added code that should be tested, add tests!
  • Ensure the test suite passes (nf-core modules test <MODULE> --profile docker).
  • Include any new arguments/options with a sensible default.
  • Ensure meta.yml is up to date (no changes needed here).

🤖 Generated with Claude Code

`fq lint` only accepts `<R1>` or `<R1> <R2>`. Downstream pipelines that
inadvertently forward more than two FASTQs (e.g. from a loose
`path(...)` collection upstream) currently fail with a cryptic
`fq lint: unexpected argument` error inside the container. Declaring
`arity: '1..2'` on the input surfaces the cardinality problem as a
clear Nextflow-level error at channel bind, e.g.:

    Incorrect number of input files for process `FQ_LINT (1)`
    -- expected 1..2, found 3

Reported by @edmundmiller in nf-core/rnaseq#1807.

Also adds a test case that supplies three FASTQs and asserts the
process fails, locking the constraint in place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pinin4fjords pinin4fjords added this pull request to the merge queue Apr 20, 2026
Merged via the queue into master with commit c7eecb1 Apr 20, 2026
40 checks passed
@pinin4fjords pinin4fjords deleted the pinin4fjords/fq-lint-arity branch April 20, 2026 10:02
pinin4fjords added a commit to nf-core/rnaseq that referenced this pull request Apr 22, 2026
…ntegration

Bump to the latest upstream of:

- fq/lint (nf-core/modules#11227): constrain reads arity to 1..2
- ribodetector (nf-core/modules#11258): unpin GPU container from pytorch-gpu=1.11.0; emit cuda version on the topic
- tximeta/tximport (nf-core/modules#11141): fix gene-level crash on mismatched transcript FASTA/GTF
- fastq_fastqc_umitools_trimgalore (nf-core/modules#11228): handle null trim_log in the read-count map
- custom/catadditionalfasta (nf-core/modules#11256): topic-based versions, explicit out/\${prefix}.{fasta,gtf} paths, task.ext.prefix ?: meta.id prefix handling

The custom/catadditionalfasta interface change needs pipeline-side follow-up in conf/modules/prepare_genome.config:

- Fix the stale CAT_ADDITIONAL_FASTA selector (now CUSTOM_CATADDITIONALFASTA) and split PREPROCESS_TRANSCRIPTS_FASTA_GENCODE into its own block.
- Set ext.prefix = "\${params.genome ?: fasta.baseName}_\${add_fasta.baseName}" so output filenames follow the previous {genome}_{add_name} pattern; the new module default (meta.id) would otherwise rename outputs to genome_transcriptome.{fasta,gtf}.

Behaviour note: fixing the withName selector also exposes a pre-existing intent that was masked. CUSTOM_CATADDITIONALFASTA outputs now only publish when --save_reference is set; the stale selector previously let them fall through to the default publishDir and land in <outdir>/custom/out/ regardless of --save_reference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paired-end Trim Galore outputs can cause fq lint after trimming to receive too many FASTQs

2 participants