These are chat archives for nextflow-io/nextflow

18th
Jul 2018
Tobias Neumann
@t-neumann
Jul 18 2018 08:18

@pditommaso so I used your matching glob example to selectively put files into the SAME publishDir:

    publishDir = [path: './results', mode: 'copy', overwrite: 'true', pattern: "*centrifuge_report.tsv"]
    publishDir = [path: './results', mode: 'copy', overwrite: 'true', pattern: "*quant.sf"]
    publishDir = [path: './results', mode: 'copy', overwrite: 'true', pattern: "*.vcf"]

The individual corresponding process outputs are:

    output:
    file ("manta/results/variants/*") into outManta
......
    output:
    file ("${lane}_salmon/quant.sf") into salmonChannel

......
    output:
    file ("*centrifuge_report.tsv") into centrifugeChannel

All of the files are produce in the corresponding work dir, but none of them ends up in the pubishDir ('results'). Any idea what's going on there or where I could check? Or is it simply that the previous publishDir directive overwrites the previous one if specified for the same publishDir?

Paolo Di Tommaso
@pditommaso
Jul 18 2018 08:24
the first should work
the second and third are not matching because the pattern does not match the subdir
pattern: "*/quant.sf" or pattern: "**quant.sf" should work tho
Tobias Neumann
@t-neumann
Jul 18 2018 08:27
hm ok I'll change that. but even the first one (centrifuge) does not work
Paolo Di Tommaso
@pditommaso
Jul 18 2018 08:28
create replicable test case and open an issue if it's the case
Tobias Neumann
@t-neumann
Jul 18 2018 08:29
ok. so in principle having separate publishDir directives on the same path is valid
Paolo Di Tommaso
@pditommaso
Jul 18 2018 08:29
wait
the problem is that you are overriding the publishDir in the config
Tobias Neumann
@t-neumann
Jul 18 2018 08:31
so only the last statement will be kept? I figured that might be the issue. can you use multiple globs in one statement?
Paolo Di Tommaso
@pditommaso
Jul 18 2018 08:31
in the config multiple publishDir needs to be defined as shown below
process {
  publishDir = [
    [path: './results', mode: 'copy', overwrite: 'true', pattern: "*.txt"],
    [path: './results', mode: 'copy', overwrite: 'true', pattern: "*.fa"]
  ]
}
Tobias Neumann
@t-neumann
Jul 18 2018 08:33
ah cool - I'll try it right away