These are chat archives for nextflow-io/nextflow

26th
May 2017
Benjamin Wingfield
@nebfield
May 26 2017 13:05
hello, what's the best practice for designating and writing to an output folder in the base directory? for figures etc. that would accompany an analysis
for example, a process that outputs a few different pngs
Paolo Di Tommaso
@pditommaso
May 26 2017 13:27
Hi, figures can be managed as any other computational step
Just use publishDir in your task to copy the figure files in the directory of your choice, eg
process foo {
  publishDir yourBaseDir, mode: 'copy' 
  output:  
  file 'x.png'

   """
   render_command.py --out x.png --some inputs here
   """
}
Benjamin Wingfield
@nebfield
May 26 2017 15:11
that's perfect. thank you!
Mike Smoot
@mes5k
May 26 2017 20:21

Hi @pditommaso I finally produced an example of the spread bug that I've been seeing! Here's the code:

Channel.from(1,2,3).into{ data }

process symlink {

    output:
    file(db) into db_file

    script:
    infile = "/home/msmoot/try/nextflow_stuff/some_db/db.txt"
    db = "DB"
    """
    ln -s ${infile} ${db}
    """
}

data.spread( db_file ).view()

and here's the output that I see:

$ nextflow run spreadache4.nf 
N E X T F L O W  ~  version 0.24.3
Launching `spreadache4.nf` [pensive_hamilton] - revision: 778a839dbb
[warm up] executor > local
[b4/baafb5] Submitted process > symlink
[1, home]
[1, msmoot]
[1, try]
[1, nextflow_stuff]
[1, work]
[1, b4]
[1, baafb545b7306f07f8f7585d1b0a76]
[1, DB]
[2, home]
[2, msmoot]
[2, try]
[2, nextflow_stuff]
[2, work]
[2, b4]
[2, baafb545b7306f07f8f7585d1b0a76]
[2, DB]
[3, home]
[3, msmoot]
[3, try]
[3, nextflow_stuff]
[3, work]
[3, b4]
[3, baafb545b7306f07f8f7585d1b0a76]
[3, DB]

Basically, spread is splitting the filename and spreading parts of the filename over the channel instead of just spreading the whole filename. I'm very curious if you see the same thing in your environment. I'll enter a ticket, but thought I'd let you know here too.

Mike Smoot
@mes5k
May 26 2017 20:27
Here's the ticket: nextflow-io/nextflow#353