public class SoftAlignmentScoreAlgorithm extends AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
Modifier and Type | Class and Description |
---|---|
static class |
SoftAlignmentScoreAlgorithm.ScoreEntry |
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULTBETA |
static double |
GLOBALAPPROXTHRESHOLD
This means that softmin arguments with a weight smaller than 10^-3 will
be disregarded.
|
Constructor and Description |
---|
SoftAlignmentScoreAlgorithm(AlignmentSpecification alignmentSpecification)
This sets up an AlignmentAlgorithm instance according to the given
specification.
|
Modifier and Type | Method and Description |
---|---|
SoftAlignmentScoreAlgorithm.ScoreEntry |
createDelInitial(SoftAlignmentScoreAlgorithm.ScoreEntry 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).
|
SoftAlignmentScoreAlgorithm.ScoreEntry |
createInitial()
This method should not be called from outside!
The subclass specifies the entry (0,0) of the alignment matrix with this
method.
|
SoftAlignmentScoreAlgorithm.ScoreEntry |
createInsInitial(SoftAlignmentScoreAlgorithm.ScoreEntry 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).
|
SoftAlignmentScoreAlgorithm.ScoreEntry |
createNewEntry(SoftAlignmentScoreAlgorithm.ScoreEntry delOld,
SoftAlignmentScoreAlgorithm.ScoreEntry insOld,
SoftAlignmentScoreAlgorithm.ScoreEntry 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).
|
double |
getBeta() |
void |
setBeta(double beta) |
static double |
softmin(double beta,
double... args)
This calculates softmin for the given input and the given value of beta.
|
Double |
transformToResult(SoftAlignmentScoreAlgorithm.ScoreEntry[][] 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.
|
calculateAlignment, calculateDeletionCosts, calculateInsertionCosts, calculateReplacementCosts, createGenericArray, createGenericMatrix, getDefaultComparator, getEntryClass, getLastAlignmentMatrix, getResultClass, getSpecification, getWeightThreshold, setWeightThreshold
public static final double DEFAULTBETA
public static final double GLOBALAPPROXTHRESHOLD
public SoftAlignmentScoreAlgorithm(AlignmentSpecification alignmentSpecification)
alignmentSpecification
- an AlignmentSpecification.public void setBeta(double beta)
beta
- The parameter defining the "softness" of the alignment. For
beta towards infinity this alignment becomes closer to the strict
alignment. For beta = 0 all possible alignments are equally considered
and softmin returns the average. Please note that a low beta value might
lead to a very rough approximation and that for higher sequence lengths
beta has to be higher, too.public double getBeta()
public SoftAlignmentScoreAlgorithm.ScoreEntry createInitial()
createInitial
in class AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
public SoftAlignmentScoreAlgorithm.ScoreEntry createDelInitial(SoftAlignmentScoreAlgorithm.ScoreEntry delOld, int i, double delLocal)
createDelInitial
in class AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
delOld
- the matrix entry (i,0)i
- i+1delLocal
- the local deletion cost, defined as the weighted sum over
all comparator deletion costs.public SoftAlignmentScoreAlgorithm.ScoreEntry createInsInitial(SoftAlignmentScoreAlgorithm.ScoreEntry insOld, int j, double insLocal)
createInsInitial
in class AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
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 SoftAlignmentScoreAlgorithm.ScoreEntry createNewEntry(SoftAlignmentScoreAlgorithm.ScoreEntry delOld, SoftAlignmentScoreAlgorithm.ScoreEntry insOld, SoftAlignmentScoreAlgorithm.ScoreEntry repOld, int i, int j, double delLocal, double insLocal, double repLocal)
createNewEntry
in class AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
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 Double transformToResult(SoftAlignmentScoreAlgorithm.ScoreEntry[][] alignmentMatrix, Sequence a, Sequence b)
transformToResult
in class AbstractGapAlignmentAlgorithm<SoftAlignmentScoreAlgorithm.ScoreEntry,Double>
alignmentMatrix
- the alignment matrix.a
- the first sequence.b
- th second sequence.public static double softmin(double beta, double... args)
beta
- Softmin equals min for beta towards infinity. For beta = 0
softmin returns the average of the given input arguments. Thus beta
regulates the "softness" of the softmin approximation.args
- the input arguments.Copyright © 2014. All rights reserved.