Often that error is actually the fault of an inval...
# pipeline-maintainers
j
Often that error is actually the fault of an invalid (too long/short) input tuple
😬 1
d
Sorry, I wasnt precise before, thats an issue when using
NXF_VER=26.04.6 nextflow config -o json
. With that info, is that still a potential issue with the input tuble? Because the pipeline itself runs fine (
nextflow run ampliseq -profile test --outdir results
).
j
Oh, that's different. Do you have a config variable where something accessing
task
is not wrapped in a closure?
d
Hm, something like
Copy code
ext.args = '--p-prv-cut 0.1 --p-lib-cut 500 --p-alpha 0.05 --p-conserve'
ext.prefix = { meta.region ? "region-${meta.region}_run-${meta.run}" : "${meta.run}" }
ext.quality_type = { "${params.quality_type}" }
where the first isnt in a closure, is that needed now?
j
It's only needed if the result needs to access
task
,
meta
, etc.
so that looks fine to me
d
Hm no I cannot find any
task.
outside of a closure. The AI also says that for modules.config "In all cases
task.process
sits inside a
{ ... }
closure bound to the
path:
key." & base.config "confirming
task.
only appears where a closure is used."...
Curious but probably not relevant:
NXF_VER=25.10.7 nextflow config -o json
-> success
NXF_VER=26.04.6 nextflow config -o json
->
ERROR ~ No such variable: task
NXF_VER=26.07.0-edge nextflow config -o json
->
ERROR ~ No such variable: task
NXF_VER=26.08.0-edge nextflow config -o json
-> success
j
Interesting!
It might be painful but can you comment out config sections to find the source?
d
Each one of those three cause the issue it seems:
Copy code
withName: 'GAPPA_GRAFT' {
        ext.prefix = { "${meta.id}.graft" }
        publishDir = [
            [
                path: { "${params.outdir}/pplace" },
                mode: params.publish_dir_mode,
                pattern: "*.newick"
            ],
            [
                path: { "${params.outdir}/pplace/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
                mode: params.publish_dir_mode,
                saveAs: { filename -> filename ? (filename == 'versions.yml' ? null : filename) : null }
            ]
        ]
    }

    withName: 'GAPPA_ASSIGN' {
        ext.prefix = { "${meta.id}.taxonomy" }
        ext.args   = "--per-query-results --krona --sativa"
        ext.when   = { taxonomy }
        publishDir = [
            [
                path: { "${params.outdir}/pplace" },
                mode: params.publish_dir_mode,
                pattern: "*.taxonomy.per_query.tsv"
            ],
            [
                path: { "${params.outdir}/pplace/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
                mode: params.publish_dir_mode,
                saveAs: { filename -> filename ? (filename == 'versions.yml' ? null : filename) : null }
            ]
        ]
    }

    withName: 'GAPPA_HEATTREE' {
        ext.prefix = { "${meta.id}.heattree" }
        ext.args = "--write-nexus-tree --write-phyloxml-tree --write-svg-tree"
        publishDir = [
            [
                path: { "${params.outdir}/pplace" },
                mode: params.publish_dir_mode,
                pattern: "*.tree.svg"
            ],
            [
                path: { "${params.outdir}/pplace/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
                mode: params.publish_dir_mode,
                saveAs: { filename -> filename ? (filename == 'versions.yml' ? null : filename) : null }
            ]
        ]
    }
investigating...
j
you need to escape the task
Copy code
path: { task ? "${params.outdir}/pplace/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" : null },
Essentially the whole closure needs to return null if any objects (which do not exist in the bugged parser) don't exist
d
Thanks so far, a lot! Will continue that after lunch 😄
j
Alternatively you don't fix any of this and wait for 26.04.7 to be released with the fix, and merge PRs with manual linting with a working version
d