/
IGV Tutorial -- GVA2016

IGV Tutorial -- GVA2016

Overview

The Integrative Genomics Viewer (IGV) from the Broad Center allows you to view several types of data files involved in any NGS analysis that employs a reference genome, including how reads from a dataset are mapped, gene annotations, and predicted genetic variants.

Learning Objectives

In this tutorial, we're going to learn how to do the following in IGV:

  • Create a custom genome database (usually used for microbial genomes) or load a pre-existing genome assembly (usually used for the genomes of model organisms and higher Eukaryotes).
  • Load output from mapping reads to a reference genome.
  • Load output from calling genetic variants.
  • Navigate the view of the genome and interpret the display of this data.

Theory

Because NGS datasets are very large, it is often impossible or inefficient to read them entirely into a computer's memory when searching for a specific piece of data. In order to more quickly retrieve the data we are interested in analyzing or viewing, most programs have a way of treating these data files as databases. Database indexes enable one to rapidly pull specific subsets of the data from them.

The Integrative Genomics Viewer is a program for reading several types of indexed database information, including mapped reads and variant calls, and displaying them on a reference genome. It is invaluable as a tool for viewing and interpreting the "raw data" of many NGS data analysis pipelines.

 

Workflow 1: Viewing E. coli data in IGV

Data files

You can start this tutorial two ways:

  1. If you have a mapping directory with output from the Mapping tutorial and the SNV calling tutorial, then you should use those files for part 1 of this tutorial. You can proceed with either one alone or with both.
  2.  If you have not done the other tutorials and want a "canned" data set provided for you, click here for example files.
    $BI/gva_course/mapping/IGV  # location of example files
    cp -r /corral-repl/utexas/BioITeam/gva_course/mapping/IGV .  # example command to copy to current directory
    scp -r username@ls5.tacc.utexas.edu:/corral-repl/utexas/BioITeam/gva_course/mapping/IGV . # to copy to a local computer skipping the step of copying to a lonestar directory and secure copying from there.

    Then skip down to #Launching IGV.

Prepare a GFF feature file for the reference sequence

IGV likes its reference genome files in GFF (Gene Feature Format). Unfortunately, our old friend bp_seqconvert.pl doesn't do GFF. So, we're going to show you another tool for sequence format conversion called Readseq. We've already installed it into the $BI/bin directory so you don't have to, but here we provide the steps that can be used to install it in a local directory.

 We've already installed it into the $BI/bin directory so you don't have to, but here we provide the steps that can be used to install it in a local directory.

To use it you need to first download the file readseq.jar linked from here. To get this onto TACC easily, use:

wget http://iubio.bio.indiana.edu/soft/molbio/readseq/java/readseq.jar

Readseq is written in java which makes it a little more complicated to use, but the general command to run the software is one of these (note that you do need to include the entire path, not just the "readseq.jar" name):

java -jar /corral-repl/utexas/BioITeam/bin/readseq.jar
java -cp /corral-repl/utexas/BioITeam/bin/readseq.jar run

This should return the help for Readseq.

 Why the funny invocation?
You are actually using the command java and telling it where to find a "jar" file of java code to run. The -jar and -cp options run it in different ways. It's pretty confusing.

 

To do the conversion that we want, use this command:

cds
mkdir BDIB_IGV_Tutorial
cd BDIB_IGV_Tutorial
java -cp /corral-repl/utexas/BioITeam/bin/readseq.jar run $SCRATCH/BDIB_bowtie2_mapping/NC_012967.1.gbk -f GFF -o NC_012967.1.gbk.gff

It's a bit hard to figure out because, unlike most conventions, it takes the unnamed arguments before the optional flag arguments, there is no example command, and you have to switch -jar to -cp. Search online for usage examples when you can't figure something out from the help. Take a look at the contents of the original Genbank file and the new GFF file and try to get a handle on what is going on in this conversion using commands like head and tail.

Copy files to your desktop

IGV is an interactive graphical viewer program. You can't run it on TACC, so we need to get the relevant files back to your desktop machine.

They include:

  • Indexed reference FASTA files
  • GFF reference sequence feature files
  • Sorted and indexed mapped read BAM files
  • VCF result files
  • ... and possibly many other types of files.

The easiest way to to this is probably to copy everything you want to transfer into a new directory called IGV_export. Since many of the tutorial output files had the same names (but resided in different directories) be careful to give them unique destination names when you copy them into the new directory together. To ensure you don't overwrite things be sure to use the -n or -i option with the cp command. The difference comes from different versions of linux having slightly different cp command options. The -n command will not allow you to overwrite files, while the -i command will prompt you before overwriting anything.

Note the need to add the suffix _fix to "samtools_tutorial" in final 4 copy steps if used the single file execution
mkdir BDIB_IGV_export
cp -i NC_012967.1.gbk.gff BDIB_IGV_export  # copy the new file you just converted to the export directory
cp -i $SCRATCH/BDIB_bowtie2_mapping/NC_012967.1.fasta BDIB_IGV_export
cp -i $SCRATCH/BDIB_samtools_tutorial/NC_012967.1.fasta.fai BDIB_IGV_export
cp -i $SCRATCH/BDIB_samtools_tutorial/SRR030257.vcf BDIB_IGV_export
cp -i $SCRATCH/BDIB_samtools_tutorial/SRR030257.sorted.bam BDIB_IGV_export/bowtie2.sorted.bam
cp -i $SCRATCH/BDIB_samtools_tutorial/SRR030257.sorted.bam.bai BDIB_IGV_export/bowtie2.sorted.bam.bai
tar -czvf BDIB_IGV_export.tar.gz BDIB_IGV_export

Now, copy the entire compressed IGV directory back to your local Desktop machine.

 Another refresher on how to copy files back from lonestar

In the terminal connected to Lonestar, figure out the complete path to the IGV directory.

pwd

Open a new terminal window on your Desktop. Fill in the parts in brackets <> in this command:

scp -r <username>@ls5.tacc.utexas.edu:<full_path_to_IGV>/BDIB_IGV_export.tar.gz .
# enter your password 
tar -xvzf BDIB_IGV_export.tar.gz

Launching IGV