de.jstacs.algorithms.alignment.cost
Class SimpleCosts

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

public class SimpleCosts
extends AffineCosts

Class for simple costs with costs mismatch for a mismatch, costs start to start a new gap, costs elong to elongate a gap by one position and costs of match for a match.


Nested Class Summary
 
Nested classes/interfaces inherited from interface de.jstacs.algorithms.alignment.cost.Costs
Costs.Direction
 
Constructor Summary
SimpleCosts(double match, double mismatch, double start, double elong)
          Creates a new instance of simple costs with costs mismatch for a mismatch, costs start to start a new gap, costs elong to elongate a gap by one position and costs of match for a match.
 
Method Summary
 double getCostFor(Sequence s1, Sequence s2, int i, int j, Costs.Direction from)
          Returns the costs for the alignment if s1(i) and s2(j) coming from from.
 
Methods inherited from class de.jstacs.algorithms.alignment.cost.AffineCosts
getElongateCosts, getGapCostsFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCosts

public SimpleCosts(double match,
                   double mismatch,
                   double start,
                   double elong)
Creates a new instance of simple costs with costs mismatch for a mismatch, costs start to start a new gap, costs elong to elongate a gap by one position and costs of match for a match.

Parameters:
match - the match costs
mismatch - the mismatch costs
start - the costs to start a gap
elong - the costs to elongate a gap
Method Detail

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 sequence
s2 - the second sequence
i - the index in the first sequence
j - the index in the second sequence
from - the direction within the DP-matrix
Returns:
the costs