Skip to content

feat: restrict --input to .sdrf.tsv extension - #78

Merged
ypriverol merged 1 commit into
devfrom
restrict-input-sdrf-tsv
May 4, 2026
Merged

ypriverol merged 1 commit into
devfrom
restrict-input-sdrf-tsv

Conversation

@ypriverol

@ypriverol ypriverol commented May 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make .sdrf.tsv the contract for --input. Previously the schema accepted .sdrf, .tsv, or .csv and the SAMPLESHEET_CHECK module performed in-process normalisation (pandas-based CSV→TSV conversion and .sdrf → .sdrf.tsv rename) — which meant users were on three different conventions for the same thing and a validation step was carrying conversion logic. This PR collapses both:

  • Schema enforcement — nextflow_schema.json --input.pattern tightened from ^\S+\.(?:csv|tsv|sdrf)$ to ^\S+\.sdrf\.tsv$. mimetype switched to text/tab-separated-values. description and help_text rewritten. nf-schema fails fast at startup if the user passes anything else.
  • Module simplification — modules/local/samplesheet_check/main.nf drops the CSV→TSV pandas conversion and the basename rewrite; it now just passes the staged .sdrf.tsv straight to quantmsutilsc checksamplesheet.
  • Docs — README.md, docs/usage.md, docs/parameters.md, and the embedded description in ro-crate-metadata.json updated to "must use the .sdrf.tsv extension". Example invocations renamed from --input sdrf.tsv to --input experiment.sdrf.tsv for consistency.
  • CHANGELOG — entry under [Unreleased] § Changed with a migration note.

Breaking change

Users currently passing .sdrf, .tsv, or .csv will hit:

* --input: string [/path/to/file.tsv] does not match pattern ^\S+\.sdrf\.tsv$

Migration: rename to .sdrf.tsv (e.g. mv experiment.tsv experiment.sdrf.tsv); for .csv inputs convert to TSV first.

Test plan

  • nf-core pipelines schema lint — Pipeline schema looks valid (found 102 params)
  • nf-core pipelines lint — 177 passes / 0 failures / 8 pre-existing warnings carried from the 4.0.2 template sync
  • grep -rEn 'input\s*=\s*["'\''][^"'\'']+\.(tsv|csv|sdrf)["'\'']' conf/tests/ tests/ — no test config references a non-.sdrf.tsv input that would now hard-fail
  • CI: existing ci/merge_ci/extended_ci runs (test_dia, test_dia_dotd, test_dda, ...) — all already use .sdrf.tsv test data

The pipeline always normalised inputs to .sdrf.tsv internally
(SAMPLESHEET_CHECK had a pandas-based .csv → .tsv conversion and a
.sdrf → .sdrf.tsv rename) but the schema let any of .sdrf, .tsv, or
.csv through. That left users on three different conventions for the
same file and required runtime gymnastics in a process whose only
job is to validate.

Make .sdrf.tsv the contract:

- nextflow_schema.json: tighten --input pattern from
  ^\S+\.(?:csv|tsv|sdrf)$ to ^\S+\.sdrf\.tsv$, switch mimetype to
  text/tab-separated-values, and rewrite description / help_text to
  reflect the single accepted extension. nf-schema enforces this at
  startup, so wrong inputs now fail fast with a clear validation
  error rather than silently going through the conversion path.

- modules/local/samplesheet_check/main.nf: drop the in-process
  CSV→TSV conversion and the .sdrf→.sdrf.tsv basename rewrite. The
  staged file is guaranteed to be .sdrf.tsv, so just hand it to
  quantmsutilsc as-is. Removes the pandas dependency from this
  process's hot path and shaves the only nontrivial logic.

- README.md, docs/usage.md, docs/parameters.md, ro-crate-metadata.json:
  update the prose to "must use the .sdrf.tsv extension" and rename
  example inputs from `sdrf.tsv` / `dda_sdrf.tsv` to
  `experiment.sdrf.tsv` / `dda_experiment.sdrf.tsv` for consistency.

- CHANGELOG.md: entry under [Unreleased] § Changed with migration
  note (rename existing samplesheets, convert CSV inputs upstream).

`nf-core pipelines schema lint` and `nf-core pipelines lint` are
green (177 passes, 0 failures, 8 pre-existing warnings carried from
the 4.0.2 template sync).
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f23320d4-b055-439b-9aa3-5f2adbe42bb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch restrict-input-sdrf-tsv

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ypriverol
ypriverol requested a review from yueqixuan May 3, 2026 06:24
@github-actions

github-actions Bot commented May 3, 2026 •

Copy link
Copy Markdown

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

Posted for pipeline commit cc09e83

+| ✅ 108 tests passed       |+
#| ❔  18 tests were ignored |#
!| ❗   4 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: conf/igenomes_ignored.config
  • files_exist - File not found: .github/workflows/awstest.yml
  • files_exist - File not found: .github/workflows/awsfulltest.yml

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.2
  • Run at 2026-05-03 06:24:05

@ypriverol
ypriverol merged commit 5c8c498 into dev May 4, 2026
19 checks passed
@ypriverol
ypriverol deleted the restrict-input-sdrf-tsv branch May 5, 2026 05:11
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.

2 participants