org.emboss.jemboss.editor
Class Matrix

java.lang.Object
  extended byorg.emboss.jemboss.editor.Matrix

public class Matrix
extends java.lang.Object

Reads and hold a sequence scoring matrix


Field Summary
private  java.lang.String cons
           
private  int i
           
private  int idimension
           
private  int jdimension
           
private  int k
           
private  java.lang.Object[] keys
           
private  int[][] matrix
           
private  java.lang.String matrixFileName
           
private  java.lang.String matrixString
           
private  java.util.Hashtable residueMatrixPosition
          hashtable of the residue positions in the table
 
Constructor Summary
Matrix(java.io.File matrixFile)
           
Matrix(java.lang.String matrixJar, java.lang.String matrixFileName)
           
 
Method Summary
 java.lang.String getCurrentMatrixName()
          Get the current scoring matrix name
 int getIDimension()
          Get number of rows in the scoring table
 int getJDimension()
          Get number of columns in the scoring table
 java.lang.Object[] getKeyNames()
          Scoring matrix names available
 java.lang.String getKeyNamesString()
          Scoring matrix names available
 java.lang.Object[] getKeys()
          Scoring matrix filenames in jar file
 int[][] getMatrix()
          Get the scoring matrix as a 2 dimensional integer array
 int getMatrixIndex(java.lang.String s)
          Get the residue position in the scoring table
 java.lang.String getMatrixTable()
          Get the scoring matrix as text
private  org.apache.regexp.RE getRegularExpression()
          Get regular expression for values in the scoring table
 java.util.Hashtable getResidueMatrixPosition()
          Get the hashtable of the residue positions in the scoring table
private  void matrixLineCount(java.lang.String line, org.apache.regexp.RE regexp)
          Count as a matrix row and number of columns
private  void matrixLineParse(java.lang.String line, org.apache.regexp.RE regexp)
          Parse a line from a scoring matrix file.
private  int[][] matrixRead(java.io.File matrixFile)
          Read and parse a scoring matrix file
private  int[][] matrixReadString(java.lang.String matrixString)
          Read and parse a scoring matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

private int[][] matrix

idimension

private int idimension

jdimension

private int jdimension

i

private int i

k

private int k

residueMatrixPosition

private java.util.Hashtable residueMatrixPosition
hashtable of the residue positions in the table


keys

private java.lang.Object[] keys

cons

private java.lang.String cons

matrixString

private java.lang.String matrixString

matrixFileName

private java.lang.String matrixFileName
Constructor Detail

Matrix

public Matrix(java.io.File matrixFile)
Parameters:
matrixFile - matrix file

Matrix

public Matrix(java.lang.String matrixJar,
              java.lang.String matrixFileName)
Parameters:
matrixJar - jar file containing scoring matrix
matrixFileName - matrix file
Method Detail

getMatrix

public int[][] getMatrix()
Get the scoring matrix as a 2 dimensional integer array

Returns:
2 dimentional scoring matrix

getMatrixTable

public java.lang.String getMatrixTable()
Get the scoring matrix as text

Returns:
scoring matrix

getCurrentMatrixName

public java.lang.String getCurrentMatrixName()
Get the current scoring matrix name

Returns:
name of matrix

getKeys

public java.lang.Object[] getKeys()
Scoring matrix filenames in jar file


getKeyNames

public java.lang.Object[] getKeyNames()
Scoring matrix names available


getKeyNamesString

public java.lang.String getKeyNamesString()
Scoring matrix names available


getResidueMatrixPosition

public java.util.Hashtable getResidueMatrixPosition()
Get the hashtable of the residue positions in the scoring table

Returns:
hashtable of the residue positions

getMatrixIndex

public int getMatrixIndex(java.lang.String s)
Get the residue position in the scoring table

Parameters:
s - residue
Returns:
position in scoring table

getIDimension

public int getIDimension()
Get number of rows in the scoring table

Returns:
number of rows in the scoring table

getJDimension

public int getJDimension()
Get number of columns in the scoring table

Returns:
number of columns in the scoring table

getRegularExpression

private org.apache.regexp.RE getRegularExpression()
Get regular expression for values in the scoring table

Returns:
RE

matrixLineCount

private void matrixLineCount(java.lang.String line,
                             org.apache.regexp.RE regexp)
Count as a matrix row and number of columns

Parameters:
line - line from matrix file
regexp - regular expression for columns

matrixLineParse

private void matrixLineParse(java.lang.String line,
                             org.apache.regexp.RE regexp)
Parse a line from a scoring matrix file. Add to the matrix array the values in the table.

Parameters:
line - line from matrix file
regexp - regular expression for values

matrixRead

private int[][] matrixRead(java.io.File matrixFile)
Read and parse a scoring matrix file

Parameters:
matrixFile - matrix file
Returns:
matrix 2-d integer array

matrixReadString

private int[][] matrixReadString(java.lang.String matrixString)
Read and parse a scoring matrix

Parameters:
matrixString - matrix as text
Returns:
matrix 2-d integer array