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

nf-core sync will modify the template incorrectly if the pipeline prefix is uppercase #2981

Open
human9 opened this issue May 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@human9
Copy link

human9 commented May 14, 2024

Description of the bug

nf-core sync seems to parse the workflow name incorrectly (?) if the prefix is uppercase, causing problems updating the template.

Steps to reproduce

  • Create a blank pipeline using nf-core create, and provide an uppercase prefix when prompted
    • e.g. create a pipeline called UPPER/pipeline
  • The created template should look normal, under workflows there should be pipeline.nf.
  • Run nf-core sync from the main branch (or dev)

Result

In the TEMPLATE branch, most instances of the workflow name "pipeline" have been renamed to "upper-pipeline". e.g. pipeline.nf is renamed to upper-pipeline.nf.

This doesn't happen when a lowercase prefix is provided instead, i.e. a pipeline called upper/pipeline will not reproduce this.

Command used and terminal output

# no commands actually fail

System information

  • nextflow 24.03.0-edge
  • nf-core: 2.14.1
  • Python 3.12.3
  • Ubuntu 24.04

Extra edit

I had created a pipeline with upper case prefix, and broke it by syncing as described.
There are only two changes I needed to commit to fix it:

  • change to lowercase prefix in .nf-core.yml
  • fix the workflow name in nextflow.config (under manifest).

The next nf-core sync then works as expected.

@human9 human9 added the bug Something isn't working label May 14, 2024
@awgymer
Copy link
Contributor

awgymer commented May 17, 2024

The culprit is

param_dict["name"].lower().replace(r"/\s+/", "-").replace(f"{param_dict['prefix']}/", "").replace("/", "-")

It is converting the 'name' (which at this point contains the prefix, because it is pulled from manifest.name) to lowercase before it tries to replace the prefix value with an empty string.

We have two options:

  • convert name to lowercase after replacing prefix
  • ensure prefix is only ever lowercase on initial creation

@human9
Copy link
Author

human9 commented May 18, 2024

Nice, I guess it's a matter of deciding whether the bug is that name gets mangled, or that an uppercase prefix is allowed at all. My 2 cents is that taking the first option is the less disruptive option, as although it might have been intended otherwise uppercase prefixes are currently allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants