“-;” at the end of the bash statement What is the meaning?
bwa sampe ref.fa r1.sai r2.sai r1.fq r2.fq | samtools view -bSho out.bam -;
“-;” What is the purpose? Characters at the end? What are they doing? Why are they needed?
Semicolon End command (End Pipe, I believe, is technically the right statement). If you wish, you can add another command after it, such as
bwa sampe ref.fa r1.sai r2.sai r1.fq r2.fq | samtools view -bSho out.bam -; echo Here is another command.
Otherwise, the semicolon is harmless, but may not be necessary.
hyphen before the semicolon, for
samtools and many other commands, it means using standard input instead of the input file (or, in some cases, standard output instead of the output file). This is typical Linux/Unix usage.
(Thanks to @phatfingers for verifying the use of
the samtools command. )