X
- The class for entries of the Dynamic Programming Matrix.R
- The result class.public abstract class AbstractGapAlignmentAlgorithm<X extends AlignmentMatrixEntry,R> extends Object implements GapAlignmentAlgorithm<R>
Constructor and Description |
---|
AbstractGapAlignmentAlgorithm(AlignmentSpecification alignmentSpecification,
Class<X> entryClass,
Class<R> resultClass) |
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 X |
createDelInitial(X delOld,
int i,
double delLocal)
This method should not be called from outside!
The subclass specifies the entry (i+1,0) of the alignment matrix with
this method given the entry (i,0).
|
static <X> X[] |
createGenericArray(int size,
Class<X> arrClass)
This circumvents Javas rule against generic array cration by using
reflection.
|
static <X> X[][] |
createGenericMatrix(int m,
int n,
Class<X> entryClass)
This circumvents Javas rule against generic array cration by using
reflection.
|
abstract X |
createInitial()
This method should not be called from outside!
The subclass specifies the entry (0,0) of the alignment matrix with this
method.
|
abstract X |
createInsInitial(X insOld,
int j,
double insLocal)
This method should not be called from outside!
The subclass specifies the entry (0,j+1) of the alignment matrix with
this method given the entry (0,j).
|
abstract X |
createNewEntry(X delOld,
X insOld,
X repOld,
int i,
int j,
double delLocal,
double insLocal,
double repLocal)
This method should not be called from outside!
The subclass specifies the entry (i+1,j+1) of the alignment matrix with
this method given the entries (i,j+1) (deletion), (i+1,j) (insertion) and
(i,j) (replacement).
|
Class<X> |
getEntryClass()
Returns the class of matrix entries.
|
X[][] |
getLastAlignmentMatrix()
The last matrix that was calculated using this algorithm.
|
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 |
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(X[][] alignmentMatrix,
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 AbstractGapAlignmentAlgorithm(AlignmentSpecification alignmentSpecification, Class<X> entryClass, Class<R> resultClass)
public Class<X> getEntryClass()
public Class<R> getResultClass()
getResultClass
in interface AlignmentAlgorithm<R>
public X[][] getLastAlignmentMatrix()
public void setWeightThreshold(double weightThreshold)
weightThreshold
- a weight threshold (between 0 and 1)public double getWeightThreshold()
public AlignmentSpecification getSpecification()
getSpecification
in interface AlignmentAlgorithm<R>
public R calculateAlignment(Sequence a, Sequence b)
calculateAlignment
in interface AlignmentAlgorithm<R>
a
- The first sequence.b
- The second sequence.public abstract X createInitial()
public abstract X createDelInitial(X delOld, int i, double delLocal)
delOld
- the matrix entry (i,0)i
- i+1delLocal
- the local deletion cost, defined as the weighted sum over
all comparator deletion costs.public abstract X createInsInitial(X insOld, int j, double insLocal)
insOld
- the matrix entry (0,j+1)j
- j+1insLocal
- the local insertion cost, defined as the weighted sum
over all comparator insertion costs.public abstract X createNewEntry(X delOld, X insOld, X repOld, int i, int j, double delLocal, double insLocal, double repLocal)
delOld
- the matrix entry (i,j+1)insOld
- the matrix entry (i+1,j)repOld
- the matrix entry (i,j)i
- i+1j
- j+1delLocal
- the local deletion cost, defined as the weighted sum over
all comparator deletion costs.insLocal
- the local insertion cost, defined as the weighted sum
over all comparator insertion costs.repLocal
- the local replacement cost, defined as the weighted sum
over all comparator replacement costs.public abstract R transformToResult(X[][] alignmentMatrix, Sequence a, Sequence b)
alignmentMatrix
- the alignment matrix.a
- the first sequence.b
- th second sequence.public static <X> X[] createGenericArray(int size, Class<X> arrClass)
X
- the type of the new array.size
- the size of the new array.arrClass
- the class of the new array elements.public static <X> X[][] createGenericMatrix(int m, int n, Class<X> entryClass)
X
- the type of the new array.m
- the number of rows of the result matrix.n
- the number of columns of the result matrix.entryClass
- the class of the generic class.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 . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/