Skip to content

User's Guide

Weizhong Li edited this page Jul 28, 2018 · 5 revisions

Welcome to the mgaviewer wiki http://weizhongli-lab.org/mgaviewer !

Program developed by Weizhong Li's lab at UCSD http://weizhongli-ab.org
Contact: [[email protected]].

Table of Contents

Introduction

Numerous metagenomics projects have produced tremendous amounts of sequencing data. Aligning these sequences to reference genomes, which is referred to as Fragment Recruitment (FR), is an essential analysis in metagenomics studies. Large-scale FR data call for intuitive and efficient visualization tool. However, current tools such as various genome browsers are highly specialized to handle intraspecies mapping results. They are not suitable for FR data in metagenomics, which are often interspecies alignments. We have developed a web browser-based desktop application for interactively visualizing FR data of metagenomic sequences. This viewer is easy to use on all computer systems with modern web browsers and requires no software installation.

This program is still under active development. New features and new programs will be added in the future.

Implementation

MGAviewer utilizes jQuery as the base JavaScript library, and on top of which a modified and extended jQuery plotting plugin: Flot. HTML5 Canvas element is responsible for draw the interactive plot. Data files for plotting are in JSON format.

Interface and Operations

MGAviewer is a web-browser based application. To use it, only a modern web browser is required--no additional software or plugin needs to be installed. It has been tested in Mozilla Firefox, Google Chrome, Apple Safari, Opera, and Microsoft Internet Explorer 9. For Internet Explorer 8, which does not support Canvas natively, an additional emulation layer has to be used, so performance is less than desired.

As shown in the following screenshot, the interface is divided into two parts: 1) the plot, 2) selection boxes.

In the plot, double-click, scroll-up to **zoom in**; scroll-down to **zoom out**. You can also click on the control buttons. Drag to **pan** to plot horizontally.

Hover mouse pointer on an aligned fragment or gene, a small popup will show up with more information.

Generating MGAviewer Instance from User Data

A script (**createSite.py**) is provided in the downloadable package to generate an instance of MGAviewer from user's own alignment data. Currently it only supports FR-HIT and BLAST output. For information on how to run these programs, please check their web sites.

We assume alignment result file contains result for one query sample.

This script also requires

  - [http://python.org Python] 2.6 or newer
  - [http://biopython.org BioPython]
  - Internet connection (for retrieving reference genome annotations from NCBI)

Once the alignment result file is available and the above software is ready, prepare an index file containing information about the queries in the following format per line: alignment_file_name sample_id sample_name alignment_method where alignment_method is either '**frhit**' or '**blast**'.

For example, in the downloadable package, there's an index file 'alignment.index' with the following content: sample1.frhit sample1 sample1 frhit sample2.frhit sample2 sample2 frhit where sample1.frhit and sample2.frhit are alignment result files also provided in the package.

Now run the following command: python createSite.py index_file for example, python createSite.py alignment.index for the provided example.

The time running the script depends on total size of your alignments files and also depends on your internet connection speed.

Once it is finished, you'll get a directory 'site' containing all necessary files. Open 'index.html' in a web browser to view the plot.

The generated instance of MGAviewer can also be hosted on a web server. Because no server-side scripting is required, all files are static so can be hosted at any URL accessible by web users.

References

  1. Zhengwei Zhu, Beifang Niu, Jing Chen, Sitao Wu, Shulei Sun and Weizhong Li. MGAviewer: A desktop visualization tool for analysis of metagenomics alignment data. Bioinformatics (2013) V29:122–123. PDF