Package org.biojava.nbio.alignment
Class SubstitutionMatrixScorer<S extends Sequence<C>,C extends Compound>
- java.lang.Object
-
- org.biojava.nbio.alignment.template.AbstractScorer
-
- org.biojava.nbio.alignment.SubstitutionMatrixScorer<S,C>
-
- Type Parameters:
S
-C
-
- All Implemented Interfaces:
PairwiseSequenceScorer<S,C>
,Scorer
public class SubstitutionMatrixScorer<S extends Sequence<C>,C extends Compound> extends AbstractScorer implements PairwiseSequenceScorer<S,C>
Scores using a substitution matrix. Specifically, the score is the sum of the substitution matrix entries corresponding to the alignment. Gaps are scored according to the substitution matrix, just as matches and mismatches.- Author:
- dmyersturnbull
-
-
Constructor Summary
Constructors Constructor Description SubstitutionMatrixScorer(SequencePair<S,C> pair, SubstitutionMatrix<C> matrix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaxScore()
Returns maximum possible score.double
getMinScore()
Returns minimum possible score.S
getQuery()
Returns the first sequence of the pair.double
getScore()
Returns score resulting from algorithm.S
getTarget()
Returns the second sequence of the pair.-
Methods inherited from class org.biojava.nbio.alignment.template.AbstractScorer
getDistance, getDistance, getSimilarity, getSimilarity
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.nbio.alignment.template.Scorer
getDistance, getDistance, getSimilarity, getSimilarity
-
-
-
-
Constructor Detail
-
SubstitutionMatrixScorer
public SubstitutionMatrixScorer(SequencePair<S,C> pair, SubstitutionMatrix<C> matrix)
-
-
Method Detail
-
getMaxScore
public double getMaxScore()
Description copied from interface:Scorer
Returns maximum possible score.- Specified by:
getMaxScore
in interfaceScorer
- Returns:
- The maximum score the query could be assigned when aligned against any target sequence.
-
getMinScore
public double getMinScore()
Description copied from interface:Scorer
Returns minimum possible score.- Specified by:
getMinScore
in interfaceScorer
- Returns:
- The minimum score the query could be assigned when aligned against any target sequence.
-
getScore
public double getScore()
Description copied from interface:Scorer
Returns score resulting from algorithm. This should normalize between 0 and 1 by calculating (Scorer.getScore()
-Scorer.getMinScore()
) / (Scorer.getMaxScore()
-Scorer.getMinScore()
).
-
getQuery
public S getQuery()
Description copied from interface:PairwiseSequenceScorer
Returns the first sequence of the pair.
-
getTarget
public S getTarget()
Description copied from interface:PairwiseSequenceScorer
Returns the second sequence of the pair.
-
-