nf-core / nf-core/tools

Schema: Support conditional subschemas

Open
#2,428 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

schema
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of feature

It is quite common to want to have conditional validation for pipeline parameters. Currently, this is not supported and must be done purely within the pipeline code. However, native JSON schema can support it with two properties:

  • dependentSchemas
    • If params.foo is defined at all, then additional validation rules / required parameters for params.bar should apply.
    • Typical use case: if --do_this is enabled, then --this_option must be set
  • If-Then-Else
    • If params.foo matches a specific set of rules, then additional validation rules / required parameters for params.bar should apply.
    • Typical use case: if --method is set to --foo, then --foo_method_option must be set

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the conditional-schema requirements in the issue and the linked JSON Schema references. Trace how nf-core/tools currently validates pipeline parameters; done means dependentSchemas and if/then/else rules work for the described cases and are covered by validation tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.