Package org.biojava.nbio.alignment
Class FractionalSimilarityScorer<S extends Sequence<C>,C extends Compound>
- java.lang.Object
-
- org.biojava.nbio.alignment.template.AbstractScorer
-
- org.biojava.nbio.alignment.FractionalSimilarityScorer<S,C>
-
- Type Parameters:
S
- eachSequence
of the alignment pair is of type SC
- each element of anAlignedSequence
is aCompound
of type C
- All Implemented Interfaces:
PairwiseSequenceScorer<S,C>
,Scorer
- Direct Known Subclasses:
FractionalSimilarityInProfileScorer
public class FractionalSimilarityScorer<S extends Sequence<C>,C extends Compound> extends AbstractScorer implements PairwiseSequenceScorer<S,C>
Implements an algorithm which computes a score for a sequence alignment pair. The reported score is the number of alignment columns which have similarCompound
s.- Author:
- Mark Chapman
-
-
Constructor Summary
Constructors Constructor Description FractionalSimilarityScorer(PairwiseSequenceAligner<S,C> aligner)
Creates a fractional similarity scorer for a pair of sequences aligned by the given pairwise sequence aligner.FractionalSimilarityScorer(SequencePair<S,C> pair)
Creates a fractional similarity scorer for an aligned pair of sequences.
-
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
-
FractionalSimilarityScorer
public FractionalSimilarityScorer(PairwiseSequenceAligner<S,C> aligner)
Creates a fractional similarity scorer for a pair of sequences aligned by the given pairwise sequence aligner.- Parameters:
aligner
- a pairwise sequence aligner
-
FractionalSimilarityScorer
public FractionalSimilarityScorer(SequencePair<S,C> pair)
Creates a fractional similarity scorer for an aligned pair of sequences.- Parameters:
pair
- an aligned pair of sequences
-
-
Method Detail
-
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.
-
getMaxScore
public double getMaxScore()
Description copied from interface:Scorer
Returns maximum possible score.- Specified by:
getMaxScore
in interfaceScorer
- Returns:
- maximum possible score
-
getMinScore
public double getMinScore()
Description copied from interface:Scorer
Returns minimum possible score.- Specified by:
getMinScore
in interfaceScorer
- Returns:
- minimum possible score
-
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()
).
-
-