Using Jalview in applets (with examples)

 

    Basic html parameters

    Advanced html parameters (groups/colours/SRS/sequences)

     


Basic html parameters

 
 

The applet above reads in a protein alignment in msf format and displays it in a Jalview frame.
A consensus calculation is done over all the sequences and the alignment is coloured according to each residue's agreement with the consensus.

The html to do this is:

<APPLET archive="http://www.jalview.org/jars/jalview_1.8.jar"
     code="jalview.ButtonAlignApplet"
     width = 1000
     height = 35>
  <param name=input value="http://www.jalview.org/data/lipase.msf">
  <param name=type value="URL">
  <param name=format value="MSF">
</APPLET>
 

Description of the html parameters

The <APPLET> tag

<APPLET archive="http://www.jalview.org/jars/jalview_1.8.jar"
        code="jalview.ButtonAlignApplet"
        width = 150
        height = 40>
This line defines where the code for the applet lies (www.jalview.org) and what java class is to be called
(jalview.ButtonAlignApplet).

The width and height parameters define how many pixels the applet should take up in the browser.  In this case they  should be enough to display a button.

Specifying an alignment file and format

 <param name=input value="http://www.jalview.org/data/test.msf">
 <param name=type value="URL">
 <param name=format value="MSF">
These parameters describe where to find the alignment and what format it is in.

    input - The URL of the alignment to be viewed
    type   -  Whether the alignment is a file or a URL.  Use URL here as File is not allowed for security reasons.
    format - the format of the alignment.  Allowable values are MSF, CLUSTAL, FASTA and PIR.
 
 

Advanced html parameters

The applet above reads in a protein alignment in fasta format that also contains some secondary structure predictions and definitions. The alignment is split into two groups which are displayed differently.

The protein alignment has the residue text displayed and is coloured according to each residues agreement with the consensus sequence. The secondary structure predictions/definitions have no text displayed but are coloured according to the structural element (helix/sheet).

The consensus calculation is done over a subset of the sequences in the alignment (the protein sequences). This is also specified in the html. The html to do this is :
 

<APPLET archive="http://www.jalview.org/jars/jalview.jar"
        code="jalview.ButtonAlignApplet" width = 100 height = 35>
<PARAM name=input value="http://www.jalview.org/data/test2.fa">
<PARAM name=type value="URL"><PARAM name=format value="FASTA">
<PARAM name="groups" value="2"><PARAM name="group1" value="1-36:PID:true:true:false">
<PARAM name="group2" value="37-45:SECONDARY:false:true:true">
<PARAM name=fontsize value="10">
<PARAM name="mailServer" value = "www.ebi.ac.uk">
<PARAM name="Consensus" value="1-36">
<PARAM name="srsServer" value = "srs.ebi.ac.uk/srs7bin/cgi-bin/">
<PARAM name="database" value = "swall">
</APPLET>
 

Defining groups

<param name="groups" value="2">
<param name="group1" value="1-36:PID:true:true:false">
<param name="group2" value="37-45:SECONDARY:true:false:false">
 
    groups -  the number of groups defined
    groupn  - the group definition for group n.  If there are N groups defined with the groups parameter then there must be
N groupn parameter lines.<br>
    The value string for the groupn parameter is split into 5 fields separated by colons.  The fields are:

        <sequences in group> : <colour scheme> : <display boxes> : <display text> :  <colour text>
 
 

Allocating sequences to a group

The first field defines which sequences are to be in this group.   A few examples are the most informative here I think.

       20-26                    Sequences 20,21,22,23,2425,26 are in the group
       1,2,4                       Sequences 1,2 and 4 are in the group
       10-15,2,6-7         Sequences 2,6,7,10,11,12,13,14,15 are in the group
 
 

Defining a group colour scheme

This colour scheme will apply to the residue boxes or the residue text depending on whether those parameters are set

Allowed values are

    ZAPPO                  - colour residues by physio-chemical properties
    PID                          - colour residues by percentage identity agreement with consensus sequence
    BLOSUM62          - colour residues by agreement with consensus or +ve BLOSUM62 score with consensus residue
    HYDROPHOBIC  - colour residues by hydrophobicity (red - hydrophobic, blue - hydrophilic).
    SECONDARY      -  colour residues by secondary structure (H - magenta, E - yellow).
 
 

Displaying residue boxes

The third parameter can be true or false according to whether you want residue boxes displayed or not

Displaying text

The 4th parameter can be true or false according to whether you want the residue text displayed or not.

Colouring text

The 5th parameter can be true or false according to whether you want the residue text coloured.  Displaying the residue
boxes and colouring the text will give the impression of no text displayed at all but will slow the display down
considerably.
 

Defining sequences to be included in the consensus

Defining the sequences for the consensus calculation is done in much the same way as for the colour grouping.
 
<PARAM name="Consensus" value="1,4,6-10">
You can also select all the sequences by

<PARAM name="Consensus" value = "*">

 
Defining the SRS server

This is done using the srsServer parameter as follows

<PARAM name="srsServer" value="www.sanger.ac.uk/srs6bin/cgi-bin/">
n.b. the value does NOT have http:// at the front and is otherwise the URL of the SRS program wgetz

(If you are using Netscape you MUST have this server the same as both your mail server and the applet server)
 

Defining the SRS database

Use the database parameter to change your srs database (default is swall).

<PARAM name="database" value="pfamseq">

  

Defining sequences in html

If you want to you can submit an alignment in the html as follows
 
<PARAM name="numseqs" value=3>
<PARAM name="seq1" value="ALSDKFHLKRHELKHASLDKHLKHR">
<PARAM name="seq2" value="ALSDKFHLKRHE-----LDKHLKHR">
<PARAM name="seq3" value="ALSDKFHLKRHELKHALKFL-HLKHR">
Optionally you can supply parameters that define the ids for each of the sequences as follows:
<PARAM name="id1" value="LCAT_HUMAN">
<PARAM name="id2" value="LCAT_YEAST">
<PARAM name="id3" value="LCAT_MOUSE">
If you don't supply ids then the defaults will be Seq_1 Seq_2 etc.