samtools

Tools for handling high-throughput sequencing (genomics) data. Used for reading/writing/editing/indexing/viewing of data in SAM/BAM/CRAM format. More information: https://www.htslib.org.

samtools view -S -b input.sam > output.bam

other_command | samtools view -h - chromosome:start-end

samtools sort input -o output.bam

samtools index sorted_input.bam

samtools flagstat sorted_input

samtools idxstats sorted_indexed_input

samtools merge output input1 input2 ...

samtools split merged_input