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

outputDir can't be used as an implicit variable within a config #5543

Open
SPPearce opened this issue Nov 26, 2024 · 4 comments · May be fixed by #5502
Open

outputDir can't be used as an implicit variable within a config #5543

SPPearce opened this issue Nov 26, 2024 · 4 comments · May be fixed by #5502

Comments

@SPPearce
Copy link
Contributor

Bug report

outputDir can't be used as an implicit variable within a config.
This means it can't be used within report to set the location of the report dynamically.

Expected behavior and actual behavior

outputDir = "output_test"
report {
    enabled = true
    file    = "${outputDir}/pipeline_info/execution_report.html"
}

should put the report inside the outputDir, but instead gives

ERROR ~ Unknown config attribute `report.outputDir` 

Environment

  • Nextflow version: 24.10.1

Additional context

Confirmed as an issue by @bentsherman :

I'm now seeing we forgot to add outputDir as an implicit variable in the config

@bentsherman bentsherman linked a pull request Nov 26, 2024 that will close this issue
6 tasks
@bentsherman
Copy link
Member

Looks like this error only happens if outputDir isn't explicitly defined in the config. So the example you gave is actually the workaround until we get it fixed

bentsherman added a commit that referenced this issue Dec 11, 2024
@siddharthab
Copy link
Contributor

siddharthab commented Jan 15, 2025

I think even if we do declare a default value in the config, any interpolations within the config do not get the overridden value from the -output-dir CLI flag. So we will need more than f2e675d.

So something like the below will always write the report to a results directory regardless of the value of -output-dir.

report {
    enabled = true
    file    = "${outputDir}/pipeline_info/execution_report.html"
}

@bentsherman
Copy link
Member

That's a good point. I believe the same issue exists with workDir, which can be set on the command line or in the config. The only difference is that you should never really need to reference the workDir in the config.

The broader issue IMO is that these report file paths are a rough edge. See for example #3626 and #5364 . I've long suspected that these report paths would be a lot easier to manage if they could be specified in the script somehow, maybe as part of the new workflow outputs. That way...

  • you don't have to specify outputDir at all, just the relative path
  • you can use runtime info like the run name, session id, etc in the report path

Need to think more on this problem.

@SPPearce
Copy link
Contributor Author

I wanted to save the report file in two locations recently, but I wasn't able to do that with how it is currently specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants