BamView is a free interactive display of read alignments in BAM data files. It has been developed by the Pathogen Group at the Sanger Institute.
BamView can be launched with Java Web Start by clicking below:
| LAUNCH BamView |
Or download BamView from:
Alternatively launch the development version of Artemis. Within Artemis, the BamView panel shows the reads alongside the annotation. To use this in Artemis open up a sequence file and open the BamView panel from the "File" menu and select the "Read BAM..." option.
The source code is available as part of the Artemis code which can be downloaded from GitHub.
† Note for MacOSX: occasionally a browser decides to display the contents of the .dmg file rather than downloading it. If this happens hold down the control key and click on the download link or right click on the download link and save the link as a file.
BamView:
Viewing mapped read alignment data in the context of the reference sequence.
Tim Carver; Ulrike Böhme; Thomas D. Otto; Julian Parkhill; Matthew Berriman
Bioinformatics 2010;
doi:
10.1093/bioinformatics/btq010
BamView:
visualizing and interpretation of next-generation sequencing read alignments.
Tim Carver; Simon R. Harris; Thomas D. Otto; Matthew Berriman; Julian Parkhill; Jacqueline A. McQuillan
Brief. Bioinform. (2012);
doi:
10.1093/bib/bbr073
This application displays read alignments/mappings. As the name suggests it reads a BAM file that has been sorted and indexed using SAMtools.
RequirementsBamView requires Java 1.6 as it makes use of the Java bindings (Picard) to read the BAM file.
Command line optionsTo run the application on UNIX from the downloaded jar file run the UNIX:
java -mx512m -jar BamView.jar
and extra command line options are given when '-h' is used:
java -jar BamView.jar -h
BAM files can be specified on the command line with the '-a' option:
java -mx512m -jar BamView.jar -a pathToFile/sorted.bam
If a BAM filename is not given on the command line BamView will prompt for a file to be entered. The BAM index file should have the same name as the BAM file but with a '.bai' suffix. Multiple BAM files can be loaded and overlaid in the viewer. To make this easier BamView will read in files that contain a list of filenames.
Right click menu
A menu is shown when right clicking on the BamView window (see figure below). This provides a number of viewing options. If you right click over a read it also gives an option in the menu to show the details of that read in a separate window. Under the 'Show' menu there is an option to display the SNP's.
Viewing insertions and deletions
When zoomed in to the nucleotide level insertions are marked by purple vertical lines (see figure below). The insertion type is displayed as a tooltip when the mouse is positioned over the insertion. Deletions are marked with horizontal lines joining the sections of the read they belong to (see figure below). Clicking on a read highlights the read pair with a red border and the deletion lines become red.
Base qualities
Bases can be coloured by ('Colour By' -> 'Base Quality') their quality scores (blue <10; green <20; orange <30; black ≥30).
Viewing multiple BAM files
Additional BAM files can be read and overlaid in BamView by right clicking on the BamView panel and selecting the 'Add BAM...' option from the popup menu. The BAM files that are displayed can be switched off and on from the 'BAM files' menu in the popup menu.
Alternatively paths to multiple BAM files can be read from a file of file names. A file containing the list of BAM file names can be used when BamView is launched and prompts for a file name. It can also be given as an option on the command line:
java -mx512m -jar BamView.jar -a bam.list
Reading BAM files from HTTP linksThe sorted BAM and the index files can be read from an HTTP server. The URL can be supplied when BamView is opened:
Or on the command line:
java -jar BamView.jar -a 'http://127.0.0.1/BAM/sorted_new_bam.out.bam'
A file containing a lists of HTTP links to BAM files can also be used and read from an HTTP link, for example:
java -jar BamView.jar -a 'http://127.0.0.1/BAM/bam.list'
Increasing the Memory
Displaying BAM files with high coverage of reads is memory intensive. The 'Stack' view is generally quicker and the less memory intensive of the views. It may also be necessary to increase the memory available to the application.
On linux change the -mx value on the command line above. This is used to specify the maximum size, in bytes, of the memory allocation pool, e.g. -mx512m sets it to 512MB. This should be set to a smaller value than the total memory available on your computer.
On MacOSX, this value is set in the file Info.plist in the directory BamView.app/Contents. Towards the bottom of the file there are a couple of lines that look like this:
<key>VMOptions</key>
<string>-Xmx800m</string>
Changing the value after -Xmx will change the memory used by BamView.
On windows create a shortcut to the BamView JAR file. Edit the properties of the shortcut and add "java -mx512m -jar " to the start of the Target: field. -mx512m sets the maximum memory Java will allocate to BamView.
Large Lists of Contigs
To facilitate the selection of a particular contig, in the drop down list of available sequences, it is possible to type the contig name into the drop down box.
| LAUNCH in BamView |
| LAUNCH in Artemis |
This will open the BamView window similar to the example below. Right clicking on the window provides a pop-up menu from which different views can be selected.
Note that the bottom of the BamView display can be dragged up and down to alter the size of the window. Below is a zoomed out illustration of the stack view:
Below is an example of finding a sequencing error when comparing the reads to the reference.
Outline
There are a number of tools to align sequence reads to a reference sequence. Read alignment data that is generated by Maq can be converted to SAM using SAMtools (maq2sam-long for maq-0.6.x and maq2sam-short for maq-0.7.x). There is also a script (export2sam.pl) that converts Illumina export to SAM. Bowtie is short read aligner which can also generate SAM files. There is a useful Bowtie tutorial here.SSAHA2 is designed as mapping of sequencing reads onto genomic reference sequences. One of the output formats in SSAHA2 is the SAM format. The BWA software is an efficient program that aligns relatively short.
Using the SAMtools view flag SAM files can be converted to the binary version (BAM).
SAMtools can be downloaded for different operating systems (UNIX, MacOSX and Windows) from the download link on the SAMtools home page.
To sort a BAM file with SAMtools run the command with the 'sort' flag, e.g.:
samtools sort Plasmodium3D7_RNASeq.bam Plasmodium3D7_RNASeq_sorted
To index the sorted BAM the command to run will look like this:
samtools index Plasmodium3D7_RNASeq_sorted.bam
Then BamView can be launched from the web start link above or run from the downloaded jar, e.g:
java -jar -mx512m BamView.jar -a Plasmodium3D7_RNASeq_sorted.bam -r Pf3D7_13.emblExample
An example run using BWA to generate a BAM file from fastq files is given below:
Other example scripts are here for:
maq.pl and ssaha2 (version 2.5) must be in the path, as well as the samtools/misc/ directory (for maq). For malaria, ssaha will take a long time. Maq should need roughly 10x longer than bwa.
Troubleshooting if BamView is not opening:
We welcome contributions and suggestions for new features to BamView.
If you have comments about this software please send them to the BamView developers.