modele
Class Palindrome

java.lang.Object
  extended by modele.Palindrome
Direct Known Subclasses:
PalindromeCible, PalindromeTest

public class Palindrome
extends java.lang.Object

This class define object which are part of sequences found in auto reverse alignment and cearching structure with positive score.
Old name of this class : Palindrome1 and fusion of Palindrome1cible and Palindrome1test
Some protected methods : use in inheritant classe(s), following indications of aim of these old classe(s).

Author:
Stéfan Engelen (2006), Gabriel Chandesris (2008)

Field Summary
private  int[] carac_max
          Cible : Maximum characteristics ?
private  int[] carac_min
          Cible : Minimum characteristics ?
private  int conservationInSequences
          Cible : Number of conservation in sequences"
private  int count
          For counting each time Palindrome / Helix is present.
private  boolean indeci
          "Cible : Undecided" (default is false).
private  double longMut
          Second rate of selection.
private  int longueur
          Palindrome length.
private  int longueur1
          Test : Length of complementary reverse 5' repetition.
private  int longueur2
          Test : Length of complementary reverse 3' repetition.
private  Sequence mainSequence
          Use when checking Conservation and relevance of palindrome.
private  int nombre_palindromes
          Cible : Number of represented palindromes.
private  int nombreErreur
          Nomber of errors.
private  int nombreMutationDouble
          Nombres de Mutations Doubles (compensatoires).
private  int nombreMutationSimple
          Nombres de Mutations Simples (consistantes).
private  double pertinence
          Palindrome relevance [FR : pertinence].
private  double poid
          Palindrome weight.
private  int positionDebut
          Position of the Palindrome on sequence (begin and end).
private  int positionFin
          Position of the Palindrome on sequence (begin and end).
private  double pourcentage_conservation
          Cible : Conservation rate / percentage (default is 1).
private  int realLength
          Cible : "Real length"
private  double score
          Palindrome score (S or M[i,j]).
private  double taux
          Rate of selection.
private  int typeCritere
          Cible : criterion type (default is TAUX_MUT == 3)
 
Constructor Summary
Palindrome(int debut, int fin, int longueur)
          Short constructor with beginning, end and length of Palindrome.
Palindrome(int debut, int fin, int longueur, double score)
          The complete constructor of an Palindrome Object.
Palindrome(int debut, int fin, int longueur, int typeCritere)
          The complete constructor of a cible Palindrome.
Palindrome(int debut, int fin, int longueur, int longueur2, boolean diff)
          The complete constructor of a test Palindrome.
 
Method Summary
 void change_position_debut(int pos)
           
 void change_position_fin(int pos)
           
 void changer_carac_max(int quelle_carac, int nv_carac)
           
 void changer_carac_min(int quelle_carac, int nv_carac)
           
 void changer_conservation(int conservation)
           
 void changer_indeci(boolean b)
           
 void changer_longueur_Reelle(int longueur)
           
 void changer_longueur(int longueur)
           
 void changer_nb_pal(int nv)
           
 void changer_pourcentage_conservation(double nv)
           
 boolean chevauchant(Palindrome p)
          Deprecated. see also chevauchant(Palindrome, Palindrome) and equivalence(Palindrome, Palindrome)
static boolean chevauchant(Palindrome pal1, Palindrome pal2)
          Cible : "Following methods sorted by use order in ADN1 Class". (17)
"to know if two palindrome are crossed together"
static Palindrome[] choisir_meilleur(int nb, Palindrome[] tabpal)
          Deprecated. [unused] Calling method ADN1cible.verifier_Conservation(Palindrome1cible, Palindrome1test, double, double, int, ADN1test[]) is not maintained in OtherAlgorithmsStefan...
 void computeNumbers(Palindrome current)
          This procedure to compute compensatory and single mutations number, and errors number between a test Palindrome (current instance) and a cible Palindrome.
 Palindrome copie()
          Cible : To get a clone of the current instance of PalindromeCible.
 void countPlusPlus()
           
 boolean equals(Palindrome toCompare)
          To know if instance of the class and an other are the same.
static boolean equivalence(Palindrome helix1, Palindrome helix2)
          To know if two helix are equivalent : (helix1 in helix2) or (helix2 in helix1).
static boolean est_Compatible(Palindrome pal1, Palindrome pal2)
          Cible : "Following methods sorted by use order in ADN1 Class". (5)
