Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented behavior - Duplicated workflow parameters when using specific naming conventions #4990

Open
JaimeSeqLabs opened this issue May 10, 2024 · 1 comment · May be fixed by #4702
Open

Comments

@JaimeSeqLabs
Copy link

Bug report

Expected behavior and actual behavior

Expected behavior:
When running a workflow with a -params-file in json format, I expect the params property to contain only the provided keys set in the json file.

Actual behavior:
While the key (and values) set in the parameters file are accessible through the params property to the workflow, additional parameters are being added with a key derived from the original one.
This only happens if the parameter are named using camel case and/or kebab case naming conventions (i.e. camelCase, kebab-case).
When setting a parameter named testParam nextflow will add an additional test-param parameter to params property that was not present in the file.

Steps to reproduce the problem

Create nextflow and parameters file:

main.nf:

workflow {
    log.info "Params map: $params"
}

params.json:

{
    "camelCase": "test",
    "kebab-case": "test",
    "normal": "test"
}

Run the nf file with the parameters file:

$> nextflow run main.nf -params-file params.json 

Program output

N E X T F L O W  ~  version 22.10.2
Launching `main.nf` [lethal_laplace] DSL2 - revision: 47784e7723
Params map: [camelCase:test, camel-case:test, kebab-case:test, kebabCase:test, normal:test]

Notice that the camel case and kebab case parameters are duplicated while the "normal" parameter is not.

Environment

  • Nextflow version: 22.10.2
  • Java version: 17 OpenJDK Temurin-17.0.6+10
  • Operating system: Linux
  • Bash version: bash 5.1.16
@bentsherman
Copy link
Member

Should be addressed by #4702 . Any kebab-case param from the CLI should be converted to camelCase and not stored, since kebab case params can't be accessed from the script anyway

@bentsherman bentsherman linked a pull request May 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants