-
Notifications
You must be signed in to change notification settings - Fork 638
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
Process prolog and epilog #540
Comments
This can be a little harder than expect. The basic idea was to prepend/append the user script with the It cannot either included in the command launcher ie. |
This is due to the issue of not adding the In my case, I need to execute some bash scripts (which are in the |
No, this happens because it's the One solution, that I would like to avoid it to use an intermediate wrapper that contains the A better alternative, could be to embed the user |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump |
With the usage of this functionality coming up in some nf-core workflows (see discussion here) as well as independent users, perhaps this might be an useful feature to implement in NF. Building upon the idea shared earlier in the thread, I'm adding relevant doc links for reference https://tldp.org/LDP/abs/html/here-docs.html |
Regarding the nf-core tool version calls, see this related issue: #879 Thinking about it now, it might be good to have both Also need to think about how staging files in and out will work. For example, with the above scenario, overwriting If Final point: I would personally spell it |
It's a programming lang not Shakespeare 😆 |
haha 😆 Ok if it's a well known programming term that's fine. I mis-typed it about 4 times in that past issue before googling it to check I wasn't going insane. I haven't come across it in code before. |
Perhaps the issue regarding the Thoughts? NOTE: Just wanted to confirm that we all agree this the |
Tower is nice, but we want the version numbers even when people are running without Tower 😉 I view it as a fairly essential output from the pipeline. |
Yeah, we discussed ages ago .. 😬 #879 |
Maybe related to prelog epilog concept. I have been thinking about one case: fileA -> fileB; fileB->fileC (fileC will be used for down stream process); fileB--compress-->fileB.gz, will not be used for any process, but want to publish it for later usage. In order to make my workflow faster, I don't want to wait for the compression to finish before lettig the fileC to be used for downstream processes. My question, is the current workflow language taking advantage of this? Do the donwstream process wait for the complete completion before its output being used by downstream processes? Or the result can be used as soon as the file is finished (this may not be possible because you have to wait for the completion of all command in the scripts section to finish). Might be beneficial to make the process separate the script section into the current scripts, and another section background_scripts. |
In that case, you should define two separate processes, one to produce fileC and another to compress fileC. Any downstream processes can depend only on the first process while the second process would run "in the background". |
That's how my workflow is designed. Only in special cases, where my files are large. The processes are done on the scratch. To avoid copying files, I did the opposite of normally we do, merged several processes into one. This is very rare. And it is only for performance. Essentially, we have large gzped fastq files. So do some operation with them. one way is to use the compressed as input, you then decompress on the fly. This saves space. Another way, is to inflate the .gz files, first, then do operations on them this can speed up. but at the cost of more storage usage. If we move the operation to /scratch, then the IO problem can be resolved. We want the main logic to process using inflated files, at the end of this main process, the downstream can start working with the result files from these large file, mean time, we can keep on compressing these file with high compression level then store these compressed file for future use (not this pipeline). There might be a possibility to enable the script section to branch. Currently script section is an atomic operation. |
I used the following approach for now: process {
...
script:
def prolog = task.ext.prolog ?: ''
...
"""
$prolog
<actual script>
""""
}
And then I use I'm in favor for nextflow-based solution. |
thanks for the feedback.
|
@ewels Thanks for the hint. I do not understand the suggestion, though. (As a side remark, |
Yeah you're right. I was thinking that |
Added the missing reference to |
The goal of this enhancement is to add two new process directives, namely:
prolog
andepilog
that would make it possible to add to process task a common script prefix and suffix.These are different from beforeScript and afterScript directives that are designed mainly for custom task configuration and, above all, are execute in the task wrapper context, that can be a separated environment from the task execution one (in particular when using containers).
Instead
prolog
content should be prepended to the user script just after the shebang declaration andepilog
should appended to the user task script.The text was updated successfully, but these errors were encountered: