Sam/Bam Manipulation


samtools index [-bc] [-m INT] aln.bam|aln.cram [out.index]


This index is needed when region arguments are used to limit samtools view and similar commands to particular regions of interest.

If an output filename is given, the index file will be written to out.index. Otherwise, for a CRAM file aln.cram, index file aln.cram.crai will be created; for a BAM filealn.bam, either aln.bam.bai or aln.bam.csi will be created, depending on the index format selected.


-b: Create a BAI index. This is currently the default when no format options are used.

-c: Create a CSI index. By default, the minimum interval size for the index is 2^14, which is the same as the fixed value used by the BAI format.

-m INT: Create a CSI index, with a minimum interval size of 2^INT.

Protocols using this tool

PROcap preprocessing (with two replicates)

Share your experience or ask a question