These are chat archives for nextflow-io/nextflow

28th
May 2018
Paolo Di Tommaso
@pditommaso
May 28 2018 07:03
(please format the code properly to get help)
Luca Cozzuto
@lucacozzuto
May 28 2018 13:44
Hi all, there is a way to get a single instance from a channel depending on a value?
Paolo Di Tommaso
@pditommaso
May 28 2018 13:46
?
Luca Cozzuto
@lucacozzuto
May 28 2018 13:46
I have a channel with genome_id, files
and I would like to get only the files where genome_id=="my genome"
Paolo Di Tommaso
@pditommaso
May 28 2018 13:47
filter ?
Luca Cozzuto
@lucacozzuto
May 28 2018 13:47
I'll try
which filter?
Paolo Di Tommaso
@pditommaso
May 28 2018 13:48
how many there are when you click ?
Luca Cozzuto
@lucacozzuto
May 28 2018 13:49
I mean which syntax
.filter( ~/^a.*/ )
.filter(/${my_genome}/)
Paolo Di Tommaso
@pditommaso
May 28 2018 13:49
.filter { genome_id, files ->  genome_id /*something*/ }
Luca Cozzuto
@lucacozzuto
May 28 2018 13:50
set genome_id, file "*" from blastdbs.filter( /"${params.id}"/ )
Paolo Di Tommaso
@pditommaso
May 28 2018 13:50
nah
Luca Cozzuto
@lucacozzuto
May 28 2018 13:51
:(
:shipit:
Paolo Di Tommaso
@pditommaso
May 28 2018 13:51
set genome_id, file "*" from blastdbs.filter { genome_id, files -> params.id == genome_id }
Luca Cozzuto
@lucacozzuto
May 28 2018 13:52
:+1:
it complains
ERROR ~ No such variable: file

 -- Check script 'qcloud.nf' at line: 175 or see '.nextflow.log' file for more details
Paolo Di Tommaso
@pditommaso
May 28 2018 13:56
switch the brain on, please ;)
Luca Cozzuto
@lucacozzuto
May 28 2018 13:57
yes
[HELA, [/nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/f9/36f441fd7b7e6906e437b79a06e54f/shotgun_hela.fasta, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/f9/36f441fd7b7e6906e437b79a06e54f/shotgun_hela.fasta.phr, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/f9/36f441fd7b7e6906e437b79a06e54f/shotgun_hela.fasta.pin, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/f9/36f441fd7b7e6906e437b79a06e54f/shotgun_hela.fasta.psq]]
[BSA, [/nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/9c/ad1a799c52d74c9d072e1d2e740178/shotgun_bsa.fasta, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/9c/ad1a799c52d74c9d072e1d2e740178/shotgun_bsa.fasta.phr, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/9c/ad1a799c52d74c9d072e1d2e740178/shotgun_bsa.fasta.pin, /nfs/software/bi/biocore_tools/git/nextflow/Qcloud/work/9c/ad1a799c52d74c9d072e1d2e740178/shotgun_bsa.fasta.psq]]
this is the channle
Paolo Di Tommaso
@pditommaso
May 28 2018 13:57
set genome_id, file("*") from .. etc
Luca Cozzuto
@lucacozzuto
May 28 2018 13:57
channel
Paolo Di Tommaso
@pditommaso
May 28 2018 13:57
the parenthesis
Luca Cozzuto
@lucacozzuto
May 28 2018 13:58
you know sometime parenthesis are needed sometimes not...
btw I already tried
and I got this
ERROR ~ Cannot get property 'id' on null object
I got it
Ryo Kita
@rkita
May 28 2018 16:01
Enjoying nextflow so far. Quick question - is there a good example of running nextflow pipelines within another nextflow pipeline? I want to break apart my big pipeline into intuitive pieces that may be run separately.
Paolo Di Tommaso
@pditommaso
May 28 2018 16:05
there are some notes here
Ryo Kita
@rkita
May 28 2018 16:17
excellent, thank you!
Paolo Di Tommaso
@pditommaso
May 28 2018 16:18
in a nutshell, if you want to resume big task commands, you can use external scripts or templates
for sub-workflows there isn't yet an optimal solution
Ryo Kita
@rkita
May 28 2018 16:23
ok sounds good. it's definitely a tricky problem