R
- the result class of this alignment algorithm.public abstract class AbstractAffineAlignmentAlgorithm<R> extends Object implements SkipAlignmentAlgorithm<R>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractAffineAlignmentAlgorithm.Recurrence |
Constructor and Description |
---|
AbstractAffineAlignmentAlgorithm(Class<R> resultClass,
AlignmentSpecification alignmentSpecification) |
Modifier and Type | Method and Description |
---|---|
R |
calculateAlignment(Sequence a,
Sequence b)
This calculates the alignment between the Sequences a and b and returns
it as an instance of the result class for this algorithm.
|
abstract double |
choice(double... choices)
This should implement the choice function as the term is used
in the Bellman's Gap context.
|
int |
getMinMiddleSkips()
The minimum number of skips that have to be done in the middle
of an alignment.
|
Class<R> |
getResultClass()
This method shall return the class of the alignment result.
|
AlignmentSpecification |
getSpecification()
This should return the specification that is used for this Algorithm.
|
double |
getWeightThreshold() |
void |
setMinMiddleSkips(int minMiddleSkips)
The minimum number of skips that have to be done in the middle
of an alignment.
|
void |
setWeightThreshold(double weightThreshold)
Set a weight threshold (between 0 and 1) that determines which keywords
should be ignored during calculation because their weight is negligible.
|
abstract R |
transformToResult(EnumMap<AbstractAffineAlignmentAlgorithm.Recurrence,double[][]> dp_tables,
double[][] compareMatrix,
double[] deletionMatrix,
double[] insertionMatrix,
double[] skipDeletionMatrix,
double[] skipInsertionMatrix,
Sequence a,
Sequence b)
This method should not be called from outside!
The subclass uses this method to transform the alignment matrix and the
input sequences to the actual alignment result.
|
public AbstractAffineAlignmentAlgorithm(Class<R> resultClass, AlignmentSpecification alignmentSpecification)
public AlignmentSpecification getSpecification()
getSpecification
in interface AlignmentAlgorithm<R>
public Class<R> getResultClass()
getResultClass
in interface AlignmentAlgorithm<R>
public void setWeightThreshold(double weightThreshold)
weightThreshold
- a weight threshold (between 0 and 1)public double getWeightThreshold()
public void setMinMiddleSkips(int minMiddleSkips)
minMiddleSkips
- the minimum number of skips that have to be done in
the middle of an alignment.public int getMinMiddleSkips()
public R calculateAlignment(Sequence a, Sequence b)
calculateAlignment
in interface AlignmentAlgorithm<R>
a
- The first sequence.b
- The second sequence.public abstract double choice(double... choices)
choices
- the costs of all choices.public abstract R transformToResult(EnumMap<AbstractAffineAlignmentAlgorithm.Recurrence,double[][]> dp_tables, double[][] compareMatrix, double[] deletionMatrix, double[] insertionMatrix, double[] skipDeletionMatrix, double[] skipInsertionMatrix, Sequence a, Sequence b)
dp_tables
- the dynamic programming matrices used during
calculation.compareMatrix
- the local cost for replacing node i from the first
sequence with node j from the second sequence.deletionMatrix
- the local cost for deleting node i from the first
sequence.insertionMatrix
- the local cost for inserting node j from the
second sequence into the first sequence.skipDeletionMatrix
- the local cost for skipping node i in the
first sequence.skipInsertionMatrix
- the local cost for skipping node j in the
second sequence.a
- the first sequence.b
- th second sequence.Copyright (C) 2013-2015 Benjamin Paaßen, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs