nf-core / nf-core/tools

Cannot patch subworkflows if you include a function in it

Open
#4,084 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of the bug

If you have a function stored in a Nextflow file:

functions/main.nf:

def helloWorld() {
    println "Hello world!"
}

And then add this function to an existing nf-core subworkflow:

include { helloWorld } from 'functions/main.nf'

workflow TEST {
    ...
    helloWorld()
}

then nf-core modules patch fails as it tries to parse configs:

~/P/genomeassembly index_files• ❱ nf-core subworkflows --git-remote https://github.com/sanger-tol/nf-core-modules.git patch cram_map_illumina_hic                                             (nextflow)


                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 3.5.2 - https://nf-co.re


ERROR    'helloWorld'
Command used and terminal output
(here the function being included is called `deepClone()`) - verbose output: https://pastebin.com/tVd1Dm5E
System information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the nf-core subworkflows ... patch entry point and reproduce the failure using an included Nextflow function such as helloWorld() or deepClone(). Trace the config-parsing path that raises the function name error; done means patching the existing subworkflow succeeds when it includes and calls a function.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.