BasePair
Date: 2014-08-08

melting.sequences

## Class BasePair

- java.lang.Object
- - melting.sequences.BasePair

-     public class BasePair
      extends java.lang.Object

  This class represents a base pair of nucleic acids. The instance variables are : int position : the position of the base pair in the sequence. String topAcid : the nucleic acid from the sequence (5'3'). String bottomAcid : the nucleic acid from the complementary sequence (3'5'). private static ArrayList existingNucleicAcids : the list registering all the possible nucleic acids known by MELTING.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasePair(int pos)` To create a BasePair, we need to give the position in the sequence where starts the String TopAcid or BottomAcid.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBottomAcid()` This method is called to get the nucleic acid "BottomAcid" of BasePair..
    `static java.util.ArrayList<java.lang.String>` | `getExistingNucleicAcids()` This method is called to get the existingNucleicAcids of BasePair.
    `int` | `getLengthAcid()` This method is called to get the length of the nucleic acid.
    `int` | `getPosition()` This method is called to get the position of BasePair in the duplex.
    `java.lang.String` | `getTopAcid()` This method is called to get the nucleic acid "TopAcid" of BasePair.
    `static void` | `initialiseNucleicAcidList()` initialises the existingNucleicAcids of BasePair.
    `boolean` | `isBasePairEqualTo(java.lang.String base1, java.lang.String base2)` Check if the two nucleic acids of the base pair are (base1, base2) or (base2, base1).
    `boolean` | `isBasePairStrictlyEqualTo(java.lang.String base1, java.lang.String base2)` Check if the two nucleic acids of the base pair are (base1, base2).
    `boolean` | `isBottomBasePyrimidine()` Check if the nucleic acid represented by BottomAcid is a pyrimidine.
    `boolean` | `isComplementaryBasePair()` To check if the two nucleic acids in the base pair are complementary.
    `boolean` | `isComplementaryLockedPair()` To check if the two nucleic acids in the base pair are complementary when one of them is a locked nucleic acid.
    `boolean` | `isFrequentNucleicAcidTopBase()` Check if the Nucleic acid TopAcid is a frequent nucleic acid.
    `boolean` | `isTopBasePyrimidine()` Check if the nucleic acid represented by TopAcid is a pyrimidine.
    `boolean` | `isUnpaired()` To check if the nucleic acids in the base pair are paired.
    `boolean` | `isWatsonCrickBottomBase()` Check if the Nucleic acid BottomAcid is a frequent nucleic acid.
    `void` | `setBottomAcid(java.lang.String bottomAcid)` To change the BottomAcid Value of BasePair.
    `void` | `setTopAcid(java.lang.String topAcid)` To change the TopAcid Value of BasePair..

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

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

- - ### Constructor Detail

    - #### BasePair

          public BasePair(int pos)

      To create a BasePair, we need to give the position in the sequence where starts the String TopAcid or BottomAcid.
      Parameters:
        `pos` - : the position of the base pair in the sequence. It is the starting position of the String TopAcid or BottomAcid in the String sequence.

  - ### Method Detail

    - #### getTopAcid

          public java.lang.String getTopAcid()

      This method is called to get the nucleic acid "TopAcid" of BasePair.
      Returns:
        String TopAcid : The nucleic acid "TopAcid" of BasePair.. It represents the nucleic acid from the sequence (5'3').

    - #### setTopAcid

          public void setTopAcid(java.lang.String topAcid)

      To change the TopAcid Value of BasePair..

    - #### getBottomAcid

          public java.lang.String getBottomAcid()

      This method is called to get the nucleic acid "BottomAcid" of BasePair..
      Returns:
        String TopAcid : The nucleic acid "BottomAcid" of BasePair. It represents the nucleic acid from the complementary sequence (3'5').

    - #### setBottomAcid

          public void setBottomAcid(java.lang.String bottomAcid)

      To change the BottomAcid Value of BasePair.

    - #### isComplementaryBasePair

          public boolean isComplementaryBasePair()

      To check if the two nucleic acids in the base pair are complementary.
      Returns:
        true if the TopAcid and BottomAcid are complementary. There is complementarity if the two acids (TopAcid, BottomAcid) of the base pair are (A,T), (T,A), (A,U), (U,A), (C,G) or (G,C).

    - #### isComplementaryLockedPair

          public boolean isComplementaryLockedPair()

      To check if the two nucleic acids in the base pair are complementary when one of them is a locked nucleic acid.
      Returns:
        true if the TopAcid and BottomAcid are complementary. There is complementarity if the two acids (TopAcid, BottomAcid) of the base pair are (AL,T), (TL,A), (CL,G) or (GL,C).

    - #### isFrequentNucleicAcidTopBase

          public boolean isFrequentNucleicAcidTopBase()

      Check if the Nucleic acid TopAcid is a frequent nucleic acid.
      Returns:
        true if the TopAcid of BasePair is a frequent nucleic acid. A frequent nucleic acid is A, T, U, G or C.

    - #### isWatsonCrickBottomBase

          public boolean isWatsonCrickBottomBase()

      Check if the Nucleic acid BottomAcid is a frequent nucleic acid.
      Returns:
        true if the BottomAcid of BasePair is a frequent nucleic acid. A frequent nucleic acid is A, T, U, G or C.

    - #### isTopBasePyrimidine

          public boolean isTopBasePyrimidine()

      Check if the nucleic acid represented by TopAcid is a pyrimidine.
      Returns:
        true if the TopAcid of BasePair is a pyrimidine. C, T and U are pyrimidines.

    - #### isBottomBasePyrimidine

          public boolean isBottomBasePyrimidine()

      Check if the nucleic acid represented by BottomAcid is a pyrimidine.
      Returns:
        true if the BottomAcid of BasePair is a pyrimidine. C, T and U are pyrimidines.

    - #### isBasePairEqualTo

          public boolean isBasePairEqualTo(java.lang.String base1,
                                  java.lang.String base2)

      Check if the two nucleic acids of the base pair are (base1, base2) or (base2, base1).
      Parameters:
        `base1` - : first base (the nucleic acid is represented by a String)
        `base2` - : second base (the nucleic acid is represented by a String)
      Returns:
        true if (TopAcid, BottomAcid) is equal to (base1, base2) or (base2, base1).

    - #### isBasePairStrictlyEqualTo

          public boolean isBasePairStrictlyEqualTo(java.lang.String base1,
                                          java.lang.String base2)

      Check if the two nucleic acids of the base pair are (base1, base2).
      Parameters:
        `base1` - : first base (the nucleic acid is represented by a String)
        `base2` - : second base (the nucleic acid is represented by a String)
      Returns:
        true if (TopAcid, BottomAcid) is strictly equal to (base1, base2).

    - #### getLengthAcid

          public int getLengthAcid()

      This method is called to get the length of the nucleic acid.
      Returns:
        int length : The maximum length between the TopAcid length and the BottomAcid length.

    - #### isUnpaired

          public boolean isUnpaired()

      To check if the nucleic acids in the base pair are paired.
      Returns:
        true if the nucleic acids in the base pair are paired. When a nucleic acid is unpaired, there is a gap in the duplex represented by "-". Consequently, the nucleic acids are paired in BasePair if TopAcid and bottomAcid are not equal to "-".

    - #### initialiseNucleicAcidList

          public static void initialiseNucleicAcidList()

      initialises the existingNucleicAcids of BasePair.

    - #### getExistingNucleicAcids

          public static java.util.ArrayList<java.lang.String> getExistingNucleicAcids()

      This method is called to get the existingNucleicAcids of BasePair.
      Returns:
        ArrayList existingNucleicAcids of BasePair.

    - #### getPosition

          public int getPosition()

      This method is called to get the position of BasePair in the duplex.
      Returns:
        int position of the BasePair object.