Skip to content

with NXF_SYNTAX_PARSER=v2, outputDir value not parsed for reports #6363

@andreiprodan

Description

@andreiprodan

Bug report

When using the strict syntax (NXF_SYNTAX_PARSER=v2), the value of params.outputDir used in pipeline reports file paths (i.e. timeline, report, trace, dag) in nextflow.config is not overridden by command line.

Expected behavior and actual behavior

With the nextflow.config below, different behaviours are observed when running a pipeline with v1 and or v2 syntax:

params { 
 outputDir = 'results'
}

timeline {
    enabled = true
    file    = "${params.outputDir}/pipeline_info/execution_timeline_${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.html"
}
report {
    enabled = true
    file    = "${params.outputDir}/pipeline_info/execution_report_${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.html"
}
trace {
    enabled = true
    file    = "${params.outputDir}/pipeline_info/execution_trace_${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.txt"
}
dag {
    enabled = true
    file    = "${params.outputDir}/pipeline_info/pipeline_dag_${new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')}.html"
}
  • with NXF_SYNTAX_PARSER=v1:
    • adding either --outputDir other_results or --output-dir other_results to the nextflow run command will override the value of params.outputDir throughout the pipeline, including for the timeline, report, trace, tag report files with files paths defined in the nextflow.config
  • with NXF_SYNTAX_PARSER=v2:
    • adding either --outputDir other_results or --output-dir other_results to the nextflow run command will only override the value of params.outputDir for regular outputs; the timeline, report, trace, tag report files with files path defined in the nextflow.config will still be save in results
  • with either v1 or v2 sintax, adding -output-dir other_results (one dash at the start, not 2 dashes, as mentioned in current Nextflow documentation does not override params.outputDir at all

Steps to reproduce the problem

With the nextflow.config lines above, run a Nextlfow pipeline with identical parameters first with v1 syntax ( export NXF_SYNTAX_PARSER=v1) then with v2 syntax (export NXF_SYNTAX_PARSER=v2) and examine outputs

Program output

with v1 syntax:

  • adding either --outputDir other_results or --output-dir other_results to the nextflow run command leads to all pipeline outputs and the timeline, report, trace, tag reports begin saved in other_results (as expected)

with v2 syntax:

  • adding either --outputDir other_results or --output-dir other_results to the nextflow run command leads to:
    • pipeline outputs being saved in other_results (as expected)
    • timeline, report, trace, tag reports are saved in results (the outputDir value coded in the nextflow.config), not in other_results - this is not expected

Environment

  • Nextflow version: 25.04.6 build 5954
  • Java version: openjdk version "17.0.16"
  • Operating system: Ubuntu 24.04 LTS
  • Bash version: GNU bash, version 5.1.16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions