James Fellows Yates
01/17/2025, 7:35 AMdef args that we don't use within the code execution.
What would people think of adding a echo ${args} to the stub execution code block to satisfy the language server. Also I guess when running a stub run you can also test ext.args is wroking properly.
Alternative'l we could remove the def args from stubs
thoughts?Sateesh_Peri
01/17/2025, 7:38 AMJames Fellows Yates
01/17/2025, 7:38 AMSateesh_Peri
01/17/2025, 7:39 AMSateesh_Peri
01/17/2025, 7:39 AMJames Fellows Yates
01/17/2025, 7:40 AMSateesh_Peri
01/17/2025, 7:40 AMJames Fellows Yates
01/17/2025, 7:40 AMJames Fellows Yates
01/17/2025, 7:40 AMMaxime Garcia
01/17/2025, 7:47 AMJames Fellows Yates
01/17/2025, 7:47 AMJames Fellows Yates
01/17/2025, 7:47 AMMaxime Garcia
01/17/2025, 7:47 AMMahesh Binzer-Panchal
01/17/2025, 7:47 AMMaxime Garcia
01/17/2025, 7:48 AMMaxime Garcia
01/17/2025, 7:48 AMJames Fellows Yates
01/17/2025, 7:48 AMMaxime Garcia
01/17/2025, 7:48 AMMaxime Garcia
01/17/2025, 7:49 AMMaxime Garcia
01/17/2025, 7:49 AMSateesh_Peri
01/17/2025, 7:51 AMwhen:
task.ext.when == null || task.ext.whenMaxime Garcia
01/17/2025, 7:51 AMMaxime Garcia
01/17/2025, 7:51 AMSateesh_Peri
01/17/2025, 7:52 AMMaxime Garcia
01/17/2025, 7:52 AMMaxime Garcia
01/17/2025, 7:52 AMMaxime Garcia
01/17/2025, 7:53 AMMahesh Binzer-Panchal
01/17/2025, 7:53 AMSateesh_Peri
01/17/2025, 7:54 AMMahesh Binzer-Panchal
01/17/2025, 7:55 AMMahesh Binzer-Panchal
01/17/2025, 7:55 AMSateesh_Peri
01/17/2025, 7:56 AMJames Fellows Yates
01/17/2025, 7:58 AMJames Fellows Yates
01/17/2025, 7:58 AMJames Fellows Yates
01/17/2025, 7:58 AMSateesh_Peri
01/17/2025, 7:59 AMMaxime Garcia
01/17/2025, 7:59 AMSateesh_Peri
01/17/2025, 8:00 AMMahesh Binzer-Panchal
01/17/2025, 8:00 AMfilter and branching right (which is what should be used)?Mahesh Binzer-Panchal
01/17/2025, 8:01 AMext.when was to enable conditional execution of a process based on something in config ( which you can't access in the script ). but I don't think anyone has that.Maxime Garcia
01/17/2025, 8:16 AMMaxime Garcia
01/17/2025, 8:16 AMSateesh_Peri
01/17/2025, 8:17 AMMaxime Garcia
01/17/2025, 8:17 AMMaxime Garcia
01/17/2025, 8:18 AMMaxime Garcia
01/17/2025, 8:18 AMSateesh_Peri
01/17/2025, 8:18 AMMaxime Garcia
01/17/2025, 8:18 AMSimon Pearce
01/17/2025, 9:05 AMwhen to turn off parts of pipelines that aren't working or I don't need.
But @Ben Sherman doesn't like it and wants to ditch it.Simon Pearce
01/17/2025, 9:05 AMSimon Pearce
01/17/2025, 9:06 AMJames Fellows Yates
01/17/2025, 9:07 AMSimon Pearce
01/17/2025, 9:11 AMJames Fellows Yates
01/17/2025, 9:12 AMJames Fellows Yates
01/17/2025, 9:12 AMJames Fellows Yates
01/17/2025, 9:12 AMSimon Pearce
01/17/2025, 9:14 AMJames Fellows Yates
01/17/2025, 9:14 AMJames Fellows Yates
01/17/2025, 9:14 AMSimon Pearce
01/17/2025, 9:15 AMFamke Bäuerle
01/17/2025, 9:39 AMArthur
01/22/2025, 9:27 PMWould it be potentially better to doin theecho $argssection?stub
This has a couple of benefits over dropping the `$args`:
• maintains consistency betweenandscriptsection logicstub
• adds a simplistic level of testing thatare behaving as expectedargs
• keeps the language server happyI understand there seems to be some difference of opinion on the purpose/use of the
stub.
For me it has the power to operate more a complete dry-run test by running the same logic as the script (currently manually duplicated unless this issue gets picked up).
Personally I find this to be more in line with what a user might expect a dry-run/stub to test and I have also found it very helpful for testing internal module logic in cases where getting meaningful minimised test-data is not easy/possible.James Fellows Yates
01/23/2025, 7:08 AMJames Fellows Yates
01/23/2025, 7:11 AMstub
"""
echo"command \\
$args \\
$input"
touch ${prefix}
<...>
"""
It would just mean a module author copying the command(s) in script and wrapping in echoJames Fellows Yates
01/23/2025, 7:11 AMtouchesMaxime Garcia
01/23/2025, 7:12 AMMaxime Garcia
01/23/2025, 7:12 AMJames Fellows Yates
01/23/2025, 7:12 AMJúlia Mir
03/12/2025, 8:15 AMecho $args to all modules stub
2️⃣ Remove def args = teask.ext.args ?: "" from all modules stub
3️⃣ Both: add echo to the template but allow removing both lines if the module doesn't use itNicolas Vannieuwkerke
03/12/2025, 8:17 AMargs in their stub to determine which files should be touched. So I'd say a mix of the two options 😛Nicolas Vannieuwkerke
03/12/2025, 8:18 AMJames Fellows Yates
03/12/2025, 8:21 AMJose Espinosa-Carrasco
03/12/2025, 8:22 AMecho $args to all modules, I will with @Nicolas Vannieuwkerke that only keep them when needed to name the filesNicolas Vannieuwkerke
03/12/2025, 8:23 AMJúlia Mir
03/12/2025, 8:24 AMNicolas Vannieuwkerke
03/12/2025, 8:24 AMJames Fellows Yates
03/12/2025, 8:24 AMRike Hanssen
03/12/2025, 9:10 AMSimon Pearce
03/12/2025, 9:14 AMstub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo $args
touch ${prefix}.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""James Fellows Yates
03/12/2025, 9:15 AMstub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "samtools sort $args ..."
touch ${prefix}.bam
cat <-END_VERSIONS versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""James Fellows Yates
03/12/2025, 9:16 AMJames Fellows Yates
03/12/2025, 9:16 AMNicolas Vannieuwkerke
03/12/2025, 9:16 AMSimon Pearce
03/12/2025, 9:18 AMstub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "args:" $args
touch ${prefix}.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""James Fellows Yates
03/12/2025, 9:19 AMThat will be difficult to keep in sync I think? That should be done on the Nextflow level IMOCopy pasting is hard now?!
James Fellows Yates
03/12/2025, 9:19 AMNicolas Vannieuwkerke
03/12/2025, 9:19 AMCopy pasting is hard now?!No, but remembering to update the stub everytime you change the command is 😉
Rike Hanssen
03/12/2025, 9:26 AMCopy pasting is hard now?!meow yes