de.jstacs.algorithms.alignment.cost
Class AffineCosts

java.lang.Object
  extended by de.jstacs.algorithms.alignment.cost.AffineCosts
All Implemented Interfaces:
Costs

public class AffineCosts
extends Object
implements Costs

This class implements affine gap costs, i.e., the costs for starting a new gap are given by start, and the costs for elongating a gap by one position are given by elong.

Author:
Jan Grau, Jens Keilwagen

Constructor Summary
AffineCosts(double start, Costs c)
          This constructor creates a new instance of cost using affine gap costs.
 
Method Summary
 double getCostFor(Sequence s1, Sequence s2, int i, int j)
          Returns the costs for the alignment of s1(i) and s2(j).
 double getElongateCosts()
          Returns the costs to elongate a gap by one position.
 double getGapCosts()
          Returns the costs for a gap.
 double getGapCostsFor(int length)
          Returns the costs for a gap of length length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AffineCosts

public AffineCosts(double start,
                   Costs c)
This constructor creates a new instance of cost using affine gap costs. The costs for match, mismatch and gap elongation are defined by c, while the costs for a start of a gap are given by start.

Parameters:
start - the costs for starting a gap
c - the cost for match, mismatch and gap elongation
Method Detail

getElongateCosts

public double getElongateCosts()
Returns the costs to elongate a gap by one position.

Returns:
the corresponding costs

getGapCostsFor

public double getGapCostsFor(int length)
Returns the costs for a gap of length length.

Parameters:
length - the length of the gap
Returns:
the corresponding costs

getCostFor

public double getCostFor(Sequence s1,
                         Sequence s2,
                         int i,
                         int j)
Description copied from interface: Costs
Returns the costs for the alignment of s1(i) and s2(j).

Specified by:
getCostFor in interface Costs
Parameters:
s1 - the first sequence
s2 - the second sequence
i - the index in the first sequence
j - the index in the second sequence
Returns:
the costs
See Also:
Sequence.discreteVal(int)

getGapCosts

public double getGapCosts()
Description copied from interface: Costs
Returns the costs for a gap.

Specified by:
getGapCosts in interface Costs
Returns:
the costs for a gap