Function Open-Sam
(
open-sam < filename > &key (direction input) < header-only > )
Open a SAM file for :input or :output. If the file is .bam or .cram, use samtools view for input or output.
Tell samtools view to only return the header for :input when :header-only is true.
Returns two values: a stream to read or write, and optionally a process representation for samtools.