de.jstacs.algorithms.alignment.cost
Class MatrixCosts
java.lang.Object
de.jstacs.algorithms.alignment.cost.AffineCosts
de.jstacs.algorithms.alignment.cost.MatrixCosts
- All Implemented Interfaces:
- Costs
public class MatrixCosts
- extends AffineCosts
Class for matrix costs, i.e., the cost of any match/mismatch is stored in
a matrix allowing a huge degree of freedom. Additionally, the class used
affine gap costs. The costs start
to start a new gap, and
the costs elong
to elongate a gap by one position.
- Author:
- Jens Keilwagen
Nested classes/interfaces inherited from interface de.jstacs.algorithms.alignment.cost.Costs |
Costs.Direction |
Constructor Summary |
MatrixCosts(double[][] matrix,
double start,
double elong)
Creates a new instance of matrix costs where the costs
for mismatch and match are given in matrix . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MatrixCosts
public MatrixCosts(double[][] matrix,
double start,
double elong)
throws CloneNotSupportedException
- Creates a new instance of matrix costs where the costs
for mismatch and match are given in
matrix
.
Additionally, costs start
to start a new gap,
and costs elong
to elongate a gap by one
position.
- Parameters:
matrix
- the match and mismatch costsstart
- the costs to start a gapelong
- the costs to elongate a gap
- Throws:
CloneNotSupportedException
- if matrix
could not be cloned
getCostFor
public double getCostFor(Sequence s1,
Sequence s2,
int i,
int j,
Costs.Direction from)
- Description copied from interface:
Costs
- Returns the costs for the alignment if
s1(i)
and
s2(j)
coming from from
.
- Parameters:
s1
- the first sequences2
- the second sequencei
- the index in the first sequencej
- the index in the second sequencefrom
- the direction within the DP-matrix
- Returns:
- the costs