Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. If you have a mapping directory with output from the Mapping tutorial or  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. Expand
    titleIf you have not done the other tutorials and want a "canned" data set provided for you, click here for example files.
    Code Block
    $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 directoryscp -r username@lonestar.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.

...

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. 

Expand
titleWe'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:

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

...

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

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

...

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.

For starters, you could change into your mapping directory and run commands like these if you just came from the mapping tutorial:

...

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.

Code Block
languagebash
titleNote the need to add the suffix _fix to "samtools_tutorial" in final 4 copy steps if used the single file execution
mkdir IGV_export
cp -i NC_012967.1.gbk.gff IGV_export cp bowtie/SRR030257.sorted.bam IGV/bowtie.sorted.bam
cp bowtie/SRR030257.sorted.bam.bai IGV/bowtie.sorted.bam.bai
...

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

Expand
Remember how? Try it on your own first, before peeking...Remember how? Try it on your own first, before peeking...In
 # copy the new file you just converted to the export directory
cp -i $SCRATCH/bowtie2MappingTutorial/NC_012967.1.fasta IGV_export
cp -i $SCRATCH/samtools_tutorial/NC_012967.1.fasta.fai IGV_export
cp -i $SCRATCH/samtools_tutorial/SRR030257.vcf IGV_export
cp -i $SCRATCH/samtools_tutorial/SRR030257.sorted.bam IGV_export/bowtie2.sorted.bam
cp -i $SCRATCH/samtools_tutorial/SRR030257.sorted.bam.bai IGV_export/bowtie.sorted.bam.bai
tar -czvf IGV_export.tar.gz IGV_export

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

Expand
titleAnother refresher on how to copy files back from lonestar

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

Code Block
pwd

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

Code Block
scp -r <username>@lonestar.tacc.utexas.edu:</full/path/to/IGV/> .
<full_path_to_IGV>/IGV_export.tar.gz .

tar -xvzf IGV_export.tar.gz

Anchor
Launching IGV
Launching IGV

...

Warning

For the remainder of the tutorial, work on your local machine. NOT TACC!

There are two multiple ways ; Launching IGV in your web browser or by downloading the binaries locally and running IGV from your machine.

...

to launch IGV on a local computer, in decreasing order of recommendation due to recent mac OS updates and easy of use:

  1. Expand
    titleLocally on the classroom machines booted in Mac OSX

    Click here to download and install the mac application version

  2. Expand
    titleLocally on the classroom machines booted in Linux

    This downloads the IGV executable and tells the command line to launch it (via the java command).

    Code Block
    wget http://www.broadinstitute.org/igv/projects/downloads/IGV_2.3.32.zip unzip IGV_2.3.32.zip cd IGV_2.3.32 java -Xmx2g -jar igv.jar

...

  1. Expand
    titleIn a Web browser

    Navigate a web browser to this page:http://www.broadinstitute.org/software/igv/download. You will need to register your email address to use this option

...

  1. , but in years of registration I have never noticed any emails from them. Go ahead and click on the "Launch with 2 GB" option. This will download a "Java Web Start" file that you can launch by locating it on your Desktop and double-clicking.

...

Locally on a Mac or Windows computer

Use this link to download IGV:

...

  1. Warning
    titleMac warning

    This will not work on recent Mac OS updates without severely modifying security permissions as administrator. Recommended to use Mac directions above.

  2. Expand
    titleLocally on a Mac or Windows computer

    Click here to download version 2.3.53 of IGV or visit https://www.broadinstitute.org/software/igv/

...

  1. download to download the latest binary version. After unzipping, you should be able to click on igv.bat for Windows or igv.command on MacOSX to lauch IGV. If this is not working, you might need to try the web start.

    Warning
    titleMac warning

    This will not work on recent Mac OS updates without severely modifying security permissions as administrator. Recommended to use Mac directions above.

 

Load genome into IGV

From the main window of IGV, click on Genomes > Create .genome File... and you should be presented with the following window.

...

From the main window of IGV, click on File > Load from File.... Choose bowtie bowtie2.sorted.bam

After importing your reference genome and loading an alignment file, click on the + button in the upper right until reads appear! Then, your screen should look similar to the following:

And you are now free to investigate different areas and their alignments in the genome.

Navigating in IGV

There are a lot of things you can do in IGV. Here are a few:

  • Zoom in using the slider in the upper right. Do this until you see mapped reads and finally individual bases appear.
  • Navigate by clicking and dragging in the window. This is how you move left and right along the genome.
  • Navigate more quickly. Use page-up page-downhomeend.
  • Jump to the next point of interest. Click on a track name on the left side of the window (Ex: bowtie.vcf), to select it. You can then use control-f and control-b to jump forward and backward within that list of features. Try this on the variant calls track.
  • Jump right to a gene. (If you have gene features loaded.) Type its name into the search box. Try "topA".
  • Load multiple BAM alignments or VCF files at once. Try this to compare a few different regions between the bowtie and BWA results.
  • Change the appearance of genes. Right click on the gene track and try "expanded". Experiment with the other options.
  • Change the appearance of reads. Right click on a BAM track and choose "show all bases" and "expanded". Experiment with the other options.

