nextflow icon indicating copy to clipboard operation
nextflow copied to clipboard

The value taken by a parameter is affected by uppercase letters in the parameter name

Open fortune9 opened this issue 3 years ago • 1 comments

Bug report

Expected behavior and actual behavior

The uppercase and lowercase parameters behave differently in value override. For example, the parameters params.msg and params.msG in the following workflow takes the values from different scopes, just because their names containing uppercase letters or not.

Expectation: both parameters should behave the same, no matter whether there are uppercase letters in the parameter names.

Steps to reproduce the problem

file: wf_addparams.nf

nextflow.enable.dsl=2

params.msg="workflow msg lower case"
params.msG="workflow msg upper case"

// include the process
include { print_msg } from \
    './msg.nf' addParams (
        msg: "include msg lower case",
        msG: "include msg upper case"
        )


workflow {
    print_msg()
}

The included process file is as follows: file: msg.nf

process print_msg {

    echo true

    script:
    """
    echo msg: ${params.msg}
    echo msG: ${params.msG}
    """
}

Program output

  • Run 1

    • Command nextflow run ./wf_addparams.nf
    • Output N E X T F L O W ~ version 22.04.5 Launching ./wf_addparams.nf [soggy_swirles] DSL2 - revision: 61b19cc590 WARN: The echo directive has been deprecated - use to debug instead executor > local (1) [ef/9126b4] process > print_msg [100%] 1 of 1 ✔ msg: include msg lower case msG: workflow msg upper case
    • Problem: as you can see, params.msg takes the value set at addParams, while params.msG takes the global value set at the beginning of the workflow file.
  • Run 2

    • Command nextflow run ./wf_addparams.nf--msg "cmd msg lower case" --msG "cmd msg upper case"
    • Output N E X T F L O W ~ version 22.04.5 Launching ./wf_addparams.nf [sad_turing] DSL2 - revision: 61b19cc590 WARN: The echo directive has been deprecated - use to debug instead executor > local (1) [50/bebd58] process > print_msg [100%] 1 of 1 ✔ msg: include msg lower case msG: cmd msg upper case
    • Problem: again, params.msg takes the value set at addParams, while params.msG takes the value set at the command line.

Environment

  • Nextflow version: 22.04.5
  • Java version: openjdk version "17.0.5"
  • Operating system: 18.04.1-Ubuntu
  • Bash version: GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

fortune9 avatar Dec 06 '22 23:12 fortune9

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 21 '23 14:05 stale[bot]