"To know if two palindromes are compatibles"
After reading the code, not sure that fully correct...
 boolean est_indeci()
           
 int getCount()
           
 double getLongMut()
           
 int getNombreErreur()
           
 int getNombreMutationDouble()
           
 int getNombreMutationSimple()
           
 double getPertinence()
           
 double getPoid()
           
 int getPositionDebut()
           
 int getPositionFin()
           
 double getScore()
           
 Sequence getSequence()
           
 double getTaux()
           
 boolean inclu_dans(Palindrome p)
          Cible : "Following methods sorted by use order in ADN1 Class". (16)
"this method to know if current instance is included in argument with common pairwise "
 boolean isCompatible(Palindrome with)
           
 boolean isCompatibleWith(Palindrome other)
          Deprecated. not exact... (see tests)
 boolean isScore(int score)
          To check if current Palindrome has a given score.
 boolean isSelected(int Lmin)
          Deprecated. DCFold => PDCFold
 boolean isSelectedCible(double Lmin, double Stest, boolean conservation)
          For selection of Palindrome cible, if conservation is true : equation 4.11, else 4.12.
 boolean isSelectedTest(double Lmin)
          For selection of Palindrome test.
 int length()
          Length of the current instance of Palindrome.
 void nbErreursPlusPlus()
           
 void nbMutDoublePlusPlus()
           
 void nbMutSimplePlusPlus()
           
 int nombre_sequence_conserve()
           
 double quel_critere()
           
 int quel_nb_pal()
           
 double quel_pourcentage_conservation()
           
 int quel_type_critere()
           
 int quelle_carac_max(int i)
           
 int quelle_carac_min(int i)
           
 int quelle_longueur_reelle()
           
 int quelle_longueur1()
           
 int quelle_longueur2()
           
 int quelle_position_debut()
           
 int quelle_position_fin()
           
 int rechercher_approx(java.util.Vector tabPal)
          Deprecated. see also PalindromeListe.rechercher_approx(Palindrome) and PalindromeListe.whichPositionApprox(Palindrome)
 int rechercher(java.util.Vector tabPal)
          Deprecated. see also PalindromeListe.rechercher(Palindrome) and PalindromeListe.whichPosition(Palindrome)
static boolean rssh(Palindrome helix1, Palindrome helix2)
          To know if on two helix (Palindrome here), the second is included into the first.
 void setCountZero()
           
protected  void setLength(int length)
           
 void setLongMut(double longMut)
           
 void setNombreErreur(int nombreErreur)
           
 void setNombreMutationDouble(int nombreMutationDouble)
           
 void setNombreMutationSimple(int nombreMutationSimple)
           
 void setPertinence(double pertinence)
           
 void setPoid(double poid)
           
protected  void setPositionDebut(int positionDebut)
           
protected  void setPositionFin(int positionFin)
           
 void setScore(double score)
           
 void setSequence(Sequence mainSequence)
           
 void setTaux(double taux)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longueur

private int longueur
Palindrome length.


positionDebut

private int positionDebut
Position of the Palindrome on sequence (begin and end).


positionFin

private int positionFin
Position of the Palindrome on sequence (begin and end).


nombreMutationDouble

private int nombreMutationDouble
Nombres de Mutations Doubles (compensatoires).


nombreMutationSimple

private int nombreMutationSimple
Nombres de Mutations Simples (consistantes).


nombreErreur

private int nombreErreur
Nomber of errors.


score

private double score
Palindrome score (S or M[i,j]).


poid

private double poid
Palindrome weight.
Pcible = M[i][j]/(2*longueur) and >= Lmin and althought LongMut*Pcible >= 2*Lmin
thesis page 82 equations 4.4, 4.5 and 4.6
Ptest = Score/2*Lmin
thesis page 85 equations 4.7 and 4.8

See Also:
longMut, Palindrome(int, int, int), Palindrome(int, int, int, double), isSelectedTest(double), isSelectedCible(double, double, boolean)

pertinence

private double pertinence
Palindrome relevance [FR : pertinence].
(this.longMut*this.poid*Stest)
LongMut = N + L (>= 2*Lmin)
thesis page 87 equation 4.10

See Also:
isSelectedCible(double, double, boolean)

taux

private double taux
Rate of selection.
N = 2*Ncomp + Ncons - Nerr
Taux = N/L ; Taux >= 1
see thesis page 86 equation 4.9 :

See Also:
isSelectedCible(double, double, boolean)

longMut

private double longMut
Second rate of selection.

