The new schema breaks due to strict parsing due to...
# nf-schema
ö
The new schema breaks due to strict parsing due to casting thing.
params
that are supposed to be integer like
params.foo = 10
are passed as strings to the pipeline at runtime. It requires to define them
as Integer
in the main workflow to restore the functionality. Where is the best way to define this if there are too many
params
like this?
n
This should be fixed in nf-schema 2.7.2, could you give that a try?
party this 1
ö
Actually I'm already using 2.7.2 and having this problem.
n
Could you make a small reproducible example of this issue? It's pretty strange 🤔
ö
Please try this:
Copy code
$ nextflow run nf-core/methylseq -revision master -latest -resume -profile docker,test --outdir results -work-dir work --aligner bismark --clip_r1 8

 N E X T F L O W  ~ version 26.04.0

Pulling nf-core/methylseq:master ...
 Already-up-to-date
Launching `<https://github.com/nf-core/methylseq>` [distraught_poincare] revision: 5aa56467a8 [master]

WARN: Unrecognized config option 'validation.defaultIgnoreParams'
WARN: Unrecognized config option 'validation.monochromeLogs'

------------------------------------------------------
                    ,--./,-.
    ___   __  __  __  ___   /,-._.--~'
 |\ | |__ __ / ` / \ |__) |__     } {
 | \| |    \__, \__/ | \ |___   \`-._,-`-,
                    `._,._,'
 nf-core/methylseq 4.2.0
------------------------------------------------------

Input/output options
 input           : /home/yoyo/.nextflow/assets/.repos/nf-core/methylseq/clones/5aa56467a85a5e2d6795ea72dfa5a5f0c9babc23/assets/samplesheet.csv
 outdir          : results

Reference genome options
 fasta           : <https://raw.githubusercontent.com/nf-core/test-datasets/methylseq/reference/genome.fa.gz>
 fasta_index        : <https://raw.githubusercontent.com/nf-core/test-datasets/methylseq/reference/genome.fa.fai>

Adapter Trimming
 clip_r1          : 8

Institutional config options
 config_profile_name    : Test profile
 config_profile_description: Minimal test dataset to check pipeline function

Generic options
 trace_report_suffix    : 2026-05-05_11-27-27

Core Nextflow options
 revision         : master
 runName          : distraught_poincare
 containerEngine      : docker
 launchDir         : /home/yoyo/test
 workDir          : /home/yoyo/test/work
 projectDir        : /home/yoyo/.nextflow/assets/.repos/nf-core/methylseq/clones/5aa56467a85a5e2d6795ea72dfa5a5f0c9babc23
 userName         : yoyo
 profile          : docker,test
 configFiles        : /home/yoyo/.nextflow/assets/.repos/nf-core/methylseq/clones/5aa56467a85a5e2d6795ea72dfa5a5f0c9babc23/nextflow.config

!! Only displaying parameters that differ from the pipeline defaults !!
------------------------------------------------------

* The pipeline
  <https://doi.org/10.5281/zenodo.1343417>

* The nf-core framework
  <https://doi.org/10.1038/s41587-020-0439-x>

* Software dependencies
  <https://github.com/nf-core/methylseq/blob/master/CITATIONS.md>

ERROR ~ Validation of pipeline parameters failed!

 -- Check '.nextflow.log' file for details
The following invalid input values have been detected:

* --clip_r1 (8): Value is [string] but should be [integer]

 -- Check script '/home/yoyo/.nextflow/assets/.repos/nf-core/methylseq/clones/5aa56467a85a5e2d6795ea72dfa5a5f0c9babc23/subworkflows/nf-core/utils_nfschema_plugin/main.nf' at line: 68 or see '.nextflow.log' file for more details
n
It doesn't seem like the pipeline is already strict syntax compliant. I even get another error when trying to run the pipeline:
Copy code
$ NXF_VER=26.04.0 nextflow run nf-core/methylseq -revision master -latest -resume -profile docker,test --outdir results -work-dir work --aligner bismark --clip_r1 8

 N E X T F L O W   ~  version 26.04.0

Pulling nf-core/methylseq:master ...
 downloaded from <https://github.com/nf-core/methylseq.git>
Error nextflow.config:251:23: Invalid include source: '/home/nvnieuwk/.nextflow/assets/.repos/nf-core/methylseq/clones/5aa56467a85a5e2d6795ea72dfa5a5f0c9babc23/conf/aws/batch/nextflow.config'
│ 251 |     aws_batch       { includeConfig 'conf/aws/batch/nextflow.config' }
╰     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ERROR ~ Config parsing failed

 -- Check '.nextflow.log' file for details
ö
Yes I know, created an issue for that. For now, I manually fixed it in the local file to get to the above error.
n
Yes I also did that now, retrying the execution 😛
Ah another strict syntax error now, this pipeline should be fixed first 😅
ö
You need to fix a couple more before reaching there 😅
n
Maybe run it using an older version of Nextflow for now, that should also solve your issue
ö
Haha, I am using a modified version of the pipeline, so it’s not an option. I had to implement
as Integer
many places to fix the original issue which looks a bit ugly in the code now but at least it works.
n
What did you modify? It might be worth it to push those changes upstream so everyone can benefit from that?
I'm not sure I can help you much with code I can't see 😁
ö
So many changes and internal deadlines to push to the upstream 😅 But basically first it must be fixed at the main workflow file like this:
main:
['clip_r1', 'clip_r2', 'three_prime_clip_r1', 'three_prime_clip_r2',
'nextseq_trim', 'ignore_r1', 'ignore_r2', 'ignore_3prime_r1', 'ignore_3prime_r2',
'min_depth'].each { params[it] = params[it] as Integer }
Then the same also in the config files wherever params is used for comparison.
For example:
process {
withName: BISMARK_METHYLATIONEXTRACTOR {
ext.args = { [
params.comprehensive   ? ' --comprehensive' : '',
params.meth_cutoff     ? " --cutoff ${params.meth_cutoff}" : '',
params.nomeseq         ? '--CX' : '',
params.ignore_r1 as Integer > 0        ? "--ignore ${params.ignore_r1}" : '',
params.ignore_3prime_r1 as Integer > 0 ? "--ignore_3prime ${params.ignore_3prime_r1}" : '',
meta.single_end ? '' : (<http://params.no|params.no>_overlap                          ? '--no_overlap'                          : '--include_overlap'),
meta.single_end ? '' : (params.ignore_r2 as Integer        > 0     ? "--ignore_r2 ${params.ignore_r2}"       : ""),
meta.single_end ? '' : (params.ignore_3prime_r2 as Integer > 0     ? "--ignore_3prime_r2 ${params.ignore_3prime_r2}": "")
].join(' ').trim() }
publishDir = [
[
path: { "${params.outdir}/${params.aligner}/methylation_calls/mbias" },
mode: params.publish_dir_mode,
pattern: "*M-bias.txt"
],
[
path: { "${params.outdir}/${params.aligner}/methylation_calls/methylation_coverage" },
mode: params.publish_dir_mode,
pattern: "*cov.gz"
],
[
path: { "${params.outdir}/${params.aligner}/methylation_calls/bedGraph" },
mode: params.publish_dir_mode,
pattern: "*bedGraph.gz"
],
[
path: { "${params.outdir}/${params.aligner}/methylation_calls/splitting_report" },
mode: params.publish_dir_mode,
pattern: "*splitting_report.txt"
],
[
path: { "${params.outdir}/${params.aligner}/methylation_calls/methylation_calls" },
mode: params.publish_dir_mode,
pattern: "*txt.gz"
]
]
}
}
n
Yeah this is going to be the main pitfall 26.04. 26.10 will introduce static typing which will solve all these issues 😕