Skip to content

New module: fairbioheaders/validate - #13509

Draft
adamjohnwright wants to merge 1 commit into
nf-core:masterfrom
adamjohnwright:fairbioheaders-validate
Draft

adamjohnwright wants to merge 1 commit into
nf-core:masterfrom
adamjohnwright:fairbioheaders-validate

Conversation

@adamjohnwright

Copy link
Copy Markdown

Adds fairbioheaders/validate, which wraps bioheaders validate from fair-bioheaders. It validates standalone FAIR-bioHeaders metadata (FHR, FHP or FHGFF3, as JSON, YAML or JSON-LD) against the schema its schema URL selects, without a sequence file.

Motivation: in nf-core/genomeassembler#250 the per-sample metadata comes from user configuration. Checking it at the start of a run catches mistakes before hours of assembly, rather than at the export step. For files that already carry a header, fairbioheaders/verify is the counterpart.

Input: [ meta, metadata ].
Outputs:

  • report: <prefix>.validate.txt, naming the file and the result
  • the version, via topic: versions

Notes for reviewers:

  • Software: Bioconda fair-bioheaders=0.8.5 (MPL-2.0, bio.tools fair-bioheaders). Containers were built with nf-core modules containers create (Seqera, linux/amd64 and linux/arm64). About 1,950 of the added lines are the two generated .conda-lock files.
  • Version: bioheaders --version prints a bare version (0.8.5), emitted via topic: versions.
  • Shell quoting: file names and prefix are single-quoted in the script, and -- comes before positional arguments, because sample IDs in assembly pipelines can contain spaces, quotes or a leading - (tested by hand with it's $x and -dash). Happy to drop this if reviewers prefer the plainer style.
  • Test data: only existing nf-core/test-datasets files. The metadata is a few lines of YAML written inline with collectFile, so no test-datasets PR is needed; I can move it to test-datasets if preferred.
  • Licence of the module code: these files started as nf-core-style modules in FAIR-bioHeaders-Nextflow (MPL-2.0) and were reworked here. Its copyright holders (@molikd, who designed it, and @adamjohnwright) contribute it to nf-core/modules under the MIT licence.
  • Report output: the useful signal is the exit status (invalid metadata fails the task). The short report gives the module a file output that carries meta, so pipelines can gate downstream steps on it.
  • Independence: this module has no dependency on the other fairbioheaders PRs.
  • Tests (7): FHR as YAML and JSON, FHP, FHGFF3, a missing required field (fails), an unsupported schema version (fails), and a stub.

AI assistance: the module was prepared with Claude Code (Claude Opus 5.5), which also ran an adversarial review. I have reviewed the code, the tests and the snapshots, and I will handle review comments.

Generated by Claude Code

PR checklist

Part of #13491 (second of four fairbioheaders modules; independent of #13492).

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR. (Not needed: tests use nf-core/test-datasets files plus small inline metadata.)
  • Remove all TODO statements.
  • Broadcast software version numbers to topic: versions - See version_topics
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity (not run locally; the Seqera Singularity image was pulled and smoke-tested by hand)
      • nf-core modules test <MODULE> --profile conda

🤖 Generated with Claude Code

Add FAIRBIOHEADERS_VALIDATE, which wraps `bioheaders validate` from the
fair-bioheaders toolkit to validate standalone FAIR-bioHeaders metadata
(FHR, FHP or FHGFF3, as JSON, YAML or JSON-LD) against its schema without
a sequence file. Invalid metadata, or metadata citing a schema version the
toolkit does not bundle, fails the task.

Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@adamjohnwright

Copy link
Copy Markdown
Author

On the size warning: as with #13492, this is one module. 1,955 of the added lines are the two generated .conda-lock files from nf-core modules containers create. The hand-written part is main.nf (44 lines), meta.yml (107) and the tests (287), plus the snapshot (132).

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.

1 participant