Installing Laj as an Applet


TABLE OF CONTENTS


Introduction

This document provides instructions for people who want to set up Laj as an applet on their own web site, in order to display their data for viewing by others. Both forms of Laj (applet and stand-alone application) are distributed together, so the initial download and unpacking instructions are the same. Installing it as an applet, however, requires some additional steps: ensuring that Laj and the data files you want to display are accessible to your web server, and building a web page to run the applet.

Installation

Laj is available for download as a compressed zip archive,  laj.zip . This was created with the Java jar tool, but the format is compatible with PKUnzip and many other unzip programs. Unzipping the archive will produce laj.jar (a jar file containing the program itself) and a docs subdirectory containing some documentation files in HTML format. If your unzipper program does not preserve the directory structure and complete file names from the archive, you may need to move and/or rename the documentation files manually in order for the applet's help function to work. Note that the laj.jar file does not need a second round of unzipping -- Java will access it "as is". Be sure to unzip the archive in a directory/folder that will be accessible to your web server, e.g., a new laj directory somewhere in the server's space.

Since Java applets are run by the user's web browser, you do not need to have Java itself installed on your server. Users, however, will need browsers that reliably support at least Java 1.2, and preferably Java 1.3 or higher. For best compatibility we recommend Sun's free Java Plug-in software; the file java_plugin_help.html that comes with Laj contains more information, and you may want to include a link to this file on your Laj web page.

Data Files

Laj can make use of several kinds of data, including alignments, original sequences, exons, repeats, annotation links, color underlays, and text highlights. Only the alignment file is required; the others are optional. For detailed descriptions of these files and their format requirements, please see Input File Formats for Laj. These files must be accessible to your web server. We find it convenient to group the files for each invocation (e.g., each genomic region) in a separate subdirectory of the laj directory. Any of these files can be compressed with GZIP, if the file name ends with ".gz".

Web Page

The last step is to create a web page on your server that invokes the applet with the appropriate parameters for loading your data files. The applet normally appears as a labeled button that opens an Laj window when the user clicks on it; thus you can have several buttons on the same page, each set up to display a different set of data. The basic format of the HTML code looks like this:

  <applet code="edu.psu.cse.bio.laj.LajApplet.class"
          archive="laj.jar"
          width="200" height="30">
  <param name=buttonlabel    value="BTK">
  <param name=title          value="BTK region, human (x) vs. mouse (y)">
  <param name=alignfile1     value="/java/laj/BTK/blastz.out">
  <param name=exonfile       value="/java/laj/BTK/exons">
  <param name=repeatfile     value="/java/laj/BTK/repeats">
  <param name=annotationfile value="/java/laj/BTK/annotations">
  <param name=underlayfile   value="/java/laj/BTK/underlays">
  <param name=highlightfile  value="/java/laj/BTK/highlights">
  </applet>
This particular fragment is from the BTK example on our server; naturally you need to replace the values with your own button label, window title, and file URLs. A few things to note:

Additional Parameters

HTML Conversion

Now for the bad news. The relatively simple HTML code listed above may cause the user's browser to invoke its own internal version of Java, which is likely to be outdated and buggy. Some newer browsers will automatically invoke the Java Plug-in if it is installed, but creating a single web page that will coax a variety of browsers on a variety of platforms to use the Java Plug-in if possible, and only fall back to the internal Java as a last resort, is an exercise in hairy kludges (as discussed at http://java.sun.com/products/plugin/1.2/docs/tags.html ).

Fortunately, Sun provides a handy HTML Converter program, available for download at http://java.sun.com/products/plugin/1.2/converter.html , that takes care of this for you. [Note: as of this writing, this page contains an HTML bug which may cause the main content to be omitted; click on the "Print-friendly" link to see it.] However, this program is itself written in ... you guessed it ... Java, so if you want to use it you'll have to install Java after all. You don't really need a full-fledged Java development kit for this; a simple runtime environment such as Sun's free JRE should be fine. (Much of the information in Installing the Java Plug-in also applies to obtaining the JRE/JDK.) A few tips:



Cathy Riemer, December 2005