feat: typed parameters - #1103
Draft
dialvarezs wants to merge 4 commits into
Draft
Conversation
Adds a statically typed `params` block generated with the VS Code Nextflow extension, plus manual corrections: - `help` is typed as `String?` so `--help <param>` keeps working (a bare `--help` resolves to the string "true", which utils_nfschema_plugin already special-cases). - optional parameters without a default get the `?` suffix. - file/directory parameters become `Path?`, which lets Nextflow do the existence check itself. `gtdb_db` and `checkm_download_url` stay `String` because their defaults are remote URLs that would then be resolved over the network on every run. - `metaeuk_mmseqs_db` stays `String` (it is a database name, not a path). - parameters whose defaults are configuration-dependent are declared without a default; nextflow.config keeps owning those values. - `deepmased_features_gzip` drops its redundant `= false`.
The typed `params` block in main.nf now owns the defaults. Only values that
other configuration files depend on are kept in nextflow.config: igenomes_base
and igenomes_ignore (read by conf/igenomes.config), the config_profile_* and
custom_config_* values, outdir, publish_dir_mode, monochrome_logs,
pipelines_testdata_base_path and trace_report_suffix.
conf/igenomes.config is converted from the nested `genomes { 'KEY' { ... } }`
syntax to a `params.genomes = ['KEY': [...]]` map literal, which is what the
v2 syntax parser accepts.
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 4.0.3. For more documentation on how to update your pipeline, please see the Synchronisation documentation. |
nf-core tools cannot yet read defaults from a typed `params` block, so it reports nextflow.config and the schema as out of sync. Both checks are disabled until tools catches up. `cli_typecast` is set to false because Nextflow now casts CLI parameters itself from the declared types; letting nf-schema cast them as well can trigger a StackOverflowError.
|
❌ nf-test failed with latest Nextflow versionNote Tests with Nextflow's latest version failed but it will not cause a CI workflow failure.
See the full run for details. |
`ext.args` was a plain list, so it was evaluated while the config was being parsed. Now that min_contig_size has no default in nextflow.config, at that point the parameter is either null or the raw CLI string, and `params.min_contig_size < 1500` throws when a value is passed on the command line. Wrapping it in a closure defers evaluation until the typed parameters are resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).