Hi, how can I modify `publishDir` to stop publish...
# configs
l
Hi, how can I modify
publishDir
to stop publishing the empty files?
Copy code
withName: EXTRACTCDIAMONDREADS {
        ext.prefix = { "${meta.id}" }
        publishDir = [
            path: { "${params.outdir}/extracted_reads/diamond" },
            mode: params.publish_dir_mode,
            pattern: '*.fastq',
            filter: { file -> file.size() > 0 }
        ]
    }
a
I may be wrong, but I've never seen a specification for publishDir inside of a withName directive. But, maybe try removing the curly brackets around the path and replace the double-quotes with single-quotes.
r
I think filter may not be a available option for
publishDir
. You could try with
saveAs
for some conditionals. Is there an option to prevent creating empty files in the first place? https://www.nextflow.io/docs/latest/process.html#publishdir
l
@Rike Hanssen I have tried
saveAs: { file -> file.size() > 0 }
, but didn’t work. I think I will write a short process to remove them for now.
r
Maybe raise it in the community forum since this is more about nextflow syntax 🙂
l
Sounds like a good idea