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/doc/samtools.html.
samtools view -S {{[-b|--bam]}} {{input.sam}} > {{output.bam}}
stdin (-) and print the SAM header and any reads overlapping a specific region to stdout:{{other_command}} | samtools view {{[-h|--with-header]}} - chromosome:start-end
samtools sort {{input}} {{[-o|--output]}} {{output.bam}}
sorted_input.bam.bai):samtools index {{sorted_input.bam}}
samtools flagstat {{sorted_input}}
samtools idxstats {{sorted_indexed_input}}
samtools merge {{output}} {{input1 input2 ...}}
samtools split {{merged_input}}