This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools 1.0 'index' : CSI index vs BAI index ?

Dear lazyweb, here is the new menu for samtools index:

Usage: samtools index [-bc] [-m INT]  [out.index]
Options:
  -b       Generate BAI-format index for BAM files [default]
  -c       Generate CSI-format index for BAM files
  -m INT   Set minimum interval size for CSI indices to 2^INT [14]

What is the CSI index compared to BAI? Should I better use it instead of the 'old' BAI index? What's the benefit?

samtools index

2 answers

It depends on how long your contigs/chromosomes are. The biggest benefit to CSI is that it supports indexing BAM files with contigs longer than 2^29-1 bases. At least in plants this isn't an uncommon requirement.

CSI also allows to choose a compromise between the size of index and region query performance (the -m parameter). The less the interval size, the larger the index is, but for region queries less computational work is required, because the index is more fine-grained.

BAI is a special case of CSI, with some minor differences.

Log in to answer this question.