RNASeq: Visualizing mapped reads

From mn/ibv/bioinfwiki
Jump to: navigation, search

After mapping reads to a reference sequence, it is often informative to look at the resulting BAM file. Software used for this kind of visualization must display the reads along the reference sequence, together with relevant annotation (typically exons and genes). Two popular programs used for this are Tablet (http://ics.hutton.ac.uk/tablet) and the Integrated Genome Viewer (IGV - https://www.broadinstitute.org/igv). Tablet is a light-weight, user-friendly program that does the above and not much more. IGV has lots of additional features, but is not as intuitive to use as Tablet is.

A HPC cluster such as Abel must be used for mapping with Tophat; visualization however typically will take place on the local machine. This means that a large BAM file (possibly many gigabytes) must be downloaded from Abel. This may take hours, depending on the network conditions. There are two possible shortcuts that can make this process easier.

If only interested in manually checking the expression of a few genes all contained in the same contig sequence, it is possible to extract only the reads mapping to this contig from the BAM file:

module load samtools

samtools view -b /path/to/inputBamfile.bam nameOfContig > /path/to/outputBamfile.bam

Before continuing, remember to create an index for the new BAM file:

samtools index /path/to/outputBamfile.bam

Depending on the number of contigs in the reference sequence, the outputBamfile.bam may be less than 1% of the size of the original BAM file. When displaying the new BAM file on the local machine, the original reference fasta file and annotation file can be used (these are often much smaller than the BAM file; it is not worthwhile extracting only the contig in question from these files).

The second option is to install a visualization software such as Tablet on Abel, using the X11 system to run it directly from Abel. In this way, the BAM file does not have to be transferred at all. This means installing X11 software such as Xming; see here for a brief walkthrough. Installing and using Tabel via X11 from Abel works and does not require special permissions on Abel; it is however quite slow to use. Whether other visualization program also can be installed on Abel has not been investigated.

The procedure for installing Tablet on Abel is as follows:

mkdir tabletInstallation

cd tabletInstallation

wget http://bioinf.hutton.ac.uk/tablet/installers/tablet_linux_x64_1_14_10_21.sh

chmod 777 tablet_linux_x64_1_14_10_21.sh


The installation script will suggest to install Tablet into the "Tablet" folder. Provided accepting this, Tablet is started by simply stepping into this folder and executing "./tablet".