org.biojava3.alignment.template
S
- each element of the alignment Profile
is of type SC
- each element of an AlignedSequence
is a Compound
of type Cpublic abstract class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound> extends AbstractScorer implements MatrixAligner<S,C>
Aligner
which builds a score matrix during computation.Modifier and Type | Field and Description |
---|---|
protected int[] |
anchors |
protected int |
cutsPerSection |
protected GapPenalty |
gapPenalty |
protected short |
max |
protected short |
min |
protected Profile<S,C> |
profile |
protected short |
score |
protected short[][][] |
scores |
protected long |
time |
protected int[] |
xyMax |
protected int[] |
xyStart |
Modifier | Constructor and Description |
---|---|
protected |
AbstractMatrixAligner()
Before running an alignment, data must be sent in via calls to
setGapPenalty(GapPenalty) and
setSubstitutionMatrix(SubstitutionMatrix) . |
protected |
AbstractMatrixAligner(GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix)
Prepares for an alignment.
|
protected |
AbstractMatrixAligner(GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix,
boolean local)
Prepares for an alignment.
|
Modifier and Type | Method and Description |
---|---|
protected void |
align() |
protected abstract CompoundSet<C> |
getCompoundSet() |
protected abstract java.util.List<C> |
getCompoundsOfQuery() |
protected abstract java.util.List<C> |
getCompoundsOfTarget() |
long |
getComputationTime()
Returns the computation time needed for an alignment computed in nanoseconds.
|
GapPenalty |
getGapPenalty()
Returns the gap penalties.
|
int |
getMaxScore()
Returns maximum possible score.
|
int |
getMinScore()
Returns minimum possible score.
|
Profile<S,C> |
getProfile()
Returns the alignment
Profile produced by this alignment algorithm. |
int |
getScore()
Returns score resulting from algorithm.
|
short[][][] |
getScoreMatrix()
Returns the entire score matrix built during alignment.
|
java.lang.String |
getScoreMatrixAsString()
Returns a depiction of the score matrix as a
String . |
protected abstract int[] |
getScoreMatrixDimensions() |
SubstitutionMatrix<C> |
getSubstitutionMatrix()
Returns the substitution matrix.
|
protected abstract short |
getSubstitutionScore(int queryColumn,
int targetColumn) |
protected short[] |
getSubstitutionScoreVector(int queryColumn) |
protected short[] |
getSubstitutionScoreVector(int queryColumn,
int[] subproblem) |
boolean |
isLocal()
Returns whether alignment finds a region of similarity rather than aligning every compound.
|
protected abstract boolean |
isReady() |
boolean |
isStoringScoreMatrix()
Returns choice to cache the score matrix or to save memory by deleting score matrix after alignment.
|
protected void |
reset() |
protected void |
resetAnchors() |
void |
setGapPenalty(GapPenalty gapPenalty)
Sets the gap penalties.
|
protected abstract void |
setProfile(java.util.List<AlignedSequence.Step> sx,
java.util.List<AlignedSequence.Step> sy) |
void |
setStoringScoreMatrix(boolean storingScoreMatrix)
Sets choice to cache the score matrix or to save memory by deleting score matrix after alignment.
|
void |
setSubstitutionMatrix(SubstitutionMatrix<C> subMatrix)
Sets the substitution matrix.
|
getDistance, getDistance, getSimilarity, getSimilarity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDistance, getDistance, getSimilarity, getSimilarity
protected GapPenalty gapPenalty
protected int[] anchors
protected int cutsPerSection
protected int[] xyMax
protected int[] xyStart
protected short max
protected short min
protected short score
protected short[][][] scores
protected long time
protected AbstractMatrixAligner()
setGapPenalty(GapPenalty)
and
setSubstitutionMatrix(SubstitutionMatrix)
.protected AbstractMatrixAligner(GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
gapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignmentprotected AbstractMatrixAligner(GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix, boolean local)
gapPenalty
- the gap penalties used during alignmentsubMatrix
- the set of substitution scores used during alignmentlocal
- if true, find a region of similarity rather than aligning every compoundpublic GapPenalty getGapPenalty()
public SubstitutionMatrix<C> getSubstitutionMatrix()
public boolean isLocal()
public boolean isStoringScoreMatrix()
public void setGapPenalty(GapPenalty gapPenalty)
gapPenalty
- the gap penalties used during alignmentpublic void setSubstitutionMatrix(SubstitutionMatrix<C> subMatrix)
subMatrix
- the set of substitution scores used during alignmentpublic void setStoringScoreMatrix(boolean storingScoreMatrix)
storingScoreMatrix
- choice to cache the score matrixpublic short[][][] getScoreMatrix()
MatrixAligner
Sequence
.getScoreMatrix
in interface MatrixAligner<S extends Sequence<C>,C extends Compound>
public java.lang.String getScoreMatrixAsString()
MatrixAligner
String
. This may include additional description such as
labels for each dimension: element from query sequence, element from target sequence, and meaning of each score.getScoreMatrixAsString
in interface MatrixAligner<S extends Sequence<C>,C extends Compound>
public long getComputationTime()
Aligner
public Profile<S,C> getProfile()
Aligner
Profile
produced by this alignment algorithm.public int getMaxScore()
Scorer
getMaxScore
in interface Scorer
public int getMinScore()
Scorer
getMinScore
in interface Scorer
public int getScore()
Scorer
Scorer.getScore()
- Scorer.getMinScore()
) / (Scorer.getMaxScore()
- Scorer.getMinScore()
).protected void align()
protected short[] getSubstitutionScoreVector(int queryColumn)
protected short[] getSubstitutionScoreVector(int queryColumn, int[] subproblem)
protected void reset()
protected void resetAnchors()
protected abstract CompoundSet<C> getCompoundSet()
protected abstract java.util.List<C> getCompoundsOfQuery()
protected abstract java.util.List<C> getCompoundsOfTarget()
protected abstract int[] getScoreMatrixDimensions()
protected abstract short getSubstitutionScore(int queryColumn, int targetColumn)
protected abstract boolean isReady()
protected abstract void setProfile(java.util.List<AlignedSequence.Step> sx, java.util.List<AlignedSequence.Step> sy)