These are chat archives for nextflow-io/nextflow

5th
Dec 2016
Félix C. Morency
@fmorency
Dec 05 2016 18:16
what would be the best way to collect and merge json files emitted from channel?
Paolo Di Tommaso
@pditommaso
Dec 05 2016 18:19
um, to collect them you can use subscribe
to merge, it depends
the json are in form of text and do you just need to concatenate them ?
Félix C. Morency
@fmorency
Dec 05 2016 18:21
yeah text-like and probably just concatenate them
ill try with .collectFiles() and jq
Paolo Di Tommaso
@pditommaso
Dec 05 2016 18:22
nope that is designed for txt files
something like:
def target = file('my.json')
def count = 0
x.subscribe  onNext: { 
    target << ( count == 0 ? '{' : ',' )
    target << it 
  }, 
onComplete: { target << '}' }
Félix C. Morency
@fmorency
Dec 05 2016 18:30
the syntax seems to be wrong
Paolo Di Tommaso
@pditommaso
Dec 05 2016 18:31
what's the error ?
ah yes
onComplete:
have a look here
Félix C. Morency
@fmorency
Dec 05 2016 18:37
ok. it still needs some work but ill play with that. thx
Paolo Di Tommaso
@pditommaso
Dec 05 2016 18:37
I guess, so
if you need manipulate the json have a look here
Félix C. Morency
@fmorency
Dec 05 2016 18:41
oh cool , thx
Paolo Di Tommaso
@pditommaso
Dec 05 2016 18:41
:+1:
Félix C. Morency
@fmorency
Dec 05 2016 20:47
i used a mix of .reduce() and jq and it works like a charm
amacbride
@amacbride
Dec 05 2016 23:33
I saw that there's a version 0.22.6 floating around, but didn't see any release notes. Anything new and interesting?
Paolo Di Tommaso
@pditommaso
Dec 05 2016 23:35
mostly a bug fixing
but hopefully Santa will bring a new release with some nice features by Christmas time .. :)
amacbride
@amacbride
Dec 05 2016 23:38
ho ho ho!
amacbride
@amacbride
Dec 05 2016 23:40
;) As it happens, I was wokring on moving my 0.22.4 to 0.22.5, but it looks like I might need the bug fix for #259 , so I guess I will try 0.22.6 instead.
Paolo Di Tommaso
@pditommaso
Dec 05 2016 23:41
yes, definitely