While using the `validateParameters` function from...
# nostupidquestions
p
While using the
validateParameters
function from
nf-schema
I've noticed that if I pass a boolean to a param which is expected to be a string, that doesn't raise any error. Is that something you have seen?
j
Yup 😄, all you have to do is patch nf-schema to the most recent version. https://nf-co.re/blog/2026/parameter-types
p
Thanks!
the latest version raises an exception when a string is passed through the command line instead of the expected boolean. but the problem is that the param is not casted into a boolean so it's always true.
so my only option is to refactor using the new types generated by
convert script to static types
? also the docs say that i need to bump the minimal version to 26.04.0...
j
mmh... not entirely certain what your options here are. I haven’t done a deep dive into this yet. @Maxime Garcia could you help, i see nicolas is on holiday.
p
I'm struggling even with
nf-schema@2.7.2
(but not following the entire procedure described in the blog post). The boolean command line arguments, if set to false, never trigger the expected branches in the pipeline. On the contrary if set in the yaml, they work as expected. I am thinking of add a simple type casting function during the pipeline initialisation process. My main worry is that the pipeline docs all refer to params set in the command line, so they are not gonna work...
m
What's the error you see at the moment?
p
If I set a param = false from the cli the branch which checks that doesn't run, if instead a set the param = false in the params.yml and I pass that it works
m
oh I see
so it fails the validation
p
it passes the validation that's the strange thing
with nf-schema@2.7.2 it's recognised as a boolean but then it just ignores that
m
1 solution to test out, adding this params to the defaultIgnoreParams list in the nextflow.config
p
ok checking that, thanks!
this is by setting
skip_bigwig = false
in the yaml. As you can see
BEDGRAPH_TO_BIGWIG_FORWARD
is called
Copy code
QC options
  skip_bigwig                 : false

Alignment options
  pseudo_aligner              : null

DEXSeq DEU options
  dexseq_exon                 : false

edgeR DEU options
  edger_exon                  : false

DEXSeq DTU options
  dexseq_dtu                  : false

SUPPA options
  suppa                       : false

isoformswitchanalyzer options
  isoformswitchanalyzer       : false

Core Nextflow options
  runName                     : stupefied_yalow
  containerEngine             : docker
  launchDir                   : /home/paolo/rnasplice
  workDir                     : /home/paolo/rnasplice/work
  projectDir                  : /home/paolo/rnasplice
  userName                    : paolo
  profile                     : docker
  configFiles                 : /home/paolo/rnasplice/nextflow.config, /home/paolo/rnasplice/conf/test_rmats.config

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

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

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

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

WARN: The following invalid input values have been detected:

* --trace_report_suffix: 2026-06-04_12-17-42


WARN: Access to undefined parameter `gff` -- Initialise it to a default value eg. `params.gff = some_value`
WARN: Access to undefined parameter `star_index` -- Initialise it to a default value eg. `params.star_index = some_value`
WARN: Access to undefined parameter `salmon_index` -- Initialise it to a default value eg. `params.salmon_index = some_value`
executor >  local (6)
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:GUNZIP_FASTA                                   [  0%] 0 of 1
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:GTF_GENE_FILTER                                -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:MAKE_TRANSCRIPTS_FASTA                         -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:SAMTOOLS_FAIDX                                 -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:STAR_GENOMEGENERATE                            -
[-        ] NFCORE_RNASPLICE:RNASPLICE:CAT_FASTQ                                           -
[97/341977] NFCORE_RNASPLICE:RNASPLICE:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:FASTQC (ERR188428) [ 25%] 1 of 4
[e6/695f65] NFC…NASPLICE:RNASPLICE:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE (ERR188428) [ 25%] 1 of 4
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:STAR_ALIGN                               -
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT    -
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX   -
[-        ] NFC…PLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_STATS -
[-        ] NFC…CE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_FLAGSTAT -
[-        ] NFC…CE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_IDXSTATS -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:CREATE_BAMLIST                                -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:RMATS_PREP                                    -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:RMATS_POST                                    -
[8e/7f2a54] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:GTF_2_GFF3                           [100%] 1 of 1 ✔
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_INDEX                           [  0%] 0 of 1
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_RUN                             -
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_SETTINGS                        -
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_SASHIMI                         -
[-        ] NFCORE_RNASPLICE:RNASPLICE:SALMON_QUANT_STAR                                   -
[-        ] NFCORE_RNASPLICE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:UNTAR                  -
[27/328245] NFC…CE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:GFFREAD_TX2GENE (genes_chrX.gtf) [100%] 1 of 1 ✔
[-        ] NFCORE_RNASPLICE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:TXIMPORT               -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDTOOLS_GENOMECOV_FORWARD                          -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDTOOLS_GENOMECOV_REVERSE                          -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDGRAPH_TO_BIGWIG_FORWARD:UCSC_BEDCLIP             -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDGRAPH_TO_BIGWIG_FORWARD:UCSC_BEDGRAPHTOBIGWIG    -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDGRAPH_TO_BIGWIG_REVERSE:UCSC_BEDCLIP             -
[-        ] NFCORE_RNASPLICE:RNASPLICE:BEDGRAPH_TO_BIGWIG_REVERSE:UCSC_BEDGRAPHTOBIGWIG    -
this is by passing
--skip_bigwig false
As you can see the param is validated and appears as a custom value, but the processes are not triggered.
Copy code
QC options
  skip_bigwig                 : false

