Wednesday, December 5, 2012

How to index BAM files for viewing in IGV browser

If you have tried to upload BAM files to IGV you may get an error stating the files are not indexed.
Install samtools.
http://samtools.sourceforge.net/

Go to the folder where your BAM file is 
samtools index accepted_hits.bam

After this accepted_hits.bam.bai file will be created and the original BAM file can be uploaded to IGV 

2 comments:

  1. Hi, I downloaded the ChIP-seq bam file (hg19) from UCSC, then I sorted and indexed with samtools.
    but after I loaded the sorted bam file into IGV, nothing showed up in the track. Do you have an idea why? Thanks.

    I am using IGV_2.3.5
    ubuntu 12.04

    ReplyDelete
  2. I'm not sure what happened there. Maybe try an older version of IGV, I know sometimes I had problems with the new release.

    ReplyDelete