-
Notifications
You must be signed in to change notification settings - Fork 0
Lab 04: IGV
After running an alignment tool, you may be interested in visualizing how your reads align with your genome of interest. A popular tool for this job is Broad Institute's Interactive Genome Viewer (IGV), a Java-based desktop application for viewing large, integrated genomics datasets. IGV supports a wide variety of data types, including the results of STAR Alignment. This Lab will teach you how to download IGV, how to load your data into IGV, and how to use IGV.
IGV requires that any BAM files loaded into IGV must be sorted and indexed. You have already completed the first step, by outputting sorted BAM files with STAR, so we will focus on indexing a file.
A BAM Index file, or BAI for short, is an external table of contents for its respective BAM file. This file contains no actual sequence data, instead containing the chromosome names for your organism of interest. On its own, a BAI file is useless, but with a corresponding BAM file, it allows programs to jump to a specific point in the BAM file without having to go through every other sequence in the file.
mkdir 04_igv
cd 04_igv
ln -s ../03_mapping_star/SRR17062759.Aligned.sortedByCoord.out.bam .
To index our bam files, run the following command:
spack load /b7zjybq
samtools index SRR17062759.Aligned.sortedByCoord.out.bam
This process takes only a few seconds. You will only get a message if there are any errors, so the job will simply stop running if everything runs smoothly.
Go to IGV's web browser app. While a downloadable version is available, we prefer using this version.
Since IGV is a desktop program, you will need to copy all of your files from the server to your personal computer.
I usually create a new directory in my Downloads folder, and load the files there. If you aren't sure where this is in relation to your default folder on terminal, you can access it by doing this:
cd ~/Downloads
Once you are within your Downloads folder, run the following commands:
scp <your_username>@centaur.ag.utk.edu:/pickett_shared/teaching/RNASeq_workshop/analysis/<your_username>/04_igv/SRR17062759.Aligned.sortedByCoord.out.bam* .
IGV allows you to load a new genome onto IGV: go to Genomes > Local File ..., and select your genome Fasta file of interest. In this lab, because we are using the TAIR 10 genome assembly, we do not have to load our genome; scroll down the list of default genomes, and select A. thaliana (TAIR 10).
Go to Tracks > Local File ... and select one or more BAM files to load onto IGV. This will add two tracks for each BAM file - a Coverage track that shows how many reads, in total, cover a given base in the genome, and an Alignment track that shows each read in relation to the reference genome.
To zoom into a chromosome, you can use the zoom slider on the top right corner of IGV, the +
or -
keys on your computer, or click and drag on the genome ruler to select an area of interest.
To save your current IGV session, which will include all alignment and annotation files loaded, go to Session > Save .... To load it, simply go to Session > Local File... and select that session.