See the IGV Manual for more tips and how to load other kinds of data.

Exercises

...

What is a typical mapping quality (MQ) for a read? Convert this to the probability that it is mismapped.

Expand
titleRemember the formula for a Phred quality score?

The estimated probability that a read is mapped incorrectly is 10^(-MQ/10).

Can you find a variant where the sequenced sample differs from the reference? This is going to be like looking for a needle in a haystack. Fortunately, we are going to learn how to use variant callers tomorrow and then we'll be able to zoom right to areas where there are discrepancies between reads and the reference genome that might indicate there were mutations in the sequenced E. coli.

...

  • Coordinate 161,041. What gene is this in and what is the effect on the protein sequence?
  • Coordinate 3,248,957. What gene is this in and what is the effect on the protein sequence?
  • Coordinate 4,015,892. What is different about the reads mapped to this location?
  • Coordinate 3,894,997. What type of mutation is this?
  • Coordinate 1,733,647. What's going on here?
  • See if you can find more interesting locations. There are ~40 mutations total in this sample.

Load variant calls into IGV

We're really interested in places in the genome where we think there are mutations. If you have completed the Variant calling tutorial, then you can load your VCF files to check out those spots, but first you need to (guess what?) index it.

You can do this from within IGV:

  1. Choose Tools > Run igvtools....
  2. Choose "index" from the commands drop-down menu.
  3. Select your *.vcf file (Ex: bowtie.vcf) for "Input File"
  4. Click the "run" button.

It will look like nothing has happened, but you can now close the "Run" window and choose File > Load File. If you navigate to your IGV directory, you will now see a brand new bowtie.vcf.idx file. You can now load the file bowtie.vcf, and it will show up as a new track near the top of your window.

Tip: You can also index BAM and FASTA files the same way inside of IGV if you haven't already created indexes for them. But, it's usually easier and quicker to do this on the command line at TACC. Indexing BAM files can be a computationally hefty task. 

Exercises

Check out the rbsA gene region? What's going on here?

...

There was a large deletion. Can you figure out the exact coordinates of the endpoints?

Navigate to coordinate 3,289,962. Compare the results for different alignment programs and settings. Can you explain what's going on here?

...

There is a 16 base deletion in the gltB gene reading frame.

What is going on in the pykF gene region? You might see red read pairs. What does that mean? Can you guess what type of mutation occurred here?

...

Load variant calls into IGV

We're really interested in places in the genome where we think there are mutations. In the Variant calling tutorial we identified such locations but lacked a good way to visualize them. This is your opportunity to visualize them. We have already transferred the SRR030257.vcf file back to your local computer, but before we can visualize them, we need to (guess what?) index it.

You can do this from within IGV:

  1. Choose Tools > Run igvtools....
  2. Choose "index" from the commands drop-down menu.
  3. Select the SRR030257.vcf file  for "Input File"
  4. Click the "run" button.

It will look like nothing has happened, but you can now close the "Run" window and choose File > Load File. If you navigate to your IGV directory, you will now see a brand new SRR030257.vcf.idx file. You can now load the SRR030257.vcf file, and it will show up as a new track near the top of your window.

Tip: You can also index BAM and FASTA files the same way inside of IGV if you haven't already created indexes for them. But, it's usually easier and quicker to do this on the command line at TACC. Indexing BAM files can be a computationally hefty task. 

You are now free to investigate different areas and their alignments in the genome.

Navigating in IGV

There are a lot of things you can do in IGV. Here are a few:

  • Zoom in using the slider in the upper right. Do this until you see mapped reads and finally individual bases appear.
  • Navigate by clicking and dragging in the window. This is how you move left and right along the genome.
  • Navigate more quickly. Use page-up page-downhomeend.
  • Jump to the next point of interest. Click on a track name on the left side of the window (Ex: bowtie.vcf), to select it. You can then use control-f and control-b to jump forward and backward within that list of features. Try this on the variant calls track.
  • Jump right to a gene. (If you have gene features loaded.) Type its name into the search box. Try "topA".
  • Load multiple BAM alignments or VCF files at once. Try this to compare a few different regions between the bowtie and BWA results.
  • Change the appearance of genes. Right click on the gene track and try "expanded". Experiment with the other options.
  • Change the appearance of reads. Right click on a BAM track and choose "show all bases" and "expanded". Experiment with the other options.

See the IGV Manual for more tips and how to load other kinds of data.

