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

java.lang.Object
  extended by org.biojava3.alignment.template.AbstractScorer
      extended by org.biojava3.alignment.template.AbstractMatrixAligner<S,C>
          extended by org.biojava3.alignment.template.AbstractPairwiseSequenceAligner<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:
Aligner<S,C>, MatrixAligner<S,C>, PairwiseSequenceAligner<S,C>, PairwiseSequenceScorer<S,C>, Scorer
Direct Known Subclasses:
AnchoredPairwiseSequenceAligner, NeedlemanWunsch, SmithWaterman

public abstract class AbstractPairwiseSequenceAligner<S extends Sequence<C>,C extends Compound>
extends AbstractMatrixAligner<S,C>
implements PairwiseSequenceAligner<S,C>

Implements common code for an Aligner for a pair of Sequences.

Author:
Mark Chapman

Field Summary
protected  SequencePair<S,C> pair
           
 
Fields inherited from class org.biojava3.alignment.template.AbstractMatrixAligner
anchors, cutsPerSection, gapPenalty, max, min, profile, score, scores, time, xyMax, xyStart
 
Constructor Summary
protected AbstractPairwiseSequenceAligner()
          Before running a pairwise global sequence alignment, data must be sent in via calls to setQuery(Sequence), setTarget(Sequence), AbstractMatrixAligner.setGapPenalty(GapPenalty), and AbstractMatrixAligner.setSubstitutionMatrix(SubstitutionMatrix).
protected AbstractPairwiseSequenceAligner(S query, S target, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix)
          Prepares for a pairwise global sequence alignment.
protected AbstractPairwiseSequenceAligner(S query, S target, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix, boolean local)
          Prepares for a pairwise sequence alignment.
 
Method Summary
protected  CompoundSet<C> getCompoundSet()
           
protected  List<C> getCompoundsOfQuery()
           
protected  List<C> getCompoundsOfTarget()
           
 SequencePair<S,C> getPair()
          Returns sequence alignment pair.
 S getQuery()
          Returns the first sequence of the pair.
protected  int[] getScoreMatrixDimensions()
           
protected  short getSubstitutionScore(int queryColumn, int targetColumn)
           
 S getTarget()
          Returns the second sequence of the pair.
protected  boolean isReady()
           
protected  void reset()
           
 void setQuery(S query)
          Sets the query Sequence.
 void setTarget(S target)
          Sets the target Sequence.
 
Methods inherited from class org.biojava3.alignment.template.AbstractMatrixAligner
align, getComputationTime, getGapPenalty, getMaxScore, getMinScore, getProfile, getScore, getScoreMatrix, getScoreMatrixAsString, getSubstitutionMatrix, getSubstitutionScoreVector, getSubstitutionScoreVector, isLocal, isStoringScoreMatrix, resetAnchors, setGapPenalty, setProfile, setStoringScoreMatrix, setSubstitutionMatrix
 
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.Aligner
getComputationTime, getProfile
 
Methods inherited from interface org.biojava3.alignment.template.Scorer
getDistance, getDistance, getMaxScore, getMinScore, getScore, getSimilarity, getSimilarity
 

Field Detail

pair

protected SequencePair<S extends Sequence<C>,C extends Compound> pair
Constructor Detail

AbstractPairwiseSequenceAligner

protected AbstractPairwiseSequenceAligner()
Before running a pairwise global sequence alignment, data must be sent in via calls to setQuery(Sequence), setTarget(Sequence), AbstractMatrixAligner.setGapPenalty(GapPenalty), and AbstractMatrixAligner.setSubstitutionMatrix(SubstitutionMatrix).


AbstractPairwiseSequenceAligner

protected AbstractPairwiseSequenceAligner(S query,
                                          S target,
                                          GapPenalty gapPenalty,
                                          SubstitutionMatrix<C> subMatrix)
Prepares for a pairwise global sequence alignment.

Parameters:
query - the first Sequence of the pair to align
target - the second Sequence of the pair to align
gapPenalty - the gap penalties used during alignment
subMatrix - the set of substitution scores used during alignment

AbstractPairwiseSequenceAligner

protected AbstractPairwiseSequenceAligner(S query,
                                          S target,
                                          GapPenalty gapPenalty,
                                          SubstitutionMatrix<C> subMatrix,
                                          boolean local)
Prepares for a pairwise sequence alignment.

Parameters:
query - the first Sequence of the pair to align
target - the second Sequence of the pair to align
gapPenalty - the gap penalties used during alignment
subMatrix - the set of substitution scores used during alignment
local - if true, find a region of similarity rather than aligning every compound
Method Detail

setQuery

public void setQuery(S query)
Sets the query Sequence.

Parameters:
query - the first Sequence of the pair to align

setTarget

public void setTarget(S target)
Sets the target Sequence.

Parameters:
target - the second Sequence of the pair to align

getPair

public SequencePair<S,C> getPair()
Description copied from interface: PairwiseSequenceAligner
Returns sequence alignment pair.

Specified by:
getPair in interface PairwiseSequenceAligner<S extends Sequence<C>,C extends Compound>
Returns:
sequence alignment pair

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

getCompoundSet

protected CompoundSet<C> getCompoundSet()
Specified by:
getCompoundSet in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

getCompoundsOfQuery

protected List<C> getCompoundsOfQuery()
Specified by:
getCompoundsOfQuery in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

getCompoundsOfTarget

protected List<C> getCompoundsOfTarget()
Specified by:
getCompoundsOfTarget in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

getScoreMatrixDimensions

protected int[] getScoreMatrixDimensions()
Specified by:
getScoreMatrixDimensions in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

getSubstitutionScore

protected short getSubstitutionScore(int queryColumn,
                                     int targetColumn)
Specified by:
getSubstitutionScore in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

isReady

protected boolean isReady()
Specified by:
isReady in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>

reset

protected void reset()
Overrides:
reset in class AbstractMatrixAligner<S extends Sequence<C>,C extends Compound>