These are chat archives for nextflow-io/nextflow

30th
Mar 2017
Jose Espinosa-Carrasco
@JoseEspinosa
Mar 30 2017 07:29
Hi there!
Which is the easier way to filter out the biggest filter of a channel?
Paolo Di Tommaso
@pditommaso
Mar 30 2017 07:38
biggest filter
biggest file you mean ?
have a look at the second example
Jose Espinosa-Carrasco
@JoseEspinosa
Mar 30 2017 08:22
Mean size of the file
Thanks
Alessia
@alesssia
Mar 30 2017 10:27
Hello everyone! I was wondering if someone can point me out a place where I can figure out how to run a process P1 if a condition X is true, or P2 otherwise? I mean, if X is true the flow of the processes should be P0 -> P1 -> P3, while if X if false the flow should be P0 -> P2 -> P3
Maxime Garcia
@MaxUlysse
Mar 30 2017 10:28
You can use when
Alessia
@alesssia
Mar 30 2017 10:29
but how can I synchronize the channels? I mean, P3 should wait on a channel that can be created either by P1 or P2...
Maxime Garcia
@MaxUlysse
Mar 30 2017 10:30
you can use the mix operator to mix the two channels into one : https://www.nextflow.io/docs/latest/operator.html#mix
Alessia
@alesssia
Mar 30 2017 10:31
I thought about conditional scripts, but they make the code too heavy (the flow is quite complex, with at least three bifurcations)
so P1 and P2 creates two channels C1 and C2 that are mixed and used as input for P3? I may work... Thanks @MaxUlysse
Maxime Garcia
@MaxUlysse
Mar 30 2017 10:32
You're welcome
If you wait a little more, I'm sure people will find smarter solutions
Alessia
@alesssia
Mar 30 2017 10:33
:)
Maxime Garcia
@MaxUlysse
Mar 30 2017 10:34
But this mix thing should work ;-)
Paolo Di Tommaso
@pditommaso
Mar 30 2017 11:15
@alesssia it depends by the condition logic
you can also use the choice operator
Alessia
@alesssia
Mar 30 2017 11:20
it is very complicated :) for the example above mix seems to work, but for a more complex flow (see afterwards) I must use some tweaks that are making the code "un-elegant". The more complex example is "if (X) P0 -> P3 else P0 -> P1 -> P2 -> P3". When P0 outputs on the channel C0, P3 should start to process the output only if X
Paolo Di Tommaso
@pditommaso
Mar 30 2017 11:23
I see, yes what max prosed seems to fit better
Maxime Garcia
@MaxUlysse
Mar 30 2017 11:24
:smile:
Alessia
@alesssia
Mar 30 2017 11:25
Trying now, I will let you know how it goes...
Jorrit Boekel
@glormph
Mar 30 2017 11:53
Hello, is there any way to get the WARN messages when errorStrategy = ignore? I would like to display them in the workflow.errorReport or similar.
Maybe with the respective task's stdout/err
Browsing the code a bit, but my Java is no good :(
Paolo Di Tommaso
@pditommaso
Mar 30 2017 11:54
I foresee more java in the future of bioinformatics :)
anyhow currently that warning is only reported in the NF stdout
Jorrit Boekel
@glormph
Mar 30 2017 11:58
hehe, best I read the code some more then to adapt to the future. :)
thanks for the info. I may open an issue, possibly.
Paolo Di Tommaso
@pditommaso
Mar 30 2017 11:58
ok, great
Karin Lagesen
@karinlag
Mar 30 2017 15:09
em.... I have a channel that I would like to use for two different processes (two processes that both use reads)
so, nextflow complains saying two different processes are using the channel
I kind of assumed this would be, well, trivial?
or that a copy would be made, or something?
Maxime Garcia
@MaxUlysse
Mar 30 2017 15:20
You need to duplicate this channel into 2 channels
Look into the into operator
Karin Lagesen
@karinlag
Mar 30 2017 15:20
ahhhhhhh
thanks!
ok, so I've defined my channel thusly: ```
Channel
    .fromFilePairs( params.reads )
    .ifEmpty { error "Cannot find any reads matching: ${params.reads}" }
    .set{ read_pairs1 }
so... do I just do read_pairs1, read_pairs2 etc inside the curly brackets?
(I got the impression that doing it this way was more nextflowy)
Maxime Garcia
@MaxUlysse
Mar 30 2017 15:24
My guess is
'''
Channel
.fromFilePairs( params.reads )
.ifEmpty { error "Cannot find any reads matching: ${params.reads}" }
.into(read_pairs1,read_pairs2)
Karin Lagesen
@karinlag
Mar 30 2017 15:26
ok, thanks, will chekc diff between into and set :)
Maxime Garcia
@MaxUlysse
Mar 30 2017 15:26
Something like that, but on the phone right now, so difficult to try it out ;-)
Karin Lagesen
@karinlag
Mar 30 2017 15:26
thankyou very much for helping me while on a call!
docs says that I should be able to use both set and into in this situation :)
Maxime Garcia
@MaxUlysse
Mar 30 2017 15:33
Perfect then ;-)
Paolo Di Tommaso
@pditommaso
Mar 30 2017 17:51
well, not for multiple assignment you should use into nearly as shown by Max
Channel
    .fromFilePairs( params.reads )
    .ifEmpty { error "Cannot find any reads matching: ${params.reads}" }
    .into {read_pairs1; read_pairs2}
Paolo Di Tommaso
@pditommaso
Mar 30 2017 18:23
*not=no