NeoBio API

neobio.alignment
Class OutMatrix

java.lang.Object
  |
  +--neobio.alignment.OutMatrix
All Implemented Interfaces:
Matrix

public class OutMatrix
extends java.lang.Object
implements Matrix

Implements an interface to the OUT matrix of a block. This class is used by the CrochemoreLandauZivUkelson and subclasses to enconde the OUT matrix from the input border and DIST matrix of an AlignmentBlock.

The OUT matrix defined as OUT[i,j] = I[i] + DIST[i,j] where I is the input border array and DIST is the DIST matrix.

The output border of a block is computed from the OUT matrix by taking the maximum value of each column. Note that this class does not compute the OUT matrix, it just stores the necessary information to retrieve a value at any position of the matrix.

It implements the Matrix interface so that the SMAWK algorithm can be used to compute its column maxima.

For more information on how this class is used, please refer to the specification of the CrochemoreLandauZivUkelson and its subclasses.

Author:
Sergio A. de Carvalho Jr.
See Also:
CrochemoreLandauZivUkelson, CrochemoreLandauZivUkelsonGlobalAlignment, CrochemoreLandauZivUkelsonLocalAlignment, AlignmentBlock, Smawk

Field Summary
protected  int dim
          The dimension of the OUT matrix.
protected  int[][] dist
          The DIST matrix of a block.
protected  int[] input_border
          The input border of a block.
protected  int lc
          The number of columns of the block.
protected  int max_length
          The length of the longest sequence (number of characters) being aligned.
protected  int max_score
          The maximum absolute score that the current scoring scheme can return.
 
Constructor Summary
OutMatrix()
           
 
Method Summary
 void init(int max_length, int max_score)
          Initialised this OUT matrix interface.
 int numColumns()
          Returns the number of columns of this OUT matrix.
 int numRows()
          Returns the number of rows of this OUT matrix.
 void setData(int[][] dist, int[] input_border, int dim, int lc)
          Sets this interface's data to represent an OUT matrix for a block.
 int valueAt(int row, int col)
          Returns the value at a given position of the matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

max_length

protected int max_length
The length of the longest sequence (number of characters) being aligned. It needs to be set only once per alignment.


max_score

protected int max_score
The maximum absolute score that the current scoring scheme can return. It needs to be set only once per alignment.


dist

protected int[][] dist
The DIST matrix of a block.


input_border

protected int[] input_border
The input border of a block.


dim

protected int dim
The dimension of the OUT matrix.


lc

protected int lc
The number of columns of the block.

Constructor Detail

OutMatrix

public OutMatrix()
Method Detail

init

public void init(int max_length,
                 int max_score)
Initialised this OUT matrix interface. This method needs to be executed only once per alignment.

Parameters:
max_length - the length of the longest sequence (number of characters) being aligned
max_score - the maximum absolute score that the current scoring scheme can return

setData

public void setData(int[][] dist,
                    int[] input_border,
                    int dim,
                    int lc)
Sets this interface's data to represent an OUT matrix for a block. This method is typically executed once for each block being aligned.

Parameters:
dist - the DIST matrix
input_border - the input border
dim - the dimension of the OUT matrix
lc - the number of columns of the block

valueAt

public int valueAt(int row,
                   int col)
Returns the value at a given position of the matrix. In general it returns the value of DIST[col][row] + input_border[row]. However, special cases occur for its upper right and lower left triangular parts.

Specified by:
valueAt in interface Matrix
Parameters:
row - row index
col - column index
Returns:
the value at row row, column col of this OUT matrix

numRows

public int numRows()
Returns the number of rows of this OUT matrix.

Specified by:
numRows in interface Matrix
Returns:
the number of rows of this OUT matrix

numColumns

public int numColumns()
Returns the number of columns of this OUT matrix.

Specified by:
numColumns in interface Matrix
Returns:
the number of columns of this OUT matrix

SourceForge.net

http://neobio.sourceforge.net
NeoBio is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. NeoBio is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NeoBio; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.