Exercises

  • Why are some reads different colors? Hint: Try changing the display options to show read pairs and editing some of the distance constraints.
  • What is a typical mapping quality (MQ) for a read? Convert this to the probability that it is mismapped.

    Expand
    titleRemember the formula for a Phred quality score?

    The estimated probability that a read is mapped incorrectly is 10^(-MQ/10).

  • Can you find a variant where the sequenced sample differs from the reference? This would be like looking for a needle in a haystack if not for the use of variant callers and the control-f and control-b options to zoom right to areas where there are discrepancies between reads and the reference genome that might indicate there were mutations in the sequenced E. coli.

    Expand
    titleSome interesting example coordinates
    • Expand
      titleCoordinate 161,041. What gene is this in and what is the effect on the protein sequence?

      Gene is pcnB, mutation is a snp

    • Expand
      titleCoordinate 3,248,957. What gene is this in and what is the effect on the protein sequence?

      Gene is infB, mutation is a snp

    • Expand
      titleCoordinate 3,894,997. What type of mutation is this?

      Deletion of the rbsD gene

    • Expand
      titleCheck out the rbsA gene region? What's going on here?

      There was a large deletion. Can you figure out the exact coordinates of the endpoints?

    • Navigate to coordinate 3,289,962. Compare the results for different alignment programs and settings. Can you explain what's going on here?

      Expand
      Answer
      Answer

      There is a 16 base deletion in the gltB gene reading frame.

    • What is going on in the pykF gene region? You might see red read pairs. What does that mean? Can you guess what type of mutation occurred here?

      Expand
      Answer
      Answer

      The read pairs are discordantly mapped. There was an insertion of a new copy of a mobile genetic element (an IS150 element) that exists at other locations in the reference sequence.

...

    • See if you can find more interesting locations. There are ~40 mutations total in this sample MOST of which are false positives.

Workflow 2: Viewing Human Genome Data in IGV

If Now that you've made it through the other exercises on your own data, take a look at some human genome re-sequencing data where the files can be loaded directly from public databasesfamiliarized yourself with IGV using a "simple" bacteria, let's look at something a "little" more complex: the human genome.

Advanced exercise: human data scavenger hunt 

...

...

See this page for the human data scavenger hunt

Data from the CEU trio from the 1000 Genomes Project can be found directly from the Broad's server for IGV. There are now MANY genomes available this way - one of the original family trios are represented in samples NA12892, NA12891, and NA12878 (mom, dad, child respectively).

Find one or more dbSNP accession numbers for SNPs apparent in one of the two 1000 genomes project trios in the GABBR1 gene.

Steps:

  1. Download and  and install the Integrative Genome Viewer from the Broad Institute. 
  2. Select "Human hg18" or "Human hg19" as the reference genome from the top left drop down (you may need to select "more" to have hg19 as an option)
  3. Get some data: File > Load from Server… > 1000 genomes > Alignments > CEU Trio WGS > select those 3 samples
  4. Navigate to the rightmost exons of the GABBR1 gene
  5. Zoom in until you find some SNPs - they might be in exons or introns; there is also at least one example of a short insertion variant between exons 2 and 3> ACB > exome > HG01880
  6. Navigate to the rightmost exons of the GABBR1 gene.
  7. Zoom in until you find some SNPs. (Hint look just to the left of the 2nd exon).
  8. What type of library is this? (Hint: zoom out)
  9. If you knew this was a cancer patient, consider how strongly you would think this may be a potentially causative mutation.
  10. Imagine it was actually in the exon rather than just into the intron... would that make you consider it more?
  11. Load and look at the SNP track: File > Load from server > Annotations > Variants and Repeats > dbSNP

This is whole genome coverage data; later we'll look at exome data.

...

rs29220, rs29222, rs28359988, rs76688565, there might be more in the locus; I got tired of looking.

...

  1. 1.3.7
  2. The track may load with the Refseq genes, making it useful to resize that window to view both the gene and the dbSNP information simultaneously.
  3. Consider if this makes you think it more likely or less likely that this is a causative mutation.

 

From here...

 

Expand
titleTo visualize mapped data without calling variants

You will need to index your reference FASTA and convert your SAM output files into sorted and indexed BAM files. The "why?" behind these steps is described more fully in the Variant calling tutorial. If you are in your mapping directory, these commands will perform the necessary steps.

Warning
titleSubmit to the TACC queue or run in an idev shell
Code Block
samtools faidx NC_012967.1.fasta
samtools view -b -S -o bowtie/SRR030257.bam bowtie/SRR030257.sam
samtools sort bowtie/SRR030257.bam bowtie/SRR030257.sorted
samtools index bowtie/SRR030257.sorted.bam

Repeat the last three commands for each SAM output file that you want to visualize in IGV.

...