Viewers

The Mosaic platform provides a lightweight framework called Viewers, which enables users to view their data using new or existing web-based tools; those that are based on running an Application to create a visualization ("App Based Viewers"), and those that are based on HTML files with embedded JavaScript code ("HTML based viewers").

App Based Viewers
How App Based Viewers Work

An HTML Based Viewer is an HTML file with embedded JavaScript that has access to some user-specified files. When a Viewer is opened, a dialogue first appears that enables you to choose a set of files in your workspaces, for which download URLs are then generated. These files' download URLs are then made available to the Viewer through a snippet of JavaScript code. From there, a Viewer can link to another web server, such as the Taxonomer metagenomic profiler, or run some JavaScript within the Viewer itself -- for instance, by using an outside plotting library such as pileup.js.

Because App Based Viewers are associated with Job executions, only users with "CONTRIBUTE" or "ADMINISTER" membership levels can initiate them. However, if a view has been launched, all users with access to the Workspace will be able to see the visualization result.

App Based Viewers are created and maintained by the administrators of Mosaic. If you have created an application that outputs visualizations in HTML format and can be associated with a single input file, please let us know and we will review the possibility of including it in our list of App Based Viewers.


Available App Based Viewers
  • Krona Viewer:

    This viewer is associated with files having a `biom` extension and it creates multi-layered pie charts using the popular Krona tool (https://github.com/marbl/Krona/wiki). Please note that, although we have tested this Viewer with different inputs, it might not work in some cases due to `biom` formatting issues. If that's the case, please contact Mosaic support to review the issue.

  • Icarus Viewer:

    The Icarus viewer enables users to visualize assembled sequences against a set of reference genomes. This viewer is associated with fasta files (extensions `fasta`, `fa`, `fas`, `fna`,`ffn` and `frn`). When a user launches this viewer, they will also need to select either a tarball file (`tar.gz`) containing reference fasta files, or an array of reference fasta files. This viewer launches an app implementing MetaQUAST (http://quast.sourceforge.net/metaquast) to create the Icarus HTML.

HTML based viewers
How HTML based Viewers Work

App based viewers are associated with files having specific extensions and work by running a Mosaic app to produce a visualization. For example, the Icarus Viewer can be found in the detail page of any fasta file. Some viewers, e.g Icarus, may take additional inputs at the time of execution. An App Based Viewer launches a job execution to create an output HTML file in the workspace where the source file is located. When a viewer is launched, a link is provided ("View Job") so that the user can manage and monitor the job execution. Upon completion on the execution, the visualization of the file is displayed as an object in the original file's detail page. In the case you would like to relaunch a viewer with different additional inputs, you can delete the HTML file created by the viewer-related app execution.

The only difference between custom and Featured Viewers is that you can create and share custom Viewers with collaborators just as you would share any other item in your workspaces. Featured Viewers are available to all users on the platform through a tab in the Tools page, and can only be created or changed by Mosaic staff. When a custom Viewer is present in a workspace you select, it will be listed in the Viewers tab. If you have created an awesome viewer that you want to make available to the whole Mosaic community, please let us know and we will consider promoting it to a Featured Viewer.

Custom Viewers

Developers comfortable with HTML and JavaScript can create custom viewers to visualize data on the platform. You can upload viewers directly from your web browser by clicking "Add Viewer" in the Viewer area of a workspace. In the Create Viewer interface you will have to choose a name for your viewer and also optionally provide regular expressions for which file should be pre-filtered when another user runs the Viewer. For example, if your Viewer requires inputs in "fastq" format, you may use the `.fastq$` regular expression. Then you can choose the viewer you want to upload from your local computer. Once the upload is complete, your viewer will be accessible through the viewer tab. Viewers cannot be edited, but they can be copied to other workspaces or deleted.

In order to better understand how HTML viewers work, you may download the source file of the "BAM header viewer" here. In order to learn more about JavaScript, visit https://www.w3schools.com/js/.

Some viewers are available under the featured viewers section in tools.

Available Featured Viewers
  • Human genome browsers (BioDalliance):

    The BioDalliance viewer provides HTML-based human genome browsers which you can use to visualize mappings and variants. When launching either one of these viewers, tick a pair of *.bam + *.bai files for each mappings track you would like to visualize, and a pair of *.vcf.gz + *.vcf.gz.tbi for each variant track you want to add. In addition, the BioDalliance browser supports bigBed (*.bb) and bigWig (*.bw) tracks.

    For more information about BioDalliance please consult this page http://www.biodalliance.org/started.html.

  • BAM header viewer:

    The BAM Header Viewer allows you to peek inside a BAM header, similar to what you would get if you were to run samtools view -H on the BAM file. (BAM headers include information about the reference genome sequences, read groups, and programs used). When launching this viewer, tick one or more BAM files (*.bam).

  • Gzipped file viewer:

    This viewer allows you to uncompress and see the first few kilobytes of a gzipped file. It is conceptually similar to what you would get if you were to run zcat file | head. Use this viewer to peek inside compressed reads files (*.fastq.gz) or compressed variants files (*.vcf.gz). When launching this viewer, tick one or more gzipped files (*.gz).

Launching a viewer

Clicking on a ‘Launch Viewer’ button will open a data selector for you to choose the files you wish to visualize. Tick one or more files that you want to provide to the Viewer. (The Viewer does not have access to any other of your data.) From there, you can launch the Viewer (2). It launches the viewer in new window.