Alignment options
  pseudo_aligner              : null

DEXSeq DEU options
  dexseq_exon                 : false

edgeR DEU options
  edger_exon                  : false

DEXSeq DTU options
  dexseq_dtu                  : false

SUPPA options
  suppa                       : false

isoformswitchanalyzer options
  isoformswitchanalyzer       : false

Core Nextflow options
  runName                     : extravagant_shockley
  containerEngine             : docker
  launchDir                   : /home/paolo/rnasplice
  workDir                     : /home/paolo/rnasplice/work
  projectDir                  : /home/paolo/rnasplice
  userName                    : paolo
  profile                     : docker
  configFiles                 : /home/paolo/rnasplice/nextflow.config, /home/paolo/rnasplice/conf/test_rmats.config

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

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

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

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

WARN: The following invalid input values have been detected:

* --trace_report_suffix: 2026-06-04_12-19-50


WARN: Access to undefined parameter `gff` -- Initialise it to a default value eg. `params.gff = some_value`
WARN: Access to undefined parameter `star_index` -- Initialise it to a default value eg. `params.star_index = some_value`
WARN: Access to undefined parameter `salmon_index` -- Initialise it to a default value eg. `params.salmon_index = some_value`
executor >  local (11)
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:GUNZIP_FASTA                                   [  0%] 0 of 1
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:GTF_GENE_FILTER                                -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:MAKE_TRANSCRIPTS_FASTA                         -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:SAMTOOLS_FAIDX                                 -
[-        ] NFCORE_RNASPLICE:PREPARE_GENOME:STAR_GENOMEGENERATE                            -
[-        ] NFCORE_RNASPLICE:RNASPLICE:CAT_FASTQ                                           -
[d4/039d5a] NFCORE_RNASPLICE:RNASPLICE:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:FASTQC (ERR188454) [ 75%] 3 of 4
[45/b1c5b8] NFC…NASPLICE:RNASPLICE:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE (ERR188454) [100%] 4 of 4 ✔
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:STAR_ALIGN                               -
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT    -
[-        ] NFCORE_RNASPLICE:RNASPLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX   -
[-        ] NFC…PLICE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_STATS -
[-        ] NFC…CE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_FLAGSTAT -
[-        ] NFC…CE:ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:SAMTOOLS_IDXSTATS -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:CREATE_BAMLIST                                -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:RMATS_PREP                                    -
[-        ] NFCORE_RNASPLICE:RNASPLICE:RMATS:RMATS_POST                                    -
[ca/74d0ca] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:GTF_2_GFF3                           [100%] 1 of 1 ✔
[2b/ee6980] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_INDEX                           [  0%] 0 of 1
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_RUN                             -
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_SETTINGS                        -
[-        ] NFCORE_RNASPLICE:RNASPLICE:VISUALISE_MISO:MISO_SASHIMI                         -
[-        ] NFCORE_RNASPLICE:RNASPLICE:SALMON_QUANT_STAR                                   -
[-        ] NFCORE_RNASPLICE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:UNTAR                  -
[02/fe631c] NFC…CE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:GFFREAD_TX2GENE (genes_chrX.gtf) [100%] 1 of 1 ✔
[-        ] NFCORE_RNASPLICE:RNASPLICE:TX2GENE_TXIMPORT_STAR_SALMON:TXIMPORT               -
[-        ] NFCORE_RNASPLICE:RNASPLICE:MULTIQC                                             -
m
I can indeed see it appearing in the list, but it is getting triggered?
p
yes it works with the yaml
this confirms that the param is passed as a string to the workflow. I've added this snippet at the beginning of the pipeline:
Copy code
if (params.skip_bigwig instanceof String) {
        <http://log.info|log.info>("skip_bigwig parameter is a String: '${params.skip_bigwig}'. Attempting to cast to Boolean.")
        params.skip_bigwig = params.skip_bigwig.toBoolean()
    } else {
        <http://log.info|log.info>("skip_bigwig parameter is already a Boolean: ${params.skip_bigwig}")
    }

    if (!params.skip_bigwig instanceof Boolean) {
        log.error("skip_bigwig parameter is not a Boolean after attempted casting. Current value: ${params.skip_bigwig} (${params.skip_bigwig.getClass()})")
    }
and indeed I get the expected error:
Copy code
skip_bigwig parameter is a String: 'false'. Attempting to cast to Boolean.
-[nf-core/rnasplice] Pipeline completed with errors-
WARN: Killing running tasks (2)
ERROR ~ skip_bigwig parameter is not a Boolean after attempted casting. Current value: false (class java.lang.String)
I understand that params are immutable after launching the workflow, so I don't know what workaround there could except casting to another local var every time I need a non-string param value... The blog post shows the procedure to make it work with the new schema, but to be fair it's too much to do and there's many things that can go wrong. Also I want to keep the compatib with nf 25.10.4
I've decided to go with the new static typing, the igenomes is a bit tricky but now it all works. Just waiting for the CI to end (hopefully successfully).