From: John M. <jm...@sa...> - 2012-04-30 12:47:03
|
On 27 Apr 2012, at 21:28, Peng Yu wrote: > It seems that there is a bug in samtools. The commands are the following > > ============== > set -v > tee >(samtools view -o /dev/stdout /dev/stdin | head) >(samtools view > -H -o /dev/stdout /dev/stdin | head) < "$bamfile" > /dev/null That's a nice trick, useful I guess when input comes from a pipe rather than a file like $bamfile. It works for me, with no "truncated file" message, on Linux (Debian lenny x86_64) with the same version of samtools. What platform are you on? I think it would be instructive to strace your tee command, and probably also the samtools commands. Does the error occur at the end of the input, or part way along? (I guess you'd have to remove the heads to find out.) BTW based on your later experiments, presumably the following would work: tee >(samtools view -o /dev/stdout /dev/stdin | head) < "$bamfile" | samtools view -H -o /dev/stdout /dev/stdin | head ...which would somewhat point the finger at your implementation of tee... 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. |