tools
Class SequenceAligner

java.lang.Object
  extended by tools.SequenceAligner

public class SequenceAligner
extends Object

Calculates pairwise sequence alignments using the JAligner library. Implements a caching functionality to avoid multiple calulations of the same alignments.

Before aligning two sequences you have to add them to the sequence pool of the aligner object to provide actual sequence data for the proteins.

Gap penalties are specified as positive values.

Note: Only local alignments (Smith-Waterman) are supported at the moment.

Author:
Jan Krumsiek

Constructor Summary
SequenceAligner()
          Creates a new sequence aligner with activated caching.
SequenceAligner(boolean cache)
          Creates a new sequence aligner.
 
Method Summary
 void addToSequencePool(Sequences sequences)
          Add a set of sequences to the sequence pool of this aligner.
 jaligner.Alignment getAlignment(int protein1, int protein2)
          Returns the local sequence alignment for two given proteins.
static String[] getMatrixNames()
          Returns a list of possible substitution matrix names.
 Sequences getSequencePool()
           
 void setGapExtend(float gapExt)
          Sets the gap extension penality.
 void setGapOpen(float gapOpen)
          Sets the gap open penality.
 void setMatrix(String matrixName)
          Sets the substitution matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceAligner

public SequenceAligner()
Creates a new sequence aligner with activated caching. Default parameters: gap-open = 10, gap-extend = 0.5, matrix = BLOSUM62


SequenceAligner

public SequenceAligner(boolean cache)
Creates a new sequence aligner. Default parameters: gap-open = 10, gap-extend = 0.5, matrix = BLOSUM62

Parameters:
cache - cache alignments to avoid multiple pairwise alignment calculations?
Method Detail

getMatrixNames

public static String[] getMatrixNames()
Returns a list of possible substitution matrix names.

Returns:
list of substitution matrix names

setMatrix

public void setMatrix(String matrixName)
               throws ProCopeException
Sets the substitution matrix. To get a list of possible names call getMatrixNames().

Parameters:
matrixName - name of substitution matrix.
Throws:
ProCopeException - if the specified substitution matrix was not found

setGapOpen

public void setGapOpen(float gapOpen)
Sets the gap open penality.

Parameters:
gapOpen - gap open penality

setGapExtend

public void setGapExtend(float gapExt)
Sets the gap extension penality.

Parameters:
gapExt - gap extension penalty

addToSequencePool

public void addToSequencePool(Sequences sequences)
Add a set of sequences to the sequence pool of this aligner.

Parameters:
sequences - sequences to be added to the pool

getAlignment

public jaligner.Alignment getAlignment(int protein1,
                                       int protein2)
                                throws ProCopeException
Returns the local sequence alignment for two given proteins.

Parameters:
protein1 - first protein
protein2 - second protein
Returns:
alignment object (from JAligner library)
Throws:
ProCopeException - if at least one of the proteins has no sequence in the current sequence pool

getSequencePool

public Sequences getSequencePool()