When using `-dump-channels` with `nextflow run` , ...
# nostupidquestions
n
When using
-dump-channels
with
nextflow run
, is there a way to capture the dumped channels to a file while keeping the standard pipeline outputs in stdout / terminal?
m
Try something along the lines of:
Copy code
nextflow run ... | tee >( grep "DUMP" > dumped.output )
👍 1
n
That succeeds to only collect the DUMP lines to file, but it still pollutes my terminal with channels
m
Ah, then I misunderstood your request. Then not to my knowledge. Perhaps request it as a feature request to Nextflow.
n
Yeah my request was not super clear, I was essentially hoping there was something like
-dump-channels-to-file
m
Usually it's off, or you select specific tags. I think the output is also recorded in the
.nextflow.log
. Why is it a problem it's to screen when you need it?
n
The problem, in essence, is me trying to debug in production runs. So it is too much information to reasonably fit on screen, and I thought it would be nice to see pipeline progression while also being able to check where some things get lost
👍🏽 1
t
grep -vFe '[DUMP]'
shows everything that does not contain "[DUMP]", so you could use Mahesh's idea of redirecting to a file and then filter the standard output, or even direct everything to a file and filter the output, e.g.:
nextflow run ... | tee my.log | grep -vFe '[DUMP]'
-- you have all of STDOUT (including dump) in the log file, while showing only the typical output on the screen. (If you want the STDERR in the log as well, you can use
2>&1
.)
🙌 1