nf-core / nf-core/tools

Add check if parameters are specified via `.config` file to pipeline template

Open
#2,184 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description of feature

Specifying parameters via -c custom.config can make problems with DSL2 workflows. The corresponding documentation was added in https://github.com/nf-core/tools/pull/2173.

I'm afraid there's still a considerable number of users following this practice, and in the worst case this may lead to incorrect results because parameters are silently ignored. Having a loud warning (or even error) when a workflow with a custom config file is started would be great!

I prototyped this snipped, and it seems to work in principle. However, it would need some tuning that it doesn't raise an error for the config file that defines the default parameters.

def check_config_files(workflow) {
    for (config_file in workflow.configFiles) {
        if (file(config_file).text.contains("parameters")) {
            println "WARNING: Do not specify parameters via a .config file."
        }
    }
}

workflow {
    check_config_files(workflow)
}

Maybe someone can take this on at the hackathon?

CC @jfy133

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 pipeline template and the workflow.configFiles behavior shown in the issue. Check how the default-parameter config is distinguished from custom config files, then verify that a warning or error appears only when parameters are specified in a custom .config file.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.