PatternComputation
Date: 2014-08-08

melting.patternModels

## Class PatternComputation

- java.lang.Object
- - melting.patternModels.PatternComputation

- All Implemented Interfaces:
    PatternComputationMethod
  Direct Known Subclasses:
    AllawiSantaluciaPeyret97_98_99mm, AllawiSantaluciaPeyret97_98_99tanmm, Asanuma05Azobenzene, Broda05CNGRepeats, CricksNNMethod, GlobalSingleBulgeLoopMethod, InosineNNMethod, LockedAcidNNMethod, McTigue04LockedAcid, Owczarzy11LockedAcid, Santalucia04InternalLoop, Santalucia04LongBulgeLoop, SecondDanglingEndMethod, Serra12Wobble, SingleDanglingEndMethod, Sugimoto01Hydroxyadenine, SugimotoLongDanglingEndMethod, Turner06InternalLoop, Turner06mm, Turner99_06LongBulgeLoop, Turner99_06tanmm, Turner99Wobble, Watkins11mm, Znosko071x2Loop, ZnoskoMethod

      public abstract class PatternComputation
      extends java.lang.Object
      implements PatternComputationMethod

  This class represents the different pattern models. It implements the PatternComputationMethod interface.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DataCollect` | `collector` DataCollect collector : contains the data HasMap with the thermodynamic parameters for the pattern computation.
    `protected java.lang.String` | `fileName` String fileName : name of the xml file containing the thermodynamic parameters.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PatternComputation()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ThermoResult` | `computeThermodynamics(NucleotidSequences sequences, int pos1, int pos2, ThermoResult result)`
    `DataCollect` | `getCollector()` This method is called to get the DataCollect of the implemented class.
    `static java.lang.String` | `getData()` This method is called to get the HasMap of DataCollect containing the thermodynamic parameters
    `java.lang.String` | `getDataFileName(java.lang.String methodName)`
    `void` | `initialiseFileName(java.lang.String methodName)` If a file name is entered by the user, the file name of the model becomes the file name entered by the user, otherwise the default file name of the model is used.
    `boolean` | `isApplicable(Environment environment, int pos1, int pos2)`
    `boolean` | `isMissingParameters(NucleotidSequences sequences, int pos1, int pos2)` Check if one thermodynamic parameter is missing to compute the enthalpy and entropy of the pattern at the positions pos1 and pos2.
    `void` | `loadData(java.util.HashMap<java.lang.String,java.lang.String> options)` To load the necessary thermodynamic parameters of the implemented class.
    `void` | `loadFile(java.lang.String name, DataCollect collector)` To load the thermodynamic parameters from the file "name" and stock them in the map of a DataCollect object.

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

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

- - ### Field Detail

    - #### collector

          protected DataCollect collector

      DataCollect collector : contains the data HasMap with the thermodynamic parameters for the pattern computation.

    - #### fileName

          protected java.lang.String fileName

      String fileName : name of the xml file containing the thermodynamic parameters.

  - ### Constructor Detail

    - #### PatternComputation

          public PatternComputation()

  - ### Method Detail

    - #### isApplicable

          public boolean isApplicable(Environment environment,
                             int pos1,
                             int pos2)

      Specified by:
        `isApplicable` in interface `PatternComputationMethod`
      Returns:
        false if the model used to compute the enthalpy and entropy of the pattern at the positions pos1 and pos2 is not applicable with the environment. If the environment can make the results less reliable, a warning message will appear.

    - #### computeThermodynamics

          public abstract ThermoResult computeThermodynamics(NucleotidSequences sequences,
                                           int pos1,
                                           int pos2,
                                           ThermoResult result)

      Specified by:
        `computeThermodynamics` in interface `PatternComputationMethod`
      Parameters:
        `sequences` - which contains the sequences entered by the user.
        `result` - which contains the computed enthalpy, entropy and melting temperature.
      Returns:
        ThermoResult result which contains the incremented enthalpy and entropy values.

    - #### isMissingParameters

          public boolean isMissingParameters(NucleotidSequences sequences,
                                    int pos1,
                                    int pos2)

      Description copied from interface: `PatternComputationMethod`
      Check if one thermodynamic parameter is missing to compute the enthalpy and entropy of the pattern at the positions pos1 and pos2.
      Specified by:
        `isMissingParameters` in interface `PatternComputationMethod`
      Parameters:
        `sequences` - which contains the sequences entered by the user.
      Returns:
        false if one necessary thermodynamic parameter is missing.

    - #### getCollector

          public DataCollect getCollector()

      Description copied from interface: `PatternComputationMethod`
      This method is called to get the DataCollect of the implemented class.
      Specified by:
        `getCollector` in interface `PatternComputationMethod`
      Returns:
        DataCollect object of the implemented class.

    - #### loadData

          public void loadData(java.util.HashMap<java.lang.String,java.lang.String> options)

      Description copied from interface: `PatternComputationMethod`
      To load the necessary thermodynamic parameters of the implemented class.
      Specified by:
        `loadData` in interface `PatternComputationMethod`
      Parameters:
        `options` - which contains the current options. (default options and options entered by the user)

    - #### loadFile

          public void loadFile(java.lang.String name,
                      DataCollect collector)

      Description copied from interface: `PatternComputationMethod`
      To load the thermodynamic parameters from the file "name" and stock them in the map of a DataCollect object.
      Specified by:
        `loadFile` in interface `PatternComputationMethod`
      Parameters:
        `name` - : the file name where to find the thermodynamic parameters
        `collector` - : The object which stocks the different thermodynamic parameters in a map.

    - #### getDataFileName

          public java.lang.String getDataFileName(java.lang.String methodName)

      Specified by:
        `getDataFileName` in interface `PatternComputationMethod`
      Parameters:
        `methodName` - : method or model name entered by the user.
      Returns:
        the file name entered by the user if he wrote a name file preceded by ":" in the method or model name otherwise the default file name of the model.

    - #### initialiseFileName

          public void initialiseFileName(java.lang.String methodName)

      Description copied from interface: `PatternComputationMethod`
      If a file name is entered by the user, the file name of the model becomes the file name entered by the user, otherwise the default file name of the model is used.
      Specified by:
        `initialiseFileName` in interface `PatternComputationMethod`
      Parameters:
        `methodName` - : method or model name entered by the user.

    - #### getData

          public static java.lang.String getData()

      This method is called to get the HasMap of DataCollect containing the thermodynamic parameters
      Returns:
        HasMap of DataCollect containing the thermodynamic parameters for this pattern.