These are chat archives for nextflow-io/nextflow

10th
Jul 2017
Simone Baffelli
@baffelli
Jul 10 2017 14:35
Hi, quick question: whats exactly the difference between phase and cross? Is there a way to specify a closure that phases two channels basin on the values of both items?
for example if i want to match item 1 in the first channel with item 3 in the second channel, where both channels emit lists
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:41
phase syncs the elements having the same key, instead cross combines the matching elements
Simone Baffelli
@baffelli
Jul 10 2017 14:41
but if I'm not using keys but simple lists?
I'm to lazy to convert them into mappings
I'll need something like {a,b->a[1]==b[3]}
But I cannot find a way to do it
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:42
by default it matches on the first entry, otherwise you can specify your own rule with a closure
look at the second example
Simone Baffelli
@baffelli
Jul 10 2017 14:43
Yes, but what does it refer to in that context? The first item? The second item?
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:44
it's a bit more tricky
it's invoke once for the left element and once for the right element
Simone Baffelli
@baffelli
Jul 10 2017 14:46
oh...no luck then
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:46
thus, you need to able to distinguish which is one
Simone Baffelli
@baffelli
Jul 10 2017 14:46
I'd need something that works simultaneously
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:46
why ?
Simone Baffelli
@baffelli
Jul 10 2017 14:46

Because then I could just write something like

I'll need something like {a,b->a[1]==b[3]}

where a is the left element and b the right
Paolo Di Tommaso
@pditommaso
Jul 10 2017 14:47
that would be nice, not sure that can be implemented
Simone Baffelli
@baffelli
Jul 10 2017 14:48
Probabily not that easy. But atm could be done with combine and map
although it would probabily incur quite an overhead
because it needs to combine each item with all other items