public class AffineCosts extends Object implements Costs
start
, and
the costs for elongating a gap by one position are given by elong
.
In this implementation, we may differentiate between the costs of opening an insert gap, i.e., a gap in the first string,
and a delete gap, i.e., a gap in the second string.Constructor and Description |
---|
AffineCosts(double start,
Costs c)
This constructor creates a new instance of cost using affine gap costs.
|
AffineCosts(double startInsert,
double startDelete,
Costs c)
This constructor creates a new instance of cost using affine gap costs.
|
AffineCosts(StringBuffer xml)
Restores
AffineCosts object from its XML representation. |
Modifier and Type | Method and Description |
---|---|
double |
getCostFor(Sequence s1,
Sequence s2,
int i,
int j)
Returns the costs for the alignment of
s1(i) and
s2(j) . |
double |
getDeleteCosts()
Returns the costs for a delete gap, i.e., a gap in the second string.
|
double |
getDeleteCostsFor(int length)
Returns the costs for a delete gap of length
length . |
double |
getElongateDeleteCosts()
Returns the costs for elongating a delete gap by one position.
|
double |
getElongateInsertCosts()
Returns the costs for elongating an insert gap by one position.
|
double |
getGapCostsFor(int length)
Returns the costs for a gap of length
length . |
double |
getInsertCosts()
Returns the costs for an insert gap, i.e., a gap in the first string.
|
double |
getInsertCostsFor(int length)
Returns the costs for an insert gap of length
length . |
Costs |
getInternalCosts()
Returns the internal costs (supplied as
c to AffineCosts(double, Costs) ) used for matches and mismatches. |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public AffineCosts(double start, Costs c)
c
,
while the costs for a start of a gap are given by start
.start
- the costs for starting a gapc
- the cost for match, mismatch and gap elongationpublic AffineCosts(double startInsert, double startDelete, Costs c)
c
,
while the costs for a start of a gap are given by startInsert
and startDelete
, respectively.startInsert
- the costs for starting an insert gapstartDelete
- the costs for starting a delete gapc
- the cost for match, mismatch and gap elongationpublic AffineCosts(StringBuffer xml) throws NonParsableException
AffineCosts
object from its XML representation.xml
- the XML representationNonParsableException
- if the XML could not be parsedpublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.public Costs getInternalCosts()
c
to AffineCosts(double, Costs)
) used for matches and mismatches.public double getElongateInsertCosts()
public double getElongateDeleteCosts()
public double getInsertCostsFor(int length)
length
.length
- the length of the gappublic double getDeleteCostsFor(int length)
length
.length
- the length of the gappublic double getGapCostsFor(int length)
length
.length
- the length of the gappublic double getCostFor(Sequence s1, Sequence s2, int i, int j)
Costs
s1(i)
and
s2(j)
.getCostFor
in interface Costs
s1
- the first sequences2
- the second sequencei
- the index in the first sequencej
- the index in the second sequenceSequence.discreteVal(int)
public double getInsertCosts()
Costs
getInsertCosts
in interface Costs
public double getDeleteCosts()
Costs
getDeleteCosts
in interface Costs