These are chat archives for nextflow-io/nextflow

28th
Nov 2016
Phil Ewels
@ewels
Nov 28 2016 13:13

Hi @pditommaso - I'm trying to use the optional: true thing you recommended above.. Having problems though. I have the following:

output:
file "*.bam" into bam, bam_2
file "*report.txt" into bismark_align_log_1, bismark_align_log_2, bismark_align_log_3
file "*.fq.gz" into bismark_unmapped, optional: true

But I get the following error:

[warm up] executor > slurm
ERROR ~ No signature of method: nextflow.script.FileOutParam.into() is applicable for argument types: (java.util.LinkedHashMap, nextflow.script.TokenVar) values: [[optional:true], nextflow.script.TokenVar(bismark_unmapped)]
Possible solutions: into([Lnextflow.script.TokenVar;), into(java.lang.Object), any(), find(), wait(), grep()

 -- Check script 'main.nf' at line: 200 or see '.nextflow.log' file for more details

(line 200 is file "*.fq.gz" into bismark_unmapped, optional: true)

Any ideas?
I've tried a few variants on the syntax but haven't found anything that works. It's definitely that line as commenting out fixes the problem.
Also just commenting out the , optional: true fixes it..
Paolo Di Tommaso
@pditommaso
Nov 28 2016 14:13
Without comma
(meeting)
Phil Ewels
@ewels
Nov 28 2016 14:14
ok, will try - thanks! :+1:
Paolo Di Tommaso
@pditommaso
Nov 28 2016 14:30
it should be like this
file "*.fq.gz" into bismark_unmapped optional true
no comma, no colon
Phil Ewels
@ewels
Nov 28 2016 14:32
ok cool - and for future reference, if I want an optional output into multiple channels?
file "*.fq.gz" into bismark_unmapped_1 optional true, bismark_unmapped_2 optional true
Like this?
Paolo Di Tommaso
@pditommaso
Nov 28 2016 14:33
file "*.fq.gz" optional true into this, that
you should read as methods call w/o parenthesis
file ("*.fq.gz") optional(true) into (this, that)
Phil Ewels
@ewels
Nov 28 2016 15:49
Can I add parentheses? It's kind of confusing without any grouping
Should be fine with them, right?
Paolo Di Tommaso
@pditommaso
Nov 28 2016 15:50
yes
Phil Ewels
@ewels
Nov 28 2016 15:50
:+1:
Félix C. Morency
@fmorency
Nov 28 2016 16:37
how do you guys handle the resulting symlinks output of NF? do you usually copy the folder to real files? other?
i always need to cp -Lr but I feel there is a smarter way
Paolo Di Tommaso
@pditommaso
Nov 28 2016 16:38
the ones in the work dir?
Félix C. Morency
@fmorency
Nov 28 2016 16:38
well I publishDir to a result directory and it contains symlinks to the work dir yes
but this is not very friendly with rsync/sftp
Paolo Di Tommaso
@pditommaso
Nov 28 2016 16:39
you can choose to create a real file instead of a symlink
Phil Ewels
@ewels
Nov 28 2016 16:39
, mode: 'copy'
ah, beat me to it..
Paolo Di Tommaso
@pditommaso
Nov 28 2016 16:40
though I still prefer cp -Lr when needed
Félix C. Morency
@fmorency
Nov 28 2016 16:40
Yeah ok. I can always remove the folder after transfer