This is a test version of Biostars. For the public version, visit https://www.biostars.org.
What is the "-" option of samtools?

Hi all,

I saw a command line:

samtools view -u alignment.sam | samtools sort -@ 4 - output_prefix

from samtools (conversion from .sam to .bam) and sorting of .bam file

I don't know the function of the - before the output_prefix. I cannot find it in the manual book.

Could you help me figure out it?

Thank you!

samtools

1 answer

'-' just means stdin/standard input

http://www.htslib.org/doc/samtools-1.2.html

Samtools is designed to work on a stream. It regards an input file - as the standard input (stdin) and an output file - as the standard output (stdout).

Thank you! You solved my question.

Log in to answer this question.