See Also:
pertinence, isSelectedCible(double, double, boolean)

mainSequence

private Sequence mainSequence
Use when checking Conservation and relevance of palindrome.

See Also:
Alignement.recoverPalindromes()

count

private int count
For counting each time Palindrome / Helix is present.

See Also:
Algorithms.commonPrediction(Sequence, SequenceListe[])

realLength

private int realLength
Cible : "Real length"


carac_max

private int[] carac_max
Cible : Maximum characteristics ?


carac_min

private int[] carac_min
Cible : Minimum characteristics ?


nombre_palindromes

private int nombre_palindromes
Cible : Number of represented palindromes.


conservationInSequences

private int conservationInSequences
Cible : Number of conservation in sequences"


indeci

private boolean indeci
"Cible : Undecided" (default is false).


pourcentage_conservation

private double pourcentage_conservation
Cible : Conservation rate / percentage (default is 1).


typeCritere

private int typeCritere
Cible : criterion type (default is TAUX_MUT == 3)


longueur1

private int longueur1
Test : Length of complementary reverse 5' repetition.


longueur2

private int longueur2
Test : Length of complementary reverse 3' repetition.

Constructor Detail

Palindrome

public Palindrome(int debut,
                  int fin,
                  int longueur)
Short constructor with beginning, end and length of Palindrome.
Sometimes for cible Palindrome.

Parameters:
debut - (int) begin
fin - (int) end
longueur - (int) length
See Also:
setPoid(double)

Palindrome

public Palindrome(int debut,
                  int fin,
                  int longueur,
                  double score)
The complete constructor of an Palindrome Object. (begin,end,length,score). And proceed weight.

Parameters:
debut - (int) begin
fin - (int) end
longueur - (int) length
score - (double) ( == Alignement#matrice[i][j])
See Also:
Alignement.recoverPalindromes()

Palindrome

public Palindrome(int debut,
                  int fin,
                  int longueur,
                  int typeCritere)
The complete constructor of a cible Palindrome. (begin,end,length,criterion type).

Parameters:
debut - (int) begin
fin - (int) end
longueur - (int) length
typeCritere - (int) criterion type
See Also:
Alignement.recoverPalindromes()

Palindrome

public Palindrome(int debut,
                  int fin,
                  int longueur,
                  int longueur2,
                  boolean diff)
The complete constructor of a test Palindrome. (begin,end,length,length2).

Parameters:
debut - (int) begin
fin - (int) end
longueur - (int) length
longueur2 - (int) length2
diff - (boolean) [not used, just to make difference with Palindrome(int, int, int, int)]
See Also:
Alignement.recoverPalindromes()
Method Detail

length

public int length()
Length of the current instance of Palindrome.

Returns:
int

getPositionDebut

public int getPositionDebut()

getPositionFin

public int getPositionFin()

getNombreMutationSimple

public int getNombreMutationSimple()

getNombreMutationDouble

public int getNombreMutationDouble()

getNombreErreur

public int getNombreErreur()

getPoid

public double getPoid()

getPertinence

public double getPertinence()

getTaux

public double getTaux()

setTaux

public void setTaux(double taux)

getLongMut

public double getLongMut()

setLongMut

public void setLongMut(double longMut)

setPositionDebut

protected void setPositionDebut(int positionDebut)

setPositionFin

protected void setPositionFin(int positionFin)

setLength

protected void setLength(int length)

setNombreMutationSimple

public void setNombreMutationSimple(int nombreMutationSimple)

setNombreMutationDouble

public void setNombreMutationDouble(int nombreMutationDouble)

setNombreErreur

public void setNombreErreur(int nombreErreur)

setPoid

public void setPoid(double poid)

setPertinence

public void setPertinence(double pertinence)

getSequence

public Sequence getSequence()

setSequence

public void setSequence(Sequence mainSequence)

getScore

public double getScore()

setScore

public void setScore(double score)

nbMutDoublePlusPlus

public void nbMutDoublePlusPlus()

nbMutSimplePlusPlus

public void nbMutSimplePlusPlus()

nbErreursPlusPlus

public void nbErreursPlusPlus()

isSelected

public boolean isSelected(int Lmin)
Deprecated. DCFold => PDCFold

Covariation criteria.
[DCFold]see thesis page 61 equations 4.2 and 4.3
[DCFold]see thesis page 82 equations 4.5 then 4.6 and explanation

Parameters:
Lmin - The value to compare with (int).
Returns:
boolean

isSelectedTest

public boolean isSelectedTest(double Lmin)
For selection of Palindrome test.

Parameters:
Lmin - The value to Compute with (double)
Returns:
boolean
See Also:
Algorithms.checkConservation(Palindrome, SequenceListe, int)

isSelectedCible

public boolean isSelectedCible(double Lmin,
                               double Stest,
                               boolean conservation)
For selection of Palindrome cible, if conservation is true : equation 4.11, else 4.12.

Parameters:
Lmin - (double) The value to compare with
Stest - (int) Score Average of tests palindromes
conservation - (boolean)
Returns:
boolean
See Also:
Algorithms.searchAnchorPoints(modele.Sequence, modele.Alignement, double, modele.SequenceListe, int, int), computeNumbers(Palindrome)

isScore

public boolean isScore(int score)
To check if current Palindrome has a given score.

Parameters:
score - The score to test (int).
Returns:
boolean

isCompatibleWith

public boolean isCompatibleWith(Palindrome other)
Deprecated. not exact... (see tests)

Procedure to know if two palindromes are compatible or not.

Parameters:
other - PalindromeCible
See Also:
Algorithms.compatibilityTreatment(modele.PalindromeListe), isCompatible(Palindrome)

isCompatible

public boolean isCompatible(Palindrome with)

computeNumbers

public void computeNumbers(Palindrome current)
This procedure to compute compensatory and single mutations number, and errors number between a test Palindrome (current instance) and a cible Palindrome.

Parameters:
current - One Palindrome of cible Sequence.
See Also:
Algorithms.searchAnchorPoints(modele.Sequence, modele.Alignement, double, modele.SequenceListe, int, int), Algorithms.checkConservation(modele.Palindrome, modele.SequenceListe, int)

getCount

public int getCount()

setCountZero

public void setCountZero()

countPlusPlus

public void countPlusPlus()

equals

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

Parameters:
toCompare - An other Palindrome.
Returns:
boolean

rssh

public static boolean rssh(Palindrome helix1,
                           Palindrome helix2)
To know if on two helix (Palindrome here), the second is included into the first. (test if helix2 is in helix1).
(see thesis page 171 definition 21)

Parameters:
helix1 - First Palindrome
helix2 - Second Palindrome
Returns:
boolean
See Also:
Algorithms.commonPrediction(Sequence, SequenceListe[]).

equivalence

public static boolean equivalence(Palindrome helix1,
                                  Palindrome helix2)
To know if two helix are equivalent : (helix1 in helix2) or (helix2 in helix1).

Parameters:
helix1 - Palindrome
helix2 - Palindrome
Returns:
boolean
See Also:
Algorithms.commonPrediction(Sequence, SequenceListe[])., rssh(Palindrome, Palindrome)

quelle_position_debut

public int quelle_position_debut()

quelle_position_fin

public int quelle_position_fin()

quelle_longueur_reelle

public int quelle_longueur_reelle()

quel_pourcentage_conservation

public double quel_pourcentage_conservation()

est_indeci

public boolean est_indeci()

quelle_carac_max

public int quelle_carac_max(int i)

quelle_carac_min

public int quelle_carac_min(int i)

quel_nb_pal

public int quel_nb_pal()

quel_type_critere

public int quel_type_critere()

quel_critere

public double quel_critere()

change_position_debut

public void change_position_debut(int pos)

change_position_fin

public void change_position_fin(int pos)

changer_longueur

public void changer_longueur(int longueur)

changer_longueur_Reelle

public void changer_longueur_Reelle(int longueur)

changer_pourcentage_conservation

public void changer_pourcentage_conservation(double nv)

changer_indeci

public void changer_indeci(boolean b)

changer_carac_max

public void changer_carac_max(int quelle_carac,
                              int nv_carac)

changer_carac_min

public void changer_carac_min(int quelle_carac,
                              int nv_carac)

changer_nb_pal

public void changer_nb_pal(int nv)

est_Compatible

public static boolean est_Compatible(Palindrome pal1,
                                     Palindrome pal2)
Cible : "Following methods sorted by use order in ADN1 Class". (5)
"To know if two palindromes are compatibles"
After reading the code, not sure that fully correct...

Parameters:
pal1 - (Palindrome1cible)
pal2 - (Palindrome1cible)
Returns:
(boolean) compatible or not
See Also:
OtherAlgorithmsStefan.incompatibilite_plusieurs_choix(PalindromeListeListe, int, int, int, double, boolean, int), OtherAlgorithmsStefan.incompatibilite_un_choix(Palindrome[], int, int), AlgorithmsStefan.incompatibilite_plusieurs_choix(PalindromeListeListe, int, int, int, double, boolean, int), AlgorithmsStefan.incompatibilite_un_choix(Palindrome[], int, int), isCompatible(Palindrome)

inclu_dans

public boolean inclu_dans(Palindrome p)
Cible : "Following methods sorted by use order in ADN1 Class". (16)
"this method to know if current instance is included in argument with common pairwise "

Parameters:
p - (Palindrome)
Returns:
(boolean)
See Also:
PalindromeListe.rechercher_approx(Palindrome), OtherAlgorithmsStefan.incompatibilite_plusieurs_choix(PalindromeListeListe, int, int, int, double, boolean, int), OtherAlgorithmsStefan.incompatibilite_un_choix(Palindrome[], int, int), OtherAlgorithmsStefan.palindromes_communs(Palindrome[], Palindrome[], boolean), XXX ??deprecated?? see also {@linkplain Palindrome#rssh(Palindrome, Palindrome)}

chevauchant

public boolean chevauchant(Palindrome p)
Deprecated. see also chevauchant(Palindrome, Palindrome) and equivalence(Palindrome, Palindrome)

Cible : "Following methods sorted by use order in ADN1 Class". (17)
"to know if two palindrome are crossed together"

Parameters:
p - (Palindrome)
Returns:
(boolean)
See Also:
AlgorithmsStefan.resultat_commun(PalindromeListeListe)

chevauchant

public static boolean chevauchant(Palindrome pal1,
                                  Palindrome pal2)
Cible : "Following methods sorted by use order in ADN1 Class". (17)
"to know if two palindrome are crossed together"

Parameters:
pal1 - (Palindrome)
pal2 - (Palindrome)
Returns:
(boolean)
See Also:
OtherAlgorithmsStefan.resultat_commun(PalindromeListeListe), AlgorithmsStefan.resultat_commun(PalindromeListeListe), equivalence(Palindrome, Palindrome)

rechercher

public int rechercher(java.util.Vector tabPal)
Deprecated. see also PalindromeListe.rechercher(Palindrome) and PalindromeListe.whichPosition(Palindrome)

Cible : "Following methods sorted by use order in ADN1 Class". (14)
"to find a palindrome in a Vector of palindromes"

Parameters:
tabPal - (Vector)
Returns:
(int) position
See Also:
OtherAlgorithmsStefan.resultat_commun(PalindromeListeListe), AlgorithmsStefan.resultat_commun(PalindromeListeListe)

rechercher_approx

public int rechercher_approx(java.util.Vector tabPal)
Deprecated. see also PalindromeListe.rechercher_approx(Palindrome) and PalindromeListe.whichPositionApprox(Palindrome)

Cible : "Following methods sorted by use order in ADN1 Class". (15)
"to find an approximate palindrome in a vector of palindromes."

Parameters:
tabPal - (Vector)
Returns:
(int) position
See Also:
OtherAlgorithmsStefan.resultat_commun(PalindromeListeListe), AlgorithmsStefan.resultat_commun(PalindromeListeListe)

copie

public Palindrome copie()
Cible : To get a clone of the current instance of PalindromeCible.

Returns:
(Palindrome1cible)
See Also:
OtherAlgorithmsStefan.computing(SequenceListe[], Sequence, boolean, boolean), AlgorithmsStefan.computing(SequenceListe[], Sequence, boolean, boolean)

changer_conservation

public void changer_conservation(int conservation)

nombre_sequence_conserve

public int nombre_sequence_conserve()

quelle_longueur1

public int quelle_longueur1()

quelle_longueur2

public int quelle_longueur2()

choisir_meilleur

public static Palindrome[] choisir_meilleur(int nb,
                                            Palindrome[] tabpal)
Deprecated. [unused] Calling method ADN1cible.verifier_Conservation(Palindrome1cible, Palindrome1test, double, double, int, ADN1test[]) is not maintained in OtherAlgorithmsStefan...

Test : "This method choose the best _nb_ test palindromes"

Parameters:
nb - (int) number of palindrome to choose
tabpal - (Palindromes1test[])
Returns:
(Palindrome1tets[])
See Also:
ADN1cible.verifier_Conservation(Palindrome1cible, Palindrome1test, double, double, int, ADN1test[])