Lab: Visualization - statonlab/EPP_575_RNASeq_Workshop GitHub Wiki

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.

Step 1: Index BAM files

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.

To index our bam files, run the following command:

spack load /iutw2qe
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.

Step 2: Download IGV

Go to IGV's Download page, located in the menu on the left of the page, and download the IGV app for your brand of computer.

Step 3: Copy Sequences, BAM, and Index Files

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:

mkdir IGV_files
cd IGV_files

scp <your_username>@sphinx.ag.utk.edu:/pickett_shared/teaching/EPP575_Jan2022/reference_genome/Athaliana_447_TAIR10.fa .

Copy Gene Annotation

It is a good idea to copy your genome's annotation file, as a way to contextualize your expression data with the location of the coding sequences:

scp <your_username>@sphinx.ag.utk.edu:/pickett_shared/teaching/EPP575_Jan2022/reference_genome/Athaliana_447_Araport11.gene_exons.gff3 .

Copy BAM files

Finally, we will copy one of the BAM files, and its corresponding index files, to this directory:

scp <your_username>@sphinx.ag.utk.edu:/pickett_shared/teaching/EPP575_Jan2022/analysis/<your_username>/analysis/3_Read_mapping/SRR17062759.Aligned.sortedByCoord.out.bam* .

Step 4: Load Data Onto IGV

Loading a Genome Sequence

To load a new genome onto IGV, go to Genomes > Load Genome from File..., and select Ppersica_v2.0_chr1.fa. From this point on, if you want to use this genome again, you can simply select it from the Genome drop-down box in the top left corner of IGV.

Loading BAM Files and Genome Annotation

Go to File > Load from 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.

The GFF file is loaded in the same manner. It will be added to a Feature track that displays each gene feature, including coding and non-coding regions.

Navigating IGV

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 scroll through a chromosome, use the left and right arrow keys. The up and down keys will scroll through the selected Alignment track.

Since we have loaded a Feature track, we can jump forward a feature using Ctrl + F, and jump back a feature using Ctrl + B. Note that Mac users will still need to use the Ctrl key, not Command.

Saving and Loading Sessions

To save your current IGV session, which will include all alignment and annotation files loaded, go to File > Save Session.... To load it, simply go to File > Open Session... and select that session.