nextflow
nextflow copied to clipboard
Output the theoretical `.command.sh` file when using stub
It would be great if there was a way to run a workflow with -stub
but also get the result of what would have run in the script section.
Currently I have a work around that looks something like this:
script:
def prefix = task.ext.prefix ?: "${meta.id}"
def args = teask.ext.args ?: ""
"""
some command \
$input \
$args
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def args = teask.ext.args ?: ""
command = """
some command \
$input \
$args
"""
"""
echo '${command}'
touch myoutput.txt
"""
But obviously this creates a lot of code duplication and requires one to carefully keep the stub section aligned with every chaneg to the script section.
Suggest implementation
Could be default to output the would-be script to .command.sh.stub
or something.
Or it could be an additional option like --stub-run-verbose
or some such.
I am not sure how easy this would be to implement with how nextflow is written in honesty.