org.biojava3.alignment
Class FractionalIdentityScorer<S extends Sequence<C>,C extends Compound>

java.lang.Object
  extended by org.biojava3.alignment.template.AbstractScorer
      extended by org.biojava3.alignment.FractionalIdentityScorer<S,C>
Type Parameters:
S - each Sequence of the alignment pair is of type S
C - each element of an AlignedSequence is a Compound of type C
All Implemented Interfaces:
PairwiseSequenceScorer<S,C>, Scorer
Direct Known Subclasses:
FractionalIdentityInProfileScorer

public class FractionalIdentityScorer<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 identical Compounds.

Author:
Mark Chapman

Constructor Summary
FractionalIdentityScorer(PairwiseSequenceAligner<S,C> aligner)
          Creates a fractional identity scorer for a pair of sequences aligned by the given pairwise sequence aligner.
FractionalIdentityScorer(SequencePair<S,C> pair)
          Creates a fractional identity scorer for an aligned pair of sequences.
 
Method Summary
 int getMaxScore()
          Returns maximum possible score.
 int getMinScore()
          Returns minimum possible score.
 S getQuery()
          Returns the first sequence of the pair.
 int getScore()
          Returns score resulting from algorithm.
 S getTarget()
          Returns the second sequence of the pair.
 
Methods inherited from class org.biojava3.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.biojava3.alignment.template.Scorer
getDistance, getDistance, getSimilarity, getSimilarity
 

Constructor Detail

FractionalIdentityScorer

public FractionalIdentityScorer(PairwiseSequenceAligner<S,C> aligner)
Creates a fractional identity scorer for a pair of sequences aligned by the given pairwise sequence aligner.

Parameters:
aligner - a pairwise sequence aligner

FractionalIdentityScorer

public FractionalIdentityScorer(SequencePair<S,C> pair)
Creates a fractional identity 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.

Specified by:
getQuery in interface PairwiseSequenceScorer<S extends Sequence<C>,C extends Compound>
Returns:
the first sequence of the pair

getTarget

public S getTarget()
Description copied from interface: PairwiseSequenceScorer
Returns the second sequence of the pair.

Specified by:
getTarget in interface PairwiseSequenceScorer<S extends Sequence<C>,C extends Compound>
Returns:
the second sequence of the pair

getMaxScore

public int getMaxScore()
Description copied from interface: Scorer
Returns maximum possible score.

Specified by:
getMaxScore in interface Scorer
Returns:
maximum possible score

getMinScore

public int getMinScore()
Description copied from interface: Scorer
Returns minimum possible score.

Specified by:
getMinScore in interface Scorer
Returns:
minimum possible score

getScore

public int 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()).

Specified by:
getScore in interface Scorer
Returns:
score resulting from algorithm