These are chat archives for nextflow-io/nextflow

29th
Apr 2015
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:09
Hi Paolo!
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:09
Hi there :)
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:10
Yes I wanted to map with collectFile
so then how should I add the value to the channel
once I collected the files
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:11
um, collectFile returns a channel emitting the files it has collected
If I understood you want to have the file and another value . .
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:12
bG_by_track = bedGraph_tr
.collectFile { pos, track, file ->
[ "bedGraph_$track", file, "$track" ]
}
.flatMap()
yes this is what I have
as I have the value of track I would like to add it to the structure so I then can use in following steps without much thinking
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:14
I see
I think the only way is to get that value from the name of the files you have collected
for example
.collectFile() { ... }
.map { file -> tuple( file, file.baseName.tokenize('_')[1])  }
what about this ?
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:16
Ahh, OK
perfect I wanted to do it more directly, but this way is fine!
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:17
actually, it makes sense what you were trying to do but collectFile cannot do that
it could be a nice extension, I try to think about that
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:18
Yes I wanted to do it in a straight way. Yes I think it will be nice!
my piece of code
This was just a test XD
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:19
:)
Gitter supports markdown!
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:20
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:20
triple back tick and write the code
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:20
.collectFile ()
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:20
my glory nextflow code
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:21
yes is very nice!
Paolo Di Tommaso
@pditommaso
Apr 29 2015 08:21
:)
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 08:21
jajaja
yes indeed
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 16:42
Hi there!
I want to include something like
"""
awk -F" " '{print $1,$2,$3,$4,${tr}}' ${bedGraph_f} > tr_${tr}.txt   
"""
How can I scape the dolars of awk? I was trying with \$ but doesn't seem to work
Jose Espinosa-Carrasco
@JoseEspinosa
Apr 29 2015 16:56
Sorry it worked, actually I had another mistake...
Paolo Di Tommaso
@pditommaso
Apr 29 2015 17:52
yes \$1 is the way to escape bash variables