On 28 Apr 2016, at 15:03, Tagliamonte,Massimiliano S <[email protected]> 
wrote:
> ... I'm ashamed to ask... what is the dash ( "-" )before redirecting the 
> output?
> i.e.: flagstat - > myfile.stats. If I don't use the dash, it gives me a 
> broken pipe error. I did some googling, still not sure of its meaning.

It's a filename argument that many Unix commands interpret specially to mean 
standard input (or standard output, depending on context):

        
http://unix.stackexchange.com/questions/41828/what-does-dash-at-the-end-of-a-command-mean

Many samtools commands take an optional input filename argument or 0-or-more 
input filename arguments, and read from standard input if you give zero input 
filenames.  This is the standard convention for Unix filter commands.  So e.g. 
"blah | samtools view -" and "blah | samtools view" are equivalent.

However a few samtools commands still require exactly one input filename 
command.  So "samtools flagstat" just shows the usage instructions, and you 
need to say "samtools flagstat -" to get it to read from standard input.  (In 
our copious spare time, we'll probably eventually get all the samtools commands 
to default to standard input if there are no input filenames given: I think 
there's only a few left.)

    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. 

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Samtools-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to