belka.align
Class SeqAligner

java.lang.Object
  extended by belka.align.SeqAligner

public class SeqAligner
extends Object

Objects of this class perform sequence alignemnts by Needleman-Wunsch and Smith-Waterman algorithms.

Author:
Alexej Abyzov

Constructor Summary
SeqAligner()
          Contructor of SeqAligner object with default values: scoring matrix: BLOSUM62 gap open penalty: -10 gap extend penalty: -1
SeqAligner(String matrix, int gap_open, int gap_extend)
          Contructor of SeqAligner object with specified scoring matrix, gap open penalty, and gap extend penalty.
 
Method Summary
 int align_nw(Chain chain1, Chain chain2)
          Alignes two sets of assemblies (residues/nucleotides) with default parameters using Needleman-Wunsch method.
 int align_sw(Chain chain1, Chain chain2)
          Alignes two sets of assemblies (residues/nucleotides) with default parameters using Smith-Waterman method.
 void applyToChains()
          The function introduces gaps in chains to reflect the calculated alignment.
 int getAliLength()
          Returns lengths of alignment;
 String getAliSequence1()
          Returns aligned part of first sequence.
 String getAliSequence2()
          Returns aligned part of second sequence.
 int getGapExtend()
          Returns current value of gap extension penatly.
 int getGapOpen()
          Returns current value of gap open penatly.
 int getLength1()
          Returns lengths of first aligned sequence.
 int getLength2()
          Returns lengths of second aligned sequence.
 int getNumGaps()
          Returns number of gaps in alignment.
 int getNumIdentical()
          Returns number of identical residues in alignment.
 int getNumPositive()
          Returns number of aligned residues with positive score.
 int getScore()
          Returns score of the alignment.
 String getScoringMatrix()
          Returns current scoring matrix.
 boolean hasAlignment()
          Returns true if the object has alignment, false otherwise.
 boolean setGapExtend(int gap_extend)
          Sets new value for gap extention penatly.
 boolean setGapOpen(int gap_open)
          Sets new value for gap open penatly.
 boolean setScoringMatrix(String matrix)
          Sets new scoring matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeqAligner

public SeqAligner()
Contructor of SeqAligner object with default values: scoring matrix: BLOSUM62 gap open penalty: -10 gap extend penalty: -1


SeqAligner

public SeqAligner(String matrix,
                  int gap_open,
                  int gap_extend)
Contructor of SeqAligner object with specified scoring matrix, gap open penalty, and gap extend penalty.

Parameters:
matrix - name of scoring matrix.
gap_open - gap open penalty.
gap_extend - gap extend penalty.
Method Detail

hasAlignment

public boolean hasAlignment()
Returns true if the object has alignment, false otherwise.

Returns:
true if the object has alignment, false otherwise.

getLength1

public int getLength1()
Returns lengths of first aligned sequence.

Returns:
lengths of first aligned sequence.

getLength2

public int getLength2()
Returns lengths of second aligned sequence.

Returns:
lengths of second aligned sequence.

getAliSequence1

public String getAliSequence1()
Returns aligned part of first sequence.

Returns:
aligned part of first sequence.

getAliSequence2

public String getAliSequence2()
Returns aligned part of second sequence.

Returns:
aligned part of second sequence.

getAliLength

public int getAliLength()
Returns lengths of alignment;

Returns:
lengths of alignment;

getNumIdentical

public int getNumIdentical()
Returns number of identical residues in alignment.

Returns:
number of identical residues in alignment.

getNumPositive

public int getNumPositive()
Returns number of aligned residues with positive score.

Returns:
number of aligned residues with positive score.

getNumGaps

public int getNumGaps()
Returns number of gaps in alignment.

Returns:
number of gaps in alignment.

getScore

public int getScore()
Returns score of the alignment.

Returns:
score of the alignment.

applyToChains

public void applyToChains()
The function introduces gaps in chains to reflect the calculated alignment.


setScoringMatrix

public boolean setScoringMatrix(String matrix)
Sets new scoring matrix.

Parameters:
matrix - name of scoring matrix.
Returns:
true if value is accepted, false otherwise.

getScoringMatrix

public String getScoringMatrix()
Returns current scoring matrix.

Returns:
current scoring matrix.

setGapOpen

public boolean setGapOpen(int gap_open)
Sets new value for gap open penatly.

Parameters:
gap_open - gap open penalty.
Returns:
true if value is accepted, false otherwise.

getGapOpen

public int getGapOpen()
Returns current value of gap open penatly.

Returns:
current value of gap open penatly.

setGapExtend

public boolean setGapExtend(int gap_extend)
Sets new value for gap extention penatly.

Parameters:
gap_extend - gap extend penalty.
Returns:
true if value is accepted, false otherwise.

getGapExtend

public int getGapExtend()
Returns current value of gap extension penatly.

Returns:
current value of gap extension penatly.

align_sw

public int align_sw(Chain chain1,
                    Chain chain2)
Alignes two sets of assemblies (residues/nucleotides) with default parameters using Smith-Waterman method.

Parameters:
chain1 - first chain to be aligned.
chain2 - second chain to be aligned.
Returns:
score of alignment.

align_nw

public int align_nw(Chain chain1,
                    Chain chain2)
Alignes two sets of assemblies (residues/nucleotides) with default parameters using Needleman-Wunsch method.

Parameters:
chain1 - first chain to be aligned.
chain2 - second chain to be aligned.
Returns:
score of alignment.