modele
Class Alignement

java.lang.Object
  extended by modele.Alignement

public class Alignement
extends java.lang.Object

This class to make alignments possible in searching Palindrome's and helix. We can consider the two sequences as the same, the alignment is made with first sequence from beginning (5') to end (3') and the other from the end (3') to the beginning (5') [ReverseAlignment].
Then to find / recover scoring pairwise in the scoring matrix.
NOTE : in case of use of P-DCFold algorithm : {seq1 == seq2}.

Author:
Gabriel Chandesris (2008) NONO SERVLET ?? renommer cette classe...

Field Summary
private static int AU
          Score for match between two nucleotides / bases.
private static int B5GU
          Special score for GU pair when configuration.
private static int GC
          Score for match between two nucleotides / bases.
private static int GU
          Score for match between two nucleotides / bases.
private static boolean H5AA
          When GA or AA opposition before helix.
private static boolean H5GA
          When GA or AA opposition before helix.
private static double lbmin
          Minimal length of loop (global / static).
private static double lpmin
          Minimal length of Palindrome (global / static).
private  int[][] matrice
          Alignment matrix.
private static boolean pairwise
          To test if a pairwise has happend precedently.
private  PalindromeListe palindromes
          List of the Palindrome's.
private static int R5GU
          Special score for GU pair when configuration.
private  Sequence sequence1
          Sequence of the alignment.
private  Sequence sequence2
          Sequence of the alignment.
private static boolean YR
          For calculating the score when GU after a YR or RY match.
 
Constructor Summary
Alignement(Sequence sequence)
          Deprecated. Not easy to well understand it without source code.
Alignement(Sequence sequence, double lpmin, double lbmin)
          Deprecated. Not easy to well understand it without source code.
Alignement(Sequence sequence1, Sequence sequence2)
          Constructor of the alignment. lpmin is set to 3.0 and lbmin to 4.0.
Alignement(Sequence sequence1, Sequence sequence2, double lpmin, double lbmin)
          Constructor of the alignment with given lpmin.
 
Method Summary
 boolean equals(Alignement toCompare)
          To know if instance of the class and an other are the same.
static double getLbmin()
           
static double getLpmin()
           
 int[][] getMatrice()
          To get the score matrix.
 int getMatriceScore(int i, int j)
          To get a score at a specific position in the score matrix of reverse alignment.
 Palindrome getPalindrome(int score)
          To get a Palindrome with a given score.
 Palindrome getPalindrome(int i, int j)
          To get Palindrome from a score at a specific position in the matrix.
 PalindromeListe getPalindromes()
          To get the PalindromeListe of Palindrome's calculating by current instance of Alignment.
 Sequence getSequence1()
           
 Sequence getSequence2()
           
 boolean hasSameSequences()
          To know if the two Sequence's reverse aligned are the same.
static void init()
          Deprecated. Not to use in other cases...
private  void initialise()
          Initialization of the scoring matrix.
static boolean isGoodPalindrome(int beg, int end, int len)
          To know if a palindrome has to be selected or not, with criteria of length and loop (minimal length of palindrome and loop).
static int maxInt(int[] tabInt)
          To find a maximum int in a group of int (0 if group have no member).
private  void recoverPalindromes()
          Searching for Palindrome's, only on the half of the matrix score.
static int score(char x, char y)
          Scoring alignment between two char of two sequences.
static int scoreBasic(char x, char y)
          Getting a score from two (2) bases.
static void setLbmin(double lbmin)
           
static void setLpmin(double lpmin)
           
private  void working()
          Alignment work here, this is a research of Palindrome (normal and reverse sense).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GU

private static final int GU
Score for match between two nucleotides / bases.

See Also:
Constant Field Values

AU

private static final int AU
Score for match between two nucleotides / bases.

See Also:
Constant Field Values

GC

private static final int GC
Score for match between two nucleotides / bases.

See Also:
Constant Field Values

B5GU

private static final int B5GU
Special score for GU pair when configuration.

See Also:
Constant Field Values

R5GU

private static final int R5GU
Special score for GU pair when configuration.

See Also:
Constant Field Values

YR

private static boolean YR
For calculating the score when GU after a YR or RY match. (Wooble after Watson-Cricks match in helix).


H5GA

private static boolean H5GA
When GA or AA opposition before helix.


H5AA

private static boolean H5AA
When GA or AA opposition before helix.


pairwise

private static boolean pairwise
To test if a pairwise has happend precedently. Useful for thermodynamic model.

See Also:
B5GU, score(char, char)

matrice

private int[][] matrice
Alignment matrix.


sequence1

private Sequence sequence1
Sequence of the alignment.


sequence2

private Sequence sequence2
Sequence of the alignment.


palindromes

private PalindromeListe palindromes
List of the Palindrome's.


lpmin

private static double lpmin
Minimal length of Palindrome (global / static). Can be changed by constructor.

See Also:
Algorithms.getLongPalindMin()

lbmin

private static double lbmin
Minimal length of loop (global / static). Can be changed by constructor.

See Also:
Algorithms.getLongBoucleMin()
Constructor Detail

Alignement

public Alignement(Sequence sequence)
Deprecated. Not easy to well understand it without source code.

«Standard» constructor of alignment, the two sequences are the same, lpmin set to 3.0 and lbmin to 4.0.
Score matrix is initialized, reverse alignment is made and recovering of Palindromes too.

Parameters:
sequence - Sequence to reverse align against itself
See Also:
Alignement(Sequence, Sequence), initialise(), working(), recoverPalindromes()

Alignement

public Alignement(Sequence sequence,
                  double lpmin,
                  double lbmin)
Deprecated. Not easy to well understand it without source code.

«Standard» constructor of alignment with given lpmin, the two sequences are the same.
Score matrix is initialized, reverse alignment is made and recovering of Palindromes too.

Parameters:
sequence - Sequence to reverse align against itself
See Also:
Alignement(Sequence, Sequence, double, double), initialise(), working(), recoverPalindromes()

Alignement

public Alignement(Sequence sequence1,
                  Sequence sequence2)
Constructor of the alignment. lpmin is set to 3.0 and lbmin to 4.0.
Score matrix is initialized, reverse alignment is made and recovering of Palindromes too.

Parameters:
sequence1 - First sequence.
sequence2 - Second sequence.
See Also:
initialise(), working(), recoverPalindromes()

Alignement

public Alignement(Sequence sequence1,
                  Sequence sequence2,
                  double lpmin,
                  double lbmin)
Constructor of the alignment with given lpmin.
Score matrix is initialized, reverse alignment is made and recovering of Palindromes too.

Parameters:
sequence1 - First sequence.
sequence2 - Second sequence.
lpmin - (double)Minimal length of Palindrome's to find.
lbmin - (double)Minimal length of loop's to find.
See Also:
initialise(), working(), recoverPalindromes()
Method Detail

init

public static void init()
Deprecated. Not to use in other cases...

To initiate the class for scoring. Useful for tests with Junit, because static is not reset'...

See Also:
YR, H5AA, H5GA, pairwise

getMatriceScore

public int getMatriceScore(int i,
                           int j)
To get a score at a specific position in the score matrix of reverse alignment.

Parameters:
i - (int) number of the line.
j - (int) number of the column.
Returns:
(int) Score at (i,j) / M[i,j].

getMatrice

public int[][] getMatrice()
To get the score matrix.

Returns:
int[][] 2D-table of int.

getPalindrome

public Palindrome getPalindrome(int i,
                                int j)
To get Palindrome from a score at a specific position in the matrix.

Parameters:
i - (int) number of the line.
j - (int) number of the column.
Returns:
The Palindrome with score M[i,j].
See Also:
getPalindrome(int)

getPalindrome

public Palindrome getPalindrome(int score)
To get a Palindrome with a given score.

Parameters:
score - (int)
Returns:
The Palindrome with given score.

getPalindromes

public PalindromeListe getPalindromes()
To get the PalindromeListe of Palindrome's calculating by current instance of Alignment.

Returns:
PalindromeListe

getSequence1

public Sequence getSequence1()

getSequence2

public Sequence getSequence2()

getLpmin

public static double getLpmin()

setLpmin

public static void setLpmin(double lpmin)

getLbmin

public static double getLbmin()

setLbmin

public static void setLbmin(double lbmin)

hasSameSequences

public boolean hasSameSequences()
To know if the two Sequence's reverse aligned are the same.

Returns:
boolean

equals

public boolean equals(Alignement toCompare)
To know if instance of the class and an other are the same.

Parameters:
toCompare - An other Alignment.
Returns:
boolean

initialise

private void initialise()
Initialization of the scoring matrix. Use the char sequence.
Only half is used after in recovering palindromes.

See Also:
Alignement(Sequence, Sequence), Alignement(Sequence, Sequence, double, double)

working

private void working()
Alignment work here, this is a research of Palindrome (normal and reverse sense).

See Also:
Alignement(Sequence, Sequence), Alignement(Sequence, Sequence, double, double)

recoverPalindromes

private void recoverPalindromes()
Searching for Palindrome's, only on the half of the matrix score. Positions of Palindrome's are given reporting to first sequence. Searching palindrome of minimal length of longPalindMin (3 by default) and with longBoucleMin nucleotides inside (4 by default).

See Also:
Alignement(Sequence, Sequence), Alignement(Sequence, Sequence, double, double), isGoodPalindrome(int, int, int)

isGoodPalindrome

public static boolean isGoodPalindrome(int beg,
                                       int end,
                                       int len)
To know if a palindrome has to be selected or not, with criteria of length and loop (minimal length of palindrome and loop).
Helper method for recoverPalindromes()

Parameters:
beg - (int)Beginning of palindrome.
end - (int)End of palindrome.
len - (int)Length of Palindrome
Returns:
(boolean)
See Also:
lpmin, lbmin, Algorithms.getLongPalindMin(), Algorithms.getLongBoucleMin(), Algorithms.setLongPalindMin(int), Algorithms.setLongBoucleMin(int), recoverPalindromes()

score

public static int score(char x,
                        char y)
Scoring alignment between two char of two sequences. Specific for matches in palindromes / helix in arn (U and T considered as same for easy-to-use process). Take attention of thermodynamics effects !! [Page 80-81 of the thesis, fig. 4.20]
Helper method for working()

Parameters:
x - char of first sequence.
y - char of second sequence.
Returns:
Value of match betwwen the two char's.
See Also:
working()

scoreBasic

public static int scoreBasic(char x,
                             char y)
Getting a score from two (2) bases.
No thermodynamic effects here.
T is equivalent to U
AU / UA gives 2
CG / GC gives 3
GU / UG gives 1
other combinations give 0.

Parameters:
x - (char)
y - (char)
Returns:
(int) 0 ; 1 ; 2 ; 3 .
See Also:
score(char, char)

maxInt

public static int maxInt(int[] tabInt)
To find a maximum int in a group of int (0 if group have no member).
Helper method for working()

Parameters:
tabInt - int[]
Returns:
the maximum value (0 if int[0]).
See Also:
working()