NucleotidSequences
Date: 2014-08-08

melting.sequences

## Class NucleotidSequences

- java.lang.Object
- - melting.sequences.NucleotidSequences

-     public class NucleotidSequences
      extends java.lang.Object

  This class represents a pair of nucleic acid sequences. It encodes and decodes them, recognizes patterns and provides general purpose sequence manipulation methods. The instance variables are : ArrayList duplex : an ArrayList containing the sorted BasePair objects. String sequence : the sequence (5'3') represented by a String. String complementary : the complementary sequence (3'5') represented by a String. NucleotidSequences rnaEquivalent : the NucleotidSequences object which represents this NucleotidSequences object with RNA sequences NucleotidSequences dnaEquivalent : the NucleotidSequences object which represents this NucleotidSequences object with DNA sequences HashMap modifiedAcidNames : a Map which makes a link between the encoded specific nucleic acid in the String and the matching SpecificAcidNames enum value.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `NucleotidSequences(java.lang.String hybridizationType, NucleotidSequences sequences)` Creates a new NucleotidSequences object from a reference nucleotiDSequences object.
    `` | `NucleotidSequences(java.lang.String sequence, java.lang.String complementary)` Creates a NucleotidSequences object from two String.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static NucleotidSequences` | `buildSymetricSequences(java.lang.String seq1, java.lang.String seq2)` creates a NucleotidSequences with two symmetric sequences String created from the seq1 String an seq2 String.
    `double` | `calculateNumberOfTerminal(java.lang.String base1, java.lang.String base2, int pos1, int pos2)` calculates the number of base pairs (base1, base2) at the postions pos1 and pos2 in the duplex of NucleotidSequences.
    `static boolean` | `checkSequence(java.lang.String sequence)` Checks if the String sequence is composed of nucleic acids known by MELTING.
    `int` | `computesInternalLoopLength(int pos1, int pos2)` computes the number of nucleic acids in the internal loop between the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
    `double` | `computesPercentGC()` computes the percentage of GC base pairs in the duplex of NucleotidSequences.
    `double` | `computesPercentMismatching()` Computes the percentage of mismatching base pairs in the duplex of NucleotidSequences.
    `static java.lang.String` | `convertToPyr_Pur(java.lang.String sequence)` converts a sequence into a String composed of purine and pyrimidine.
    `java.lang.String[]` | `correctSequences(java.lang.String sequence, java.lang.String complementary)` removes the unnecessary "-" in the String sequence and complementary of NucleotidSequences.
    `static java.lang.String[]` | `decodeSequences(java.lang.String sequence, java.lang.String complementary)` decodes the String sequence and complementary of NucleotidSequences.
    `java.lang.String[]` | `encodeSequences(java.lang.String sequence, java.lang.String complementary)` encodes the String sequence and complementary of the NucleotidSequences object.
    `java.lang.String` | `getComplementary()` This method is called to get the encoded complementary String of NucleotidSequences.
    `java.lang.String` | `getComplementary(int pos1, int pos2)` This method is called to get a substring between two positions of the complementary String.
    `java.lang.String` | `getComplementary(int pos1, int pos2, java.lang.String hybridizationType)` This method is called to get a substring of the complementary String between the positions pos1 and pos2 in the duplex.
    `java.lang.String` | `getComplementaryNNPair(int pos)` to get the two nucleic acids which are from the complementary sequence (3'5') in the Crick's pair at the position "pos" in the duplex.
    `java.lang.String` | `getComplementaryNNPairUnlocked(int pos)` to get the two unlocked nucleic acids which are from the complementary sequence (3'5') in the Crick's pair at the position "pos" in the duplex.
    `static java.lang.String` | `getComplementarySequence(java.lang.String sequence, java.lang.String hybridization)` This method is called when we want to get the complementary of NucleotidSequences with the type of hybridization "hybridization".
    `java.lang.String` | `getComplementaryTo(java.lang.String sequence, int pos1, int pos2)` This method is called to get the complementary sequence to the sequence String between the positions pos1 and pos2.
    `static java.lang.String` | `getDanglingSens(java.lang.String seq1, java.lang.String seq2)` this method is called to get the sens of the dangling end for the sequences seq1 and seq2
    `java.util.ArrayList<BasePair>` | `getDuplex()` This method is called to get the duplex of NucleotidSequences.
    `static java.util.ArrayList<BasePair>` | `getDuplexFrom(java.lang.String sequence, java.lang.String complementary)` This method is called to get the duplex of NucleotidSequences.
    `int` | `getDuplexLength()` This method is called to get the length of the ArrayList duplex of NucleotidSequences.
    `NucleotidSequences` | `getEquivalentSequences(java.lang.String hybridizationType)` This method is called when the same NucleotidSequences is required but with the sequences converted in the new hybridization type "hybridizationType"
    `java.lang.String` | `getInternalLoopType(int pos1, int pos2)` gives the type of the internal loop at the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
    `static java.lang.String` | `getInversedSequence(java.lang.String sequence)` creates the inverse String of the sequence
    `java.lang.String[]` | `getLoopFistMismatch(int pos1)` This method is called to get the first mismatch of the internal loop at the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
    `SpecificAcidNames` | `getModifiedAcidName(BasePair pair)` This method is called to get the name of a specific nucleic acid in the base pair (BasePair object).
    `static java.util.HashMap<java.lang.String,SpecificAcidNames>` | `getModifiedAcidNames()` This method is called to get the modifiedAcidNames of NucleotidSequences.
    `java.lang.String[]` | `getNNPairWithoutHydroxyA(int pos)` to get the two nucleic acids from each sequence in the Crick's pair at the position "pos" in the duplex.
    `double` | `getNumberTerminal5TA(int pos1, int pos2)` calculates the number of terminal 5'T3'A in the subduplex between pos1 and pos2
    `java.lang.String` | `getSequence()` This method is called to get the encoded sequence String of NucleotidSequences.
    `java.lang.String` | `getSequence(int pos1, int pos2)` This method is called to get a substring between two positions of the sequence String.
    `java.lang.String` | `getSequence(int pos1, int pos2, java.lang.String hybridizationType)` This method is called to get a substring of the sequence String between the positions pos1 and pos2 in the duplex.
    `java.lang.String` | `getSequenceContaining(java.lang.String pattern, int pos1, int pos2)` this method is called to get the String sequence or complementary of NucleotidSequences.
    `java.lang.String` | `getSequenceNNPair(int pos)` to get the two nucleic acids which are from the sequence (5'3') in the Crick's pair at the position "pos" in the duplex.
    `java.lang.String` | `getSequenceNNPairUnlocked(int pos)` to get the two unlocked nucleic acids which are from the sequence (5'3') in the Crick's pair at the position "pos" in the duplex.
    `java.lang.String` | `getSequenceSens(java.lang.String sequence, int pos1, int pos2)` To get the orientation of the subsequence sequence.
    `java.lang.String[]` | `getSingleBulgeNeighbors(int pos1)` This method is called to get the base pairs adjacent to the single bulge loop (unpaired nucleic acid) at the position pos1 in the duplex ArrayList
    `static void` | `initialiseModifiedAcidHashmap()` initialises the modifiedAcidNames of NucleotidSequences.
    `boolean` | `isAPyrimidineInThePosition(int pos)` to check if there is at least one pyrimidine in the base pair at the position pos of the duplex ArrayList.
    `boolean` | `isAsymetricInternalLoop(int pos1, int pos2)` to check if the internal loop between the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList is asymetric.
    `boolean` | `isBasePair(java.lang.String base1, java.lang.String base2, int pos)` To check if the base pair at the position pos in the duplex is (base1, base2) or (base2, base1).
    `boolean` | `isBulgeLoop(int pos1, int pos2)` to check if the pattern between the positions pos1 and pos2 in the duplex is a single or long bulge loop.
    `boolean` | `isCNGPattern(int pos1, int pos2)` to check if the pattern between the positions pos1 and pos2 in the duplex is a CNG repeat pattern.
    `boolean` | `isDanglingEnd(int pos1, int pos2)` to check if there is at least one dangling end between the positions pos1 and pos2 in the duplex.
    `boolean` | `isGUSequences(int pos1, int pos2)` to check if the pattern between the positions pos1 and pos2 in the duplex is only composed of GU base pairs.
    `boolean` | `isMismatch(int pos1, int pos2)` to check if the pattern between the positions pos1 and pos2 in the duplex is a single mismatch, tandem mismatch or internal loop.
    `boolean` | `isMismatchPair(int pos)` to check if the base pair at the position pos in the duplex is a mismatch.
    `boolean` | `isNoGapInSequence(int pos1, int pos2)` to chack if there is no gap (an unpaired nucleic acid) in the duplex between theb positions pos1 and pos2
    `boolean` | `isOneGCBasePair()` To check if there is at least one GC base pair in the duplex of NucleotidSequences.
    `boolean` | `isPerfectMatchSequence(int pos1, int pos2)` to check to check if the sequences between the positions pos1 and pos2 in the duplex are perfectly matching sequences.
    `boolean` | `isRegisteredNucleicAcid(int pos)` to check if the nucleic acids in the base pair at the position pos in the duplex are existing nucleic acids.
    `static boolean` | `isSelfComplementarySequence(java.lang.String sequence)` To check if a sequence is self complementary.
    `boolean` | `isSymmetric(int pos1, int pos2)` To check if the String sequence and String complementary are symmetric between the positions pos1 and pos2 in the duplex ArrayList of the NucleotidSequences object.
    `boolean` | `isTandemMismatchDeltaPPenaltyNecessary(int pos)` to check if there is an AG or GA base pair adjacent to an UC or CU base pair or a CC base pair adjacent to an AA base pair.
    `boolean` | `isTandemMismatchGGPenaltyNecessary(int pos)` To check if there is a GG base pair adjacent to a AA base pair or a base pair containing a pyrimidine ("C", "T" or "U").
    `int[]` | `removeTerminalUnpairedNucleotides()` find the real starting and ending positions of the duplex.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NucleotidSequences

          public NucleotidSequences(java.lang.String sequence,
                            java.lang.String complementary)

      Creates a NucleotidSequences object from two String.
      Parameters:
        `sequence` - : the sequence (5'3')
        `complementary` - : the complementary sequence (3'5')

    - #### NucleotidSequences

          protected NucleotidSequences(java.lang.String hybridizationType,
                            NucleotidSequences sequences)

      Creates a new NucleotidSequences object from a reference nucleotiDSequences object. The sequences are converted in the hybridization type "hybridization type". the rnaEquivalent or dnaEquivalent object of the reference NucleotidSequences object are initialised.
      Parameters:
        `hybridizationType` - : hybridization type of the duplex.
        `sequences` - : the reference nucleotidSequences object.

  - ### Method Detail

    - #### getEquivalentSequences

          public NucleotidSequences getEquivalentSequences(java.lang.String hybridizationType)

      This method is called when the same NucleotidSequences is required but with the sequences converted in the new hybridization type "hybridizationType"
      Parameters:
        `hybridizationType` - : the new hybridization type of the sequences
      Returns:
        the initialised object rnaEquivalent if the hybridization type is "rna" or the initialised object dnaEquivalent if the hybridization type is "dna". If the String hybridization is neither "dna" nor "rna", a SequenceException is thrown.

    - #### encodeSequences

          public java.lang.String[] encodeSequences(java.lang.String sequence,
                                           java.lang.String complementary)

      encodes the String sequence and complementary of the NucleotidSequences object.
      Parameters:
        `sequence` - : the sequence (5'3')
        `complementary` - : the complementary sequence (3'5')
      Returns:
        a String [] which contains the encoded String sequence and complementary of NucleotidSequences.

    - #### correctSequences

          public java.lang.String[] correctSequences(java.lang.String sequence,
                                            java.lang.String complementary)

      removes the unnecessary "-" in the String sequence and complementary of NucleotidSequences.
      Parameters:
        `sequence` - : the sequence (5'3')
        `complementary` - : the complementary sequence (3'5')
      Returns:
        a String [] which contains the String sequence and complementary without unnecessary gaps ("-")

    - #### getComplementaryTo

          public java.lang.String getComplementaryTo(java.lang.String sequence,
                                            int pos1,
                                            int pos2)

      This method is called to get the complementary sequence to the sequence String between the positions pos1 and pos2.
      Parameters:
        `sequence` - : substring of one of the sequences (sequence 5'3' or the complementary 3'5')
        `pos1` - : starting position of the subsequence in the duplex
        `pos2` - : ending position of the subsequence in the duplex
      Returns:
        the substring between pos1 and pos2 which is the complementary to the sequence String. If the sequence String is neither a substring of the sequence of NucleotidSequences., nor a substring of the complementary of NucleotidSequences., a SequenceException is thrown.

    - #### getSequenceContaining

          public java.lang.String getSequenceContaining(java.lang.String pattern,
                                               int pos1,
                                               int pos2)

      this method is called to get the String sequence or complementary of NucleotidSequences. which contains the pattern "pattern".
      Parameters:
        `pattern` -
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        the complementary String or the sequence String, depending on which of them contains the pattern "pattern" between the positions pos1 and pos2. It returns null if neither the sequence String, nor the complementary String contains the pattern "pattern" between pos1 and pos2.

    - #### isCNGPattern

          public boolean isCNGPattern(int pos1,
                             int pos2)

      to check if the pattern between the positions pos1 and pos2 in the duplex is a CNG repeat pattern. A CNG repeat pattern is when the total sequence String is G(CNG)xC where N is a mismatch (N,N) and x is the number of CNG repeats in the sequence String.
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if the pattern between the positions pos1 and pos2 in the duplex is a CNG repeat pattern.

    - #### isPerfectMatchSequence

          public boolean isPerfectMatchSequence(int pos1,
                                       int pos2)

      to check to check if the sequences between the positions pos1 and pos2 in the duplex are perfectly matching sequences. Two sequences are perfectly matching sequences when all the nucleic acids of each strand are paired with their complementary base pair.
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if the sequences between the positions pos1 and pos2 are perfectly matching sequences.

    - #### isDanglingEnd

          public boolean isDanglingEnd(int pos1,
                              int pos2)

      to check if there is at least one dangling end between the positions pos1 and pos2 in the duplex. A dangling end is when a terminal nucleic acid is un paired.
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if there is at least one dangling end between the positions pos1 and pos2 in the duplex

    - #### isGUSequences

          public boolean isGUSequences(int pos1,
                              int pos2)

      to check if the pattern between the positions pos1 and pos2 in the duplex is only composed of GU base pairs.
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if the pattern between the positions pos1 and pos2 in the duplex is only composed of GU base pairs.

    - #### isMismatchPair

          public boolean isMismatchPair(int pos)

      to check if the base pair at the position pos in the duplex is a mismatch. A mismatch is when the bases int the base pair (A, T, G, C or U) are not complementary base pairs.
      Parameters:
        `pos` - : the position of the base pair to test in the duplex ArrayList
      Returns:
        true if the base pair at the positions pos in the duplex is a mismatch.

    - #### isMismatch

          public boolean isMismatch(int pos1,
                           int pos2)

      to check if the pattern between the positions pos1 and pos2 in the duplex is a single mismatch, tandem mismatch or internal loop. There is an internal loop when all the base pairs in the duplex are not complementary. if there are gaps in the sequences, if no one of the sequences is only composed of gaps (-) between the positions pos1 and pos2 in the duplex, there is also an internal loop (but asymmetric).
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if the pattern between the positions pos1 and pos2 in the duplex is a single mismatch, a tandem mismatch or an internal loop. Ex : (A, G) is a single mismatch (AC, CC) is a tandem mismatch (ACGTGC, CCTCAT) is a symmetric internal loop (ACGTGC, CC-CAT) is an asymmetric internal loop

    - #### isBulgeLoop

          public boolean isBulgeLoop(int pos1,
                            int pos2)

      to check if the pattern between the positions pos1 and pos2 in the duplex is a single or long bulge loop. There is an bulge loop when one of the strands is only composed of gaps (-) between the positions pos1 and pos2 int the duplex.
      Parameters:
        `pos1` - : starting position of the pattern in the duplex
        `pos2` - : ending position of the pattern in the duplex
      Returns:
        true if the pattern between the positions pos1 and pos2 in the duplex is a single or long bulge loop. Ex : (T, -) is a single bulge loop (this base pair is not a terminal base pair, otherwise it is a dangling end) (ACT, ---) is a long bulge loop

    - #### isRegisteredNucleicAcid

          public boolean isRegisteredNucleicAcid(int pos)

      to check if the nucleic acids in the base pair at the position pos in the duplex are existing nucleic acids. (exist in the existingNucleicAcids of BasePair)
      Parameters:
        `pos` - : position of the nucleic acid in the duplex
      Returns:
        true if the two nucleic acids are known by MELTING.

    - #### getModifiedAcidName

          public SpecificAcidNames getModifiedAcidName(BasePair pair)

      This method is called to get the name of a specific nucleic acid in the base pair (BasePair object).
      Parameters:
        `pair` -
      Returns:
        the SpecificAcidNames enum which represents the name of the specific nucleic acid in the base pair.

    - #### isAPyrimidineInThePosition

          public boolean isAPyrimidineInThePosition(int pos)

      to check if there is at least one pyrimidine in the base pair at the position pos of the duplex ArrayList.
      Parameters:
        `pos` - : position of the base pair in the duplex
      Returns:
        true if the TopAcid String is a pyrimidine ("C", "T" or "U") or if the BottomAcid String is a pyrimidine.

    - #### isTandemMismatchGGPenaltyNecessary

          public boolean isTandemMismatchGGPenaltyNecessary(int pos)

      To check if there is a GG base pair adjacent to a AA base pair or a base pair containing a pyrimidine ("C", "T" or "U").
      Parameters:
        `pos` - : position of the Crick' pair in the duplex
      Returns:
        true if there is a GG base pair adjacent to a AA base pair or a base pair containing a pyrimidine ("C", "T" or "U").

    - #### isTandemMismatchDeltaPPenaltyNecessary

          public boolean isTandemMismatchDeltaPPenaltyNecessary(int pos)

      to check if there is an AG or GA base pair adjacent to an UC or CU base pair or a CC base pair adjacent to an AA base pair.
      Parameters:
        `pos` - : positions of the Crick's pair in the duplex
      Returns:
        true if there is an AG or GA base pair adjacent to an UC or CU base pair or a CC base pair adjacent to an AA base pair.

    - #### isNoGapInSequence

          public boolean isNoGapInSequence(int pos1,
                                  int pos2)

      to chack if there is no gap (an unpaired nucleic acid) in the duplex between theb positions pos1 and pos2
      Parameters:
        `pos1` - : starting position of the subsequence in the duplex
        `pos2` - : ending position of the subsequence in the duplex
      Returns:
        false if one of the sequences composing the duplex contains at least one gap ("-") between the positions pos1 and pos2

    - #### isSymmetric

          public boolean isSymmetric(int pos1,
                            int pos2)

      To check if the String sequence and String complementary are symmetric between the positions pos1 and pos2 in the duplex ArrayList of the NucleotidSequences object. The two sequences are symmetric if the inverse of one of them is equal to the other.
      Parameters:
        `pos1` - : starting position of the subduplex in the duplex ArrayList of NucleotidSequences object.
        `pos2` - : ending position of the subduplex in the duplex ArrayList of NucleotidSequences object.
      Returns:
        true if the String sequence and the String complementary are symmetric between the positions pos1 and pos2 in the duplex.

    - #### getInternalLoopType

          public java.lang.String getInternalLoopType(int pos1,
                                             int pos2)

      gives the type of the internal loop at the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
      Parameters:
        `pos1` - : position preceding the starting position of the internal loop
        `pos2` - : position following the ending position of the internal loop
      Returns:
        String type of the internal loop at the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList. The type of the internal loop is determined by the number of nucleic acids from the sequence String which are included in the internaql loop and the number of nucleic acids from the complementary String which are included in the internaql loop Ex of type of internal loop : "1x2", "2x3", "4x4", ....

    - #### getLoopFistMismatch

          public java.lang.String[] getLoopFistMismatch(int pos1)

      This method is called to get the first mismatch of the internal loop at the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
      Parameters:
        `pos1` - : the position preceding the internal loop.
      Returns:
        String [] containing the first Crick's pair of the internal loop at the positions pos1 + 1 and pos2 - 1. The nucleic acids in the first base pair of the crick's pair are converted into purine or pyrimidine. this returned String [] contains the nucleic acids from the sequence String (5'3') and the nucleic acids from the complementary String (3'5'). Ex : internal loop : (ATTGCC, TGCGCG) The first Crick's pair in the loop : (AT, TG) The first msimatch in the loop : (T, G) String [] first mismatch => {RT, YG}

    - #### getSingleBulgeNeighbors

          public java.lang.String[] getSingleBulgeNeighbors(int pos1)

      This method is called to get the base pairs adjacent to the single bulge loop (unpaired nucleic acid) at the position pos1 in the duplex ArrayList
      Parameters:
        `pos1` - : position preceding the unpaired nucleic acid in the single bulge loop.
      Returns:
        String [] containing the nucleic acids adjacent to the bulge loop from the sequence String (5'3') and the nucleic acids adjacent to the bulge loop from the complementary String (5'3')

    - #### isAsymetricInternalLoop

          public boolean isAsymetricInternalLoop(int pos1,
                                        int pos2)

      to check if the internal loop between the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList is asymetric. An internal loop is asymetric if one of the strands contains gap(s).
      Parameters:
        `pos1` - : position preceding the starting position of the internal loop
        `pos2` - : position following the ending position of the internal loop
      Returns:
        true if the internal loop between the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList is asymetric.

    - #### getSequence

          public java.lang.String getSequence(int pos1,
                                     int pos2,
                                     java.lang.String hybridizationType)

      This method is called to get a substring of the sequence String between the positions pos1 and pos2 in the duplex. This substring is converted in the type precised by the hybridizationType String.
      Parameters:
        `pos1` - : starting position of the subsequence
        `pos2` - : ending position of the subsequence
        `hybridizationType` - : type of sequence ("dna" or "rna")
      Returns:
        substring of the sequence String between pos1 and pos2 in the new type precised by the hybridizationType String

    - #### getComplementary

          public java.lang.String getComplementary(int pos1,
                                          int pos2,
                                          java.lang.String hybridizationType)

      This method is called to get a substring of the complementary String between the positions pos1 and pos2 in the duplex. This substring is converted in the type precised by the hybridizationType String.
      Parameters:
        `pos1` - : starting position of the subsequence
        `pos2` - : ending position of the subsequence
        `hybridizationType` - : type of sequence ("dna" or "rna")
      Returns:
        substring of the complementary String between pos1 and pos2 in the new type precised by the hybridizationType String

    - #### computesInternalLoopLength

          public int computesInternalLoopLength(int pos1,
                                       int pos2)

      computes the number of nucleic acids in the internal loop between the positions pos1 + 1 and pos2 - 1 in the duplex ArrayList of the NucleotidSequences object.
      Parameters:
        `pos1` - : position preceding the starting position of the internal loop
        `pos2` - : position following the ending position of the internal loop
      Returns:
        int number nucleic acids in the internal loop at the positions pos1 + 1 : pos2 - 1 in the duplex ArrayList.

    - #### getDuplex

          public java.util.ArrayList<BasePair> getDuplex()

      This method is called to get the duplex of NucleotidSequences.
      Returns:
        the duplex ArrayList containing BasePair objects.

    - #### getSequenceSens

          public java.lang.String getSequenceSens(java.lang.String sequence,
                                         int pos1,
                                         int pos2)

      To get the orientation of the subsequence sequence.
      Parameters:
        `sequence` - : a substring of sequence String or complementary String.
        `pos1` - : the starting position of the substring in the sequence String or complementary String
        `pos2` - : the ending position of the substring in the sequence String or complementary String
      Returns:
        String "5'3'" if the substring sequence is a substring of the sequence (5'3') or String "3'5'" if the substring sequence is a substring of the complementary sequence (3'5'). If the substring is neither a substring of the sequence, nor a substring of the complementary sequence a SequenceException is thrown.

    - #### computesPercentGC

          public double computesPercentGC()

      computes the percentage of GC base pairs in the duplex of NucleotidSequences.
      Returns:
        double percentage of GC base pairs in the duplex.

    - #### computesPercentMismatching

          public double computesPercentMismatching()

      Computes the percentage of mismatching base pairs in the duplex of NucleotidSequences.
      Returns:
        double percentage of mismatching base pairs in the duplex

    - #### isOneGCBasePair

          public boolean isOneGCBasePair()

      To check if there is at least one GC base pair in the duplex of NucleotidSequences.
      Returns:
        true if at least one GC base pair exists in the duplex.

    - #### getDuplexLength

          public int getDuplexLength()

      This method is called to get the length of the ArrayList duplex of NucleotidSequences.
      Returns:
        int length which represents the length of the nucleic acid duplex.

    - #### getSequence

          public java.lang.String getSequence()

      This method is called to get the encoded sequence String of NucleotidSequences.
      Returns:
        String sequence of NucleotidSequences.

    - #### getComplementary

          public java.lang.String getComplementary()

      This method is called to get the encoded complementary String of NucleotidSequences.
      Returns:
        String complementary of NucleotidSequences.

    - #### getSequence

          public java.lang.String getSequence(int pos1,
                                     int pos2)

      This method is called to get a substring between two positions of the sequence String.
      Parameters:
        `pos1` - : starting position of the subsequence
        `pos2` - : ending position of the subsequence
      Returns:
        the sequence substring between pos1 and pos2. If pos1 and pos2 are out of the duplex length range, a SequenceException is thrown.

    - #### getComplementary

          public java.lang.String getComplementary(int pos1,
                                          int pos2)

      This method is called to get a substring between two positions of the complementary String.
      Parameters:
        `pos1` - : starting position of the subsequence
        `pos2` - : ending position of the subsequence
      Returns:
        the complementary substring between pos1 and pos2. If pos1 and pos2 are out of the duplex length range, a SequenceException is thrown.

    - #### getSequenceNNPair

          public java.lang.String getSequenceNNPair(int pos)

      to get the two nucleic acids which are from the sequence (5'3') in the Crick's pair at the position "pos" in the duplex.
      Parameters:
        `pos` - : position of the crick's pair in the duplex.
      Returns:
        a substring of the sequence String which represents the nucleic acids from the sequence (5'3') in the crick'base pair at the position pos.

    - #### getComplementaryNNPair

          public java.lang.String getComplementaryNNPair(int pos)

      to get the two nucleic acids which are from the complementary sequence (3'5') in the Crick's pair at the position "pos" in the duplex.
      Parameters:
        `pos` - : position of the crick's pair in the duplex.
      Returns:
        a substring of the complementary String which represents the nucleic acids from the complementary sequence (3'5') in the crick'base pair at the position pos.

    - #### getSequenceNNPairUnlocked

          public java.lang.String getSequenceNNPairUnlocked(int pos)

      to get the two unlocked nucleic acids which are from the sequence (5'3') in the Crick's pair at the position "pos" in the duplex.
      Parameters:
        `pos` - : position of the crick's pair in the duplex.
      Returns:
        a substring of the sequence String which represents the unlocked nucleic acids from the sequence (5'3') in the crick'base pair at the position pos.

    - #### getComplementaryNNPairUnlocked

          public java.lang.String getComplementaryNNPairUnlocked(int pos)

      to get the two unlocked nucleic acids which are from the complementary sequence (3'5') in the Crick's pair at the position "pos" in the duplex.
      Parameters:
        `pos` - : position of the crick's pair in the duplex.
      Returns:
        a substring of the complementary String which represents the unlocked nucleic acids from the complementary sequence (3'5') in the crick'base pair at the position pos.

    - #### getNNPairWithoutHydroxyA

          public java.lang.String[] getNNPairWithoutHydroxyA(int pos)

      to get the two nucleic acids from each sequence in the Crick's pair at the position "pos" in the duplex. we convert the hydroxyadenine (A*) into an adenine (A).
      Parameters:
        `pos` - : position of the crick's pair in the duplex.
      Returns:
        a String [] containing the substrings which represent the nucleic acids from each sequence in the crick'base pair at the position pos. The hydroxyadenine is replaced by an adenine.

    - #### calculateNumberOfTerminal

          public double calculateNumberOfTerminal(java.lang.String base1,
                                         java.lang.String base2,
                                         int pos1,
                                         int pos2)

      calculates the number of base pairs (base1, base2) at the postions pos1 and pos2 in the duplex of NucleotidSequences.
      Parameters:
        `base1` -
        `base2` -
        `pos1` - : starting position of the subsequence in the duplex of NucleotidSequences.
        `pos2` - : ending position of the subsequence in the duplex of NucleotidSequences.
      Returns:
        int number of base pairs (base1, base2) at the postions pos1 and pos2 in the duplex of NucleotidSequences.

    - #### getNumberTerminal5TA

          public double getNumberTerminal5TA(int pos1,
                                    int pos2)

      calculates the number of terminal 5'T3'A in the subduplex between pos1 and pos2
      Parameters:
        `pos1` - : starting position of the subsequence in the duplex of NucleotidSequences.
        `pos2` - : ending position of the subsequence in the duplex of NucleotidSequences.
      Returns:
        int number of terminal 5'T3'A in the subduplex between pos1 and pos2. 5'A/3'T means that at the position pos1, the base pair is (T,A) and at the position pos2, the base pair is (A,T).

    - #### removeTerminalUnpairedNucleotides

          public int[] removeTerminalUnpairedNucleotides()

      find the real starting and ending positions of the duplex. The real starting and ending positions of the duplex are the first and last positions in the duplex where the nucleic acids are paired.
      Returns:
        int [] containing the first and last positions in the duplex where the nucleic acids are paired.

    - #### isBasePair

          public boolean isBasePair(java.lang.String base1,
                           java.lang.String base2,
                           int pos)

      To check if the base pair at the position pos in the duplex is (base1, base2) or (base2, base1).
      Parameters:
        `base1` -
        `base2` -
        `pos` - : position of the base pair in the duplex
      Returns:
        true if the tuple (TopAcid, BottomAcid) of BasePair at the position pos in the duplex ArrayList is (base1, base2) or (base2, base1).

    - #### getDuplexFrom

          public static java.util.ArrayList<BasePair> getDuplexFrom(java.lang.String sequence,
                                                    java.lang.String complementary)

      This method is called to get the duplex of NucleotidSequences.
      Parameters:
        `sequence` - : sequence (5'3')
        `complementary` - : complementary sequence (3'5')
      Returns:
        the duplex of NucleotidSequences.

    - #### decodeSequences

          public static java.lang.String[] decodeSequences(java.lang.String sequence,
                                           java.lang.String complementary)

      decodes the String sequence and complementary of NucleotidSequences.
      Parameters:
        `sequence` - : sequence (5'3')
        `complementary` - : complementary sequence (3'5')
      Returns:
        a String [] object containing the decoded String sequence and complementary of NucleotidSequences.

    - #### buildSymetricSequences

          public static NucleotidSequences buildSymetricSequences(java.lang.String seq1,
                                                  java.lang.String seq2)

      creates a NucleotidSequences with two symmetric sequences String created from the seq1 String an seq2 String.
      Parameters:
        `seq1` - : sequence (5'3')
        `seq2` - : complementary sequence (3'5')
      Returns:
        NucleotidSequences whith the sequence String symmetric to the complementary String.

    - #### getInversedSequence

          public static java.lang.String getInversedSequence(java.lang.String sequence)

      creates the inverse String of the sequence
      Parameters:
        `sequence` - to inverse
      Returns:
        String which is the inverse of the sequence

    - #### isSelfComplementarySequence

          public static boolean isSelfComplementarySequence(java.lang.String sequence)

      To check if a sequence is self complementary. A self complementary sequence is a sequence which can get bound or hybridized to itself.
      Parameters:
        `sequence` -
      Returns:
        true if the sequence is self complementary.

    - #### convertToPyr_Pur

          public static java.lang.String convertToPyr_Pur(java.lang.String sequence)

      converts a sequence into a String composed of purine and pyrimidine. A and G are purines (represented by "R" in the new sequence String), C, T and U are pyrimidines (represented by "Y" in the new sequence String)
      Parameters:
        `sequence` - to convert in purine-pyrimidine sequence.
      Returns:
        the new sequence converted into a String composed of purines ("R") and pyrimidines ("Y"). If the sequence String is not only composed of - (gap), A, T, U, G and C, a SequenceExceptions is thrown.

    - #### getModifiedAcidNames

          public static java.util.HashMap<java.lang.String,SpecificAcidNames> getModifiedAcidNames()

      This method is called to get the modifiedAcidNames of NucleotidSequences.
      Returns:
        the public static modifiedAcidNames of NucleotidSequences.

    - #### initialiseModifiedAcidHashmap

          public static void initialiseModifiedAcidHashmap()

      initialises the modifiedAcidNames of NucleotidSequences.

    - #### getComplementarySequence

          public static java.lang.String getComplementarySequence(java.lang.String sequence,
                                                  java.lang.String hybridization)

      This method is called when we want to get the complementary of NucleotidSequences with the type of hybridization "hybridization".
      Parameters:
        `sequence` -
        `hybridization` - : type of hybridization
      Returns:
        String which represents the complementary sequence (3'5') with the specified nature.(rna, dna)

    - #### checkSequence

          public static boolean checkSequence(java.lang.String sequence)

      Checks if the String sequence is composed of nucleic acids known by MELTING.
      Parameters:
        `sequence` -
      Returns:
        false if one of the nucleic acids is not known by MELTING. (not registered in the ArrayList existingNucleicAcids of the BasePair class). If the length of the sequence String is 0, a SequenceException is thrown.

    - #### getDanglingSens

          public static java.lang.String getDanglingSens(java.lang.String seq1,
                                         java.lang.String seq2)

      this method is called to get the sens of the dangling end for the sequences seq1 and seq2
      Parameters:
        `seq1` - : String terminal pattern of the sequence (5'3')
        `seq2` - : String terminal pattern of the complementary sequence (3'5')
      Returns:
        String "5" if the dangling end (the unpaired nucleic acid) is a 5' dangling end and String "3" if the dangling end is a 3' dangling end. If both seq1 and seq2 contain "-", or if neither the sequence seq1 nor the sequence seq2 contains dangling ends (or gaps for the complementary sequence), a SequenceException is thrown.