-
Notifications
You must be signed in to change notification settings - Fork 629
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
Allow closures in file/url for trace
,report
,timeline
,dag
,weblog
#3651
Allow closures in file/url for trace
,report
,timeline
,dag
,weblog
#3651
Conversation
Signed-off-by: Florian De Temmerman <florian.detemmerman@lizard.bio>
Signed-off-by: Florian De Temmerman <florian.detemmerman@lizard.bio>
Signed-off-by: Florian De Temmerman <florian.detemmerman@lizard.bio>
trace
,report
,timeline
,dag
,weblog
trace
,report
,timeline
,dag
,weblog
0d59b4c
to
b93634e
Compare
@pditommaso what do you think about this idea? I think it would be useful to access variables like the run name in the config. I will need to update this PR but the changes appear to be straightforward. |
Not sure we should this, plain |
@pditommaso Thanks for the update. For analysis, we would run the same pipeline multiple times with differerent trials, this is very common in analysis (generate log run1, run2, run3..., the users would remember those runName in their note). The runName is the only unique identiy for the users to remember what they did and recall from nextflow command line. We would not like to change the name in the configuration file each time, especially for the trace or report. A way to automatic those input would be very useful, because users don't need to remember those, and can put it into the $HOME/.nextflow/config for routines. |
Paolo, the main point here is to use the run name in workflow outputs. Can't do that with a param. While I agree that |
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
I'm concerned about the increasing complexity of the configuration file, tho it's true that dynamic values are already supported in the process directives configuration. However, this would bring the inconsistency to yet another level. Why |
In theory, yes every config setting could be dynamic. But because each dynamic setting must be configured manually to accept and evaluate a closure, such dynamic settings have been added on an as-needed basis. I don't think that is a reason against making these particular settings dynamic, unless you want to make some generic solution that makes all settings dynamic. |
✅ Deploy Preview for nextflow-docs-staging canceled.
|
I added |
This could also simplify slightly the convention that nf-core uses. Currently they have to fetch their own timestamp: def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
report.file = "${params.outdir}/pipeline_info/execution_report_${trace_timestamp}.html" With this change they could use the timestamp that Nextflow already creates: report.file = { "${params.outdir}/pipeline_info/execution_report_${workflow.start}.html" } Not sure the best way to format an OffsetDateTime, but you get the idea. This way the timestamps are consistent. |
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
81f7cb7
to
8a43489
Compare
This will introduce yet another exception in the resolution of the config file in which some parts are dynamic and others are not. This use case can be addressed by passing a a custom parameter to give the file a different name. Closing without merging. |
No, it cannot be addressed by a param. They want to use the run name which is only available in the workflow metadata. Not wanting to make more settings dynamic is not a good enough reason to not do it IMO. Allowing closures here would enable something that is currently not possible. |
@fbdtemme @bentsherman Is there any plan on releasing this? |
I don't think so. I suggest using a param as Paolo suggests, even though it requires a bit more logic to set the run name and the param on the command line. I would like to find a way to better control these report filenames, but I think we can find a better way than just using a closure |
This adds the option to pass a closure to the following configuration variables:
trace.file
report.file
timeline.file
dag.file
weblog.url
This closure will be resolved in the script execution context but additionally has access to
workflow
andnextflow
.Closes: #3626