alexstaj / cutadapt

Automatically exported from code.google.com/p/cutadapt
0 stars 0 forks source link

stdout and stderr not treated consistently #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If an output file is not specified:

cutadapt -q 30 input.fastq

the trimmed reads are sent to stdout and stats are sent to stderr. This is the 
behaviour I'd expect. If a filename is specified in addition

cutadapt -q 30 -o output.fastq input.fastq

the stats go to stdout and nothing is sent to stderr.

stdout and stderr should be treated consistently, regardless of how the utility 
is invoked.

Original issue reported on code.google.com by simon.po...@eaglegenomics.com on 18 Jan 2013 at 11:10

GoogleCodeExporter commented 9 years ago
This is unfortunately in conflict with an earlier report I’ve received, 
please see http://code.google.com/p/cutadapt/issues/detail?id=20 . There the 
explicit request was made to send statistics to stdout if -o is used.

The problem was that Galaxy (in the version current at that time) interpreted 
it as an error if anything was written to stderr. I guess the correct fix would 
have been to introduce a '--report-file' option that determines where to send 
the statistics. However, unless you have compelling arguments, I’m reluctant 
to change behavior again as this would break existing scripts.

Original comment by marcel.m...@tu-dortmund.de on 18 Jan 2013 at 12:47

GoogleCodeExporter commented 9 years ago
I cannot change this anymore, so closing.

Original comment by marcel.m...@tu-dortmund.de on 5 Nov 2014 at 12:26

GoogleCodeExporter commented 9 years ago
I think this is important, since the output is contaminated with the report, it 
would be best to sent to --report_file when stdout is used. 

Original comment by oabiogro...@gmail.com on 1 Jul 2015 at 6:33

GoogleCodeExporter commented 9 years ago
Please comment at https://github.com/marcelm/cutadapt/issues/70 instead. The 
bugtracker here is not used anymore.

There is no need for a --report-file option since you can always redirect it. 
Use either

cutadapt ... -o file.fastq > report.txt

or

cutadapt ... > file.fastq 2> report.txt

Unless you use -o - or -o /dev/stdout, trimmed reads and the report are always 
sent to different streams.

Original comment by marcel.m...@tu-dortmund.de on 1 Jul 2015 at 8:12