org.strbio.util.ui
Class ProteinTools

java.lang.Object
  extended by org.strbio.util.ui.ProteinTools

public class ProteinTools
extends java.lang.Object

This contains a set of static routines for drawing information about Proteins into Graphics objects.

  Version 1.0, 7/9/99 - original version, modified from Pred2ary 1.31
  

Version:
1.0, 7/9/99
Author:
JMC

Constructor Summary
ProteinTools()
           
 
Method Summary
static void draw2aryStructure(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, int fontLeading, Protein pr, int startRes, int n)
          This draws a line of letters showing the actual 2ary structure of a protein, from residue startRes (expressed in the protein's internal numbering scheme; 0 = first residue, etc).
static void drawAxes(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int n)
          This draws a set of axes for a graph.
static void drawGraph(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, double[] data, int start, int n)
          This graphs a set of generic data in the 0-1 range.
static void drawMajorNumberTick(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, boolean above)
          Draw a major tick for sequence number above or below a given positon.
static void drawMinorNumberTick(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, boolean above)
          Draw a minor number tick for sequence number above or below a given positon.
static void drawNumber(java.awt.Graphics g, int n, int drawX, int drawY, int fontWidth)
          Draw sequence number at a given position.
static void drawNumberLine(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, int startRes, int n, boolean above, boolean[] skipPos)
          Draw a line of numbers labeling residue positions in a protein.
static void drawPred2aryGraph(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, Protein pr, int startRes, int n)
          This draws a graph of the secondary structure probabilities.
static void drawPred2aryStructure(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, int fontLeading, Protein pr, int startRes, int n)
          This draws a line of letters showing the actual 2ary structure of a protein, from residue startRes to startRes+n (expressed in the protein's internal numbering scheme; 0 = first residue, etc).
static void drawTextGraph(java.awt.Graphics g, int drawX, int drawY, int fontWidth, int fontHeight, int fontLeading, char[] ch, double[] data, int start, int n)
          This draws a line of text, and colors the text according to a set of data in the 0-1 range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProteinTools

public ProteinTools()
Method Detail

drawNumber

public static void drawNumber(java.awt.Graphics g,
                              int n,
                              int drawX,
                              int drawY,
                              int fontWidth)
Draw sequence number at a given position. (centered around x position, above a given Y position)


drawMajorNumberTick

public static void drawMajorNumberTick(java.awt.Graphics g,
                                       int drawX,
                                       int drawY,
                                       int fontWidth,
                                       int fontHeight,
                                       boolean above)
Draw a major tick for sequence number above or below a given positon. The positioning is the same as for drawNumber.


drawMinorNumberTick

public static void drawMinorNumberTick(java.awt.Graphics g,
                                       int drawX,
                                       int drawY,
                                       int fontWidth,
                                       int fontHeight,
                                       boolean above)
Draw a minor number tick for sequence number above or below a given positon. The positioning is the same as for drawNumber.


drawNumberLine

public static void drawNumberLine(java.awt.Graphics g,
                                  int drawX,
                                  int drawY,
                                  int fontWidth,
                                  int fontHeight,
                                  int startRes,
                                  int n,
                                  boolean above,
                                  boolean[] skipPos)
Draw a line of numbers labeling residue positions in a protein. Numbers for startRes and startRes + n are drawn, along with every number divisibile by 10. If 2 numbers would be drawn too close together, the rightmost one is not drawn. A major tic is also drawn, even if the number is skipped. Minor tics are placed at every residue divisible by 5. startRes should be the actual number to draw, not relative to the beginning of the protein. The 'above' flag indicates to place the tics above, rather than below the numbers. The skipPos indicates positions which should be skipped in the numbering (null indicates to count all positions).


draw2aryStructure

public static void draw2aryStructure(java.awt.Graphics g,
                                     int drawX,
                                     int drawY,
                                     int fontWidth,
                                     int fontHeight,
                                     int fontLeading,
                                     Protein pr,
                                     int startRes,
                                     int n)
This draws a line of letters showing the actual 2ary structure of a protein, from residue startRes (expressed in the protein's internal numbering scheme; 0 = first residue, etc). Secondary structure is colored according to: H = red, E = green, coil = blue. Gaps are uncolored and marked with a . n is how many residues to draw.


drawPred2aryStructure

public static void drawPred2aryStructure(java.awt.Graphics g,
                                         int drawX,
                                         int drawY,
                                         int fontWidth,
                                         int fontHeight,
                                         int fontLeading,
                                         Protein pr,
                                         int startRes,
                                         int n)
This draws a line of letters showing the actual 2ary structure of a protein, from residue startRes to startRes+n (expressed in the protein's internal numbering scheme; 0 = first residue, etc). Secondary structure is colored according to: H = red, E = green, coil = blue, shaded according to a sliding scale. Gaps are uncolored and marked with a .


drawAxes

public static void drawAxes(java.awt.Graphics g,
                            int drawX,
                            int drawY,
                            int fontWidth,
                            int n)
This draws a set of axes for a graph.


drawPred2aryGraph

public static void drawPred2aryGraph(java.awt.Graphics g,
                                     int drawX,
                                     int drawY,
                                     int fontWidth,
                                     int fontHeight,
                                     Protein pr,
                                     int startRes,
                                     int n)
This draws a graph of the secondary structure probabilities.


drawGraph

public static void drawGraph(java.awt.Graphics g,
                             int drawX,
                             int drawY,
                             int fontWidth,
                             int fontHeight,
                             double[] data,
                             int start,
                             int n)
This graphs a set of generic data in the 0-1 range.


drawTextGraph

public static void drawTextGraph(java.awt.Graphics g,
                                 int drawX,
                                 int drawY,
                                 int fontWidth,
                                 int fontHeight,
                                 int fontLeading,
                                 char[] ch,
                                 double[] data,
                                 int start,
                                 int n)
This draws a line of text, and colors the text according to a set of data in the 0-1 range.