Using Jalview in applets (with examples)

 

    Basic html parameters

    Advanced html parameters (groups/colours)

     


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 codebase="http://circinus.ebi.ac.uk:6543/jalview/"
     code="jalview.ButtonAlignApplet"
     width = 1000
     height = 35>
  <param name=input value="http://circinus.ebi.ac.uk:6543/jalview/lipase.msf">
  <param name=type value="URL">
  <param name=format value="MSF">
</APPLET>
 

Description of the html parameters

The <APPLET> tag

<APPLET codebase="http://www.ebi.ac.uk/~michele/jalview/"
        code="jalview.ButtonAlignApplet"
        width = 150
        height = 40>
This line defines where the code for the applet lies (www.ebi.ac.uk) 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.

This CODEBASE method loads classes as and when it needs them so is probably suited for slow net connections.  An
alternative is to load all the classes at once in a jar file (~100kb).  This makes the applet slow to start but subsequent
operations faster.
 
 

To use a jar file:
 

<APPLET ARCHIVE="http://www.ebi.ac.uk/~michele/jalview/jalview.jar"
        CODE="jalview.ButtonAlignApplet"
        WIDTH= 250
        HEIGHT = 40>
 

Specifying an alignment file and format

 <param name=input value="http://www.ebi.ac.uk/jalview/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://circinus.ebi.ac.uk:6543/jalview/jalview.jar"
        code="jalview.ButtonAlignApplet" width = 100 height = 35>
<PARAM name=input value="http://circinus.ebi.ac.uk:6543/jalview/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 = "circinus.ebi.ac.uk">
<PARAM name="Consensus" value="1-36">
</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 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.