groovy oneliner to get first token/column of tsv file #2884
-
Dear all, this is dsl 2.0 I know I can use file(somefile.fai).readLines() to read a whole file. If the file only contains one column (chromosome name) this works great.
But can I just read the first column of the tab separated TSV in a one liner? Eg split by tab, then get the 0th token. I've tried using a process to prepare a multi-column TSV (fai file) into a single column one using If not, would another method (eg value channel) be compatible with the .map I want to do here ? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Colin,
Cheers, |
Beta Was this translation helpful? Give feedback.
Hi Colin,
.splitText()
allows to specify a closure, so something like this should to the trick:Cheers,
Patrick