created by shlee
on 2015-11-24
Visualize sequence read alignment data (BAM or SAM) on IGV using this quick-start tutorial. The Integrative Genomics Viewer is a non-GATK tool developed at the Broad Institute that allows for interactive exploration of large genomic datasets.
Tools involved
Prerequisites
.genome
or FASTA
file genome.Download example data
human_g1k_v37_decoy.fasta
that corresponds to the Human (1kg, b37+decoy)
reference hosted by IGV.Related resources
To view aligned reads using the Integrative Genomics Viewer (IGV), the SAM or BAM file must be coordinate-sorted and indexed.
Human (1kg, b37+decoy)
.6491_snippet.bam
. IGV automatically uses the corresponding 6491_snippet.bai
index in the same folder.10:96,867,400-96,869,400
into the textbox at the top and press Go. A 2 kbp region of chromosome 10 comes into view as shown in the screenshot above.Alongside read data, IGV automatically generates a coverage track that sums the depth of reads for each genomic position.
H0164ALXX140820:2:2107:7323:30703
into the read name textbox and press OK. IGV will highlight two reads corresponding to this query name in bold red.Because IGV holds in memory a limited set of data overlapping with the genomic interval in view (this is what makes IGV fast), the select by name feature also applies only to the data that you call into view. For example, we know this read has a secondary alignment on contig hs37d5 (hs37d5:10,198,000-10,200,000
).
If you find IGV sluggish, download a Java Web Start jnlp
version of IGV that allows more memory. The highest memory setting as of this writing is 10 GB (RAM) for machines with 64-bit Java. For the tutorial example data, the typical 2 GB allocation is sufficient.
jnlp
version of IGV, you may need to adjust your system's Java Control Panel settings, e.g. enable Java content in the browser. Also, when first opening the jnlp
, overcome Mac OS X's gatekeeper function by right-clicking the saved jnlp
and selecting Open with Java Web Start.To change display settings, check out either the Alignment Preferences panel or the Alignment track Pop-up menu. For persistent changes to your IGV display settings, use the Preferences panel. For track-by-track changes, use the Pop-up menus.
Default Alignment Preferences settings are tuned to genomic sequence libraries. Go to View>Preferences and make sure the settings under the Alignments tab allows you to view reads of interest, e.g. duplicate reads.
prefs.properties
file within your system's igv
folder. IGV automatically generates a new prefs.properties
file with default settings. See IGV's user guide for details.After loading data, adjust viewing modes specific to track type by right-clicking on a track to pop up a menu of options. For alignment tracks, these options are described here.
Updated on 2020-01-31
From vivekruhela on 2018-06-25
@shlee :smile:
Thanks for this post to help us in learning IGV. I am trying to use IGV for BAM file visualization. Everything is working well but, unfortunately, at last, I am getting only Chr M visualization rest for all other chromosomes, I do not get any visualization. I tried the same BAM file with other software like `tablet` (developed by James Hutton Institute (https://ics.hutton.ac.uk/tablet/) ) here I am getting the warning of total read count of zero and only chr M can be visualized. But I have made sure many times that read counts are not zero (using the command `samtools view -c BAMFile.BAM`) and similar commands for getting mapped read count also. None of them is zero. So why I am getting a warning of zero read count while it is not zero and why IGV is not able to visualize other chromosomes except chr M. I am waiting for your suggestions… Thanks.
From Sheila on 2018-06-26
@vivekruhela
Hi,
It sounds like your BAM file only has reads from chrM. What happens when you try to view another chromosome in IGV? Are there just no reads shown?
-Sheila
From shlee on 2018-06-26
Hi @vivekruhela,
I’m not familiar with `tablet` but I am familiar with `IGV`. For IGV, make sure (i) your reference matches that which your reads were aligned to and (ii) View>Preferences>Alignments settings do not filter your reads of interest. Also, If you do a `samtools flagstat` or `gatk FlagStat`, do you have reads that pass QC, are non-duplicate and not supplementary? You can learn about SAM flags [here](https://software.broadinstitute.org/gatk/blog?id=7019) if you are unfamiliar. Finally, it is often helpful for us to diagnose what is going on with a few example reads from your data that you expect to visualize elsewhere besides chrM. If you can post them to this thread, that would be great.
If you jump to this new region, is the read also highlighted in red?