Class webmol

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----webmol

public class webmol
extends Frame
WebMol - Java PDB structure viewing and analysis program
Author: Dirk Walther (walther@cmpharm.ucsf.edu)
Version March 10, 1998

European Molecular Biology Laboratory (EMBL) June 1996-March 1997 University of California, San Francisco (UCSF) April 1997-

Reference: Walther D. (1997) WebMol - a Java based PDB viewer. Trends Biochem Sci, 22: 274-275

WWW: http://www.cmpharm.ucsf.edu/cgi-bin/webmol.pl or http://www.embl-heidelberg.de/cgi/viewer.pl


Example ("webmolExample.java")


import webmol;

public class webmolExample
{
  
public static void main(String args[])
  {
    int num,add=1,col;
    

    webmol wm=new webmol("pdb1ppt.ent",700,600);
    // webmol wm=new webmol("http://www.embl-heidelberg.de/~walther/JAVA/pdb/1ppt.brk",700,600);
    // reads it across the web
    // webmol wm=new webmol("ftp://pdb.pdb.bnl.gov//fullrelease/uncompressed_files/pp/pdb1ppt.ent",700,600);
    // reads it from PDB directly


    num=wm.getNumberOfResidues(); 

    int res=0;
    
    for(int j=0;j<2*num;j++)
    {

           
      if(wm.getResidueType(res)=='P') // if amino acid = proline then color yellow
        col=wm.yellow;
      else
        col=wm.current; // current color set by WebMol
      
      wm.select(res,
                wm.SIDECHAIN_VS_SIDECHAIN,
                col,
                wm.THICK);
      
      wm.redraw(500);
      
      if(res==num-1) add=-1;
      if(res==0) add=1;

      wm.unselect(res);
      res+=add;
    }
    wm.close(true);
    
  
    
  }
}

Variable Index

 o blue
Color to apply for selection highlighting
 o current
Color to apply for selection highlighting
 o cyan
Color to apply for selection highlighting
 o gray
Color to apply for selection highlighting
 o lilac
Color to apply for selection highlighting
 o orange
Color to apply for selection highlighting
 o pink
Color to apply for selection highlighting
 o red
Color to apply for selection highlighting
 o yellow
Color to apply for selection highlighting
 o SELECTED_ONLY
Select method
 o SIDECHAIN_VS_BACKBONE
Select method
 o SIDECHAIN_VS_SIDECHAIN
Select method
 o THICK
thick lines
 o THIN
thin lines

Constructor Index

 o webmol(String)
launching WebMol with default width and height, upon closing the WebMol frame all Java programs will be exited.
 o webmol(String, boolean)
 o webmol(String, boolean, int, int)
 o webmol(String, int, int)

Method Index

 o close()
close WebMol
 o close(boolean)
close Webmol and exit (exit=true)/ not exit (exit=false) all current Java programs under which WebMol was running
 o getChainID(int)
returns the chain identifier of residue res
 o getNumberOfResidues()
returns the number of amino acid residues in the current protein structure
 o getPDBSeqNum(int)
returns the PDB sequence number of residue res as it may differ from the consecutive enumeration used by WebMol
 o getResidueType(int)
returns the amino acid type (one-letter code) of residue res
 o redraw()
redraw the structure in the WebMol main window
 o redraw(int)
redraw the structure in the WebMol main window
 o select(int, int, int, int)
select a single residue, enumeration of residues is in consecutive order; i.e.
 o unselect(int)
unselect residue
 o unselectAll()
undo all selections

Variables

 o THICK
 public static final int THICK
thick lines

 o THIN
 public static final int THIN
thin lines

 o current
 public static final int current
Color to apply for selection highlighting

 o red
 public static final int red
Color to apply for selection highlighting

 o blue
 public static final int blue
Color to apply for selection highlighting

 o yellow
 public static final int yellow
Color to apply for selection highlighting

 o lilac
 public static final int lilac
Color to apply for selection highlighting

 o gray
 public static final int gray
Color to apply for selection highlighting

 o pink
 public static final int pink
Color to apply for selection highlighting

 o cyan
 public static final int cyan
Color to apply for selection highlighting

 o orange
 public static final int orange
Color to apply for selection highlighting

 o SELECTED_ONLY
 public static final int SELECTED_ONLY
Select method

 o SIDECHAIN_VS_BACKBONE
 public static final int SIDECHAIN_VS_BACKBONE
Select method

 o SIDECHAIN_VS_SIDECHAIN
 public static final int SIDECHAIN_VS_SIDECHAIN
Select method

Constructors

 o webmol
 public webmol(String Protein,
               boolean invoked,
               int width,
               int height)
Parameters:
Protein - PDB-file
invoked - determines how to respond to closures of the WebMol Frame; true: close WebMol only, false: close WebMol and all Java programs under which WebMol was running
width - frame width
height - frame height
 o webmol
 public webmol(String Protein,
               int width,
               int height)
Parameters:
Protein - PDB-file
width - width of the WebMol frame
height - height of the WebMol frame
 o webmol
 public webmol(String Protein)
launching WebMol with default width and height, upon closing the WebMol frame all Java programs will be exited.

Parameters:
Protein - PDB-file
 o webmol
 public webmol(String Protein,
               boolean invoked)
Parameters:
Protein - PDB-file
invoked - set true to exit WebMol without closing the program that invoked WebMol

Methods

 o close
 public void close()
close WebMol

 o close
 public void close(boolean exit)
close Webmol and exit (exit=true)/ not exit (exit=false) all current Java programs under which WebMol was running

Parameters:
exit - true for exit all programs, false for just leaving WebMol
 o select
 public void select(int res,
                    int selectMethod,
                    int color,
                    int thick)
select a single residue, enumeration of residues is in consecutive order; i.e. from 0 to num-1, irrespective of pdb enumerations

Parameters:
res - residue number (consecutive order
selectMethod - method of highlighting selected residues, values can be SELECTED_ONLY (display selected residues only), SIDECHAIN_VS_BACKBONE (display sidechains of selected residues against the protein backbone), SIDECHAIN_VS_SIDECHAIN (keep displaying all residues against highlighted selected residues)
color - color to be used for highlighting selected residue (see Fields)
thick - line thickness (THICK or THIN)
 o unselect
 public void unselect(int res)
unselect residue

Parameters:
res - residue number
 o unselectAll
 public void unselectAll()
undo all selections

 o getNumberOfResidues
 public int getNumberOfResidues()
returns the number of amino acid residues in the current protein structure

 o getPDBSeqNum
 public int getPDBSeqNum(int res)
returns the PDB sequence number of residue res as it may differ from the consecutive enumeration used by WebMol

Parameters:
res - residue (consecutive order)
 o getResidueType
 public char getResidueType(int res)
returns the amino acid type (one-letter code) of residue res

Parameters:
res - residue (consecutive order)
 o getChainID
 public char getChainID(int res)
returns the chain identifier of residue res

Parameters:
res - residue (consecutive order)
 o redraw
 public void redraw(int delay)
redraw the structure in the WebMol main window

Parameters:
delay - redraw after milliseconds
 o redraw
 public void redraw()
redraw the structure in the WebMol main window