BAM

A BAM file (.bam) is the binary version of a SAM file.  A SAM file (.sam) is a tab-delimited text file that contains sequence alignment data.   These formats are described on the SAM Tools web site: http://samtools.sourceforge.net. 

BAM, rather than SAM, is the recommended format for IGV.

Indexing:  IGV requires that both SAM and BAM files be sorted by position and indexed, and that the index files follow a specific naming convention.  Specifically,  a BAM index file should be named by appending .BAI to the bam file name. A SAM index filename is created by appending .SAI.  In both cases the index files must reside in the same directory as the BAM or SAM file. 

  • Tools for sorting and indexing BAM files are available at the SAM Tools website referenced above or on GenePattern.  The GenePattern module for sorting and indexing is Picard.SortSam.
  • SAM files can be sorted and indexed using the igvtools package. Note: The .SAI index is an IGV format, it does not work with samtools or any other application.

Chromosome names: Chromosome names must be consistent across all annotation and data files. For convenience, IGV equates chromosome numbers and names of the form chr# (e.g., 1 and chr1 are equivalent).

One-based index: Start and end positions are identified using a one-based index. The end position is included. For example, setting start-end to 1-2 describes two bases, the first and second in the sequence.