1samtools-index(1) Bioinformatics tools samtools-index(1)
2
3
4
6 samtools index - indexes SAM/BAM/CRAM files
7
9 samtools index [-bc] [-m INT] aln.sam|aln.bam|aln.cram [out.index]
10
11
13 Index a coordinate-sorted BGZIP-compressed SAM, BAM or CRAM file for
14 fast random access. Note for SAM this only works if the file has been
15 BGZF compressed first.
16
17 This index is needed when region arguments are used to limit samtools
18 view and similar commands to particular regions of interest.
19
20 If an output filename is given, the index file will be written to
21 out.index. Otherwise, for a CRAM file aln.cram, index file
22 aln.cram.crai will be created; for a BAM file aln.bam, either
23 aln.bam.bai or aln.bam.csi will be created; and for a compressed SAM
24 file aln.sam.gz, either aln.sam.gz.bai or aln.sam.gz.csi will be cre‐
25 ated, depending on the index format selected.
26
27 The BAI index format can handle individual chromosomes up to 512 Mbp
28 (2^29 bases) in length. If your input file might contain reads mapped
29 to positions greater than that, you will need to use a CSI index.
30
31
33 -b Create a BAI index. This is currently the default when no for‐
34 mat options are used.
35
36 -c Create a CSI index. By default, the minimum interval size for
37 the index is 2^14, which is the same as the fixed value used by
38 the BAI format.
39
40 -m INT Create a CSI index, with a minimum interval size of 2^INT.
41
42 -@, --threads INT
43 Number of input/output compression threads to use in addition
44 to main thread [0].
45
46
48 Written by Heng Li from the Sanger Institute.
49
50
52 samtools(1), samtools-idxstats(1), samtools-view(1)
53
54 Samtools website: <http://www.htslib.org/>
55
56
57
58samtools-1.13 7 July 2021 samtools-index(1)