logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

samtools-index - indexes SAM/BAM/CRAM files

Author

       Written by Heng Li from the Sanger Institute.

Description

       Index  coordinate-sorted  BGZIP-compressed  SAM,  BAM or CRAM files for fast random access.  Note for SAM
       this only works if the file has been BGZF compressed first.  (The  first  synopsis  with  multiple  input
       FILEs is only available with Samtools 1.16 or later.)

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

       When only one alignment file is being indexed, the output index filename can be specified via  -o  or  as
       shown in the second synopsis.

       When no output filename is specified, for a CRAM file aln.cram, index file aln.cram.crai will be created;
       for  a BAM file aln.bam, either aln.bam.bai or aln.bam.csi will be created; and for a compressed SAM file
       aln.sam.gz, either aln.sam.gz.bai or aln.sam.gz.csi will  be  created,  depending  on  the  index  format
       selected.

       The  BAI  index  format  can handle individual chromosomes up to 512 Mbp (2^29 bases) in length.  If your
       input file might contain reads mapped to positions greater than that, you will need to use a CSI index.

Name

       samtools-index - indexes SAM/BAM/CRAM files

Options

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

       -c,--csi
               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,--min-shiftINT
               Create a CSI index, with a minimum interval size of 2^INT.

       -M      Interpret  all  filename  arguments  as alignment files to be indexed individually.  (Without -M,
               filename arguments are interpreted solely as per the second synopsis.)

       -o,--outputFILE
               Write the output index to FILE.  (Currently may only be used when exactly one alignment  file  is
               being indexed.)

       -@,--threadsINT
               Number of input/output compression threads to use in addition to main thread [0].

See Also

samtools(1), samtools-idxstats(1), samtools-view(1)

       Samtools website: <http://www.htslib.org/>

samtools-1.21                                   12 September 2024                              samtools-index(1)

Synopsis

samtoolsindex-M [-bc] [-mINT] FILEFILE [FILE...]

       samtoolsindex [-bc] [-mINT] aln.sam|aln.bam|aln.cram [out.index]

See Also