R
- the result class of this alignment algorithm.public abstract class AbstractLocalAlignmentAlgorithm<R> extends Object implements LocalAlignmentAlgorithm<R>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractLocalAlignmentAlgorithm.Recurrence |
Constructor and Description |
---|
AbstractLocalAlignmentAlgorithm(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.
|
static double[] |
calculateSkipDeletionCosts(Node a,
AlignmentSpecification specification)
This calculates the non-weighted costs for skip-deleting the single
values in node a.
|
static double[] |
calculateSkipInsertionCosts(Node b,
AlignmentSpecification specification)
This calculates the non-weighted costs for skip-inserting the single
values of node b.
|
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<AbstractLocalAlignmentAlgorithm.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!
|
public AbstractLocalAlignmentAlgorithm(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
- 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<AbstractLocalAlignmentAlgorithm.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.public static double[] calculateSkipDeletionCosts(Node a, AlignmentSpecification specification)
a
- The node from the left sequence.specification
- The AlignmentSpecification that shall be used (and
is compatible with the nodes content).public static double[] calculateSkipInsertionCosts(Node b, AlignmentSpecification specification)
b
- The node from the right sequence.specification
- The AlignmentSpecification that shall be used (and
is compatible with the nodes content).Copyright (C) 2013, 2014 Benjamin Paaßen, Charlie Krüger, 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