On 13 Nov 2014, at 12:23, Karel Břinda <karel.bri...@gmail.com> wrote: > I observe a strange problem and I am not able to find out what is the exact > reason of it. When I use "samtools mpileup | another_program", samtools > return error code 141.
When a Unix shell reports that a command has an exit status greater than 128, this usually means the command was terminated by a signal. You don't say what platform this is on, but typically 141 means signal 141-128 = 13, which is typically SIGPIPE. > Everything else is OK (pileup is well created, all data are well processed). > I observe it when I use "set -o pipefail". The overall return error status is > 141 and it is really caused by samtools because > echo "${PIPESTATUS[0]} ${PIPESTATUS[1]}" > 141 0 > > It is interesting that this problem appears only with pipes. When I save the > output of samtools to a file, the error code is 0. SIGPIPE means that samtools tried to write on a pipe but there was no-one to read it. So this means that another_program closed its input and exited while samtools mpileup still had more data to write. Perhaps it was some trivial trailer or statistics and so doesn't much matter; but perhaps you should check that another_program really did process all the way to the end of the last chromosome! John -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help