Thermodynamics Class.
More...
#include <thermodynamics.h>
Thermodynamics Class.
The RNA class provides an encapsulation of the functions and struct for reading and storing thermodynamic parameters. This includes methods for changing folding temperatures This class is intended for use in inheritance for classes that provide functionality.
Thermodynamics::Thermodynamics |
( |
const bool |
isRNA = true , |
|
|
const char *const |
alphabetName = NULL , |
|
|
const double |
temperature = 310.15 |
|
) |
| |
Thermodynamics::~Thermodynamics |
( |
| ) |
|
void Thermodynamics::ClearEnergies |
( |
| ) |
|
Copy thermodynamic parameters from an instance of Thermodynamics class.
This is generally not needed because functions automatically populate the parameters from disk. It is helpful, however, when a large number of calculations with be performed because the parameters can then be read from disk only once. Note that the source Thermodynamics class must have been initialized with the "correct" ISRNA value and correct temperature. Return 0 if no error and non-zero errors can be parsed by GetErrorMessage() or GetErrorMessageString().
- Parameters
-
thermo | is a pointer to Thermodynamics class. That must have already called the ReadThermodynamics() function. Clear the currently loaded energy datatable and release its resources. |
void Thermodynamics::ClearEnthalpies |
( |
| ) |
|
Clear the currently loaded enthalpy datatable and release its resources.
string Thermodynamics::GetAlphabetName |
( |
| ) |
const |
Get the name of the extended alphabet for which thermodynamic parameters should be loaded.
datatable * Thermodynamics::GetDatatable |
( |
| ) |
|
This function is used during inheritance o provide access to the free energy change parameters. This function generates no error codes. (Error checking was done for this during construction).
- Returns
- A pointer to datatable with free energy change parameters.
bool Thermodynamics::GetEnergyRead |
( |
| ) |
const |
Return whether this instance of Thermodynamics has the paremters populated (either from disk or from another Thermodynamics class).
- Returns
- A bool that indicates whether the parameters are populated (true = yes).
datatable * Thermodynamics::GetEnthalpyTable |
( |
const char * |
alphabet = NULL | ) |
|
This function is used to provide an enthalpy table. This function will return a NULL pointer if there is an error reading the tables from disk. It is important that programs check the status of the pointer before using it, i.e. make sure it is not NULL.
- Parameters
-
alphabet | Specify which alphabet to use. If this is NULL (the default) the currently loaded alphabet, if there is one, will be used. Otherwise either default RNA or DNA alphabet will be used, depending on the value of isrna. |
- Returns
- A pointer to datatable with the enthalpy change parameters.
double Thermodynamics::GetTemperature |
( |
| ) |
const |
Get the current folding temperature in K.
- Returns
- A double that indicates the folding temperature in K.
bool Thermodynamics::IsAlphabetRead |
( |
| ) |
const |
- Returns
- A bool that indicates whether the alphabet was populated.
int Thermodynamics::ReadThermodynamic |
( |
const char * |
directory = NULL , |
|
|
const char * |
alphabet = NULL , |
|
|
const double |
temperature = -1.0 |
|
) |
| |
Function to read the thermodynamic parameters.
This function depends on temp, the current temperature, to determine in the folding free energies need to be set to other than those read in files for 310.15 K. Return of zero => no error and a return of non-zero indicates error. Public functions that need the thermodynamic parameters call this function automatically. By default, the path to the thermodynamic paramaters is fetched from the $DATAPATH environment variable. If a specific path is needed, $DATAPATH is overridden by specifying the pathname explicitly here as a parameter.
- Returns
- An int that indicates whether an error occured.
- Parameters
-
directory | is a pointer to a cstring that indicates the directory that contains the thermodynamnic parameter files. By default, this is NULL and the environment variable $DATAPATH is consulted to get this path. |
alphabet | is a pointer to a cstring that indicates the name of the nucleic acid alphabet (e.g. "rna", "dna" etc); |
temperature | specify a custom temperature. If this parameter is less than zero it is ignored. Otherwise the free energy parameters are recalculated to apply to the specified temperature. |
int Thermodynamics::ReloadDataTables |
( |
const double |
new_temperature = -1.0 | ) |
|
Re-loads the free energy data tables from the original directory and using the original alphabet name.
- Parameters
-
temperature | specify a custom temperature. If this parameter is less than zero it is ignored. Otherwise the free energy parameters are recalculated to apply to the specified temperature. scaled to the specified temperature. |
Re-loads the free energy data tables from original data directory and using the original alphabet name. If new_temperature is less than 0 it is ignored. Otherwise, the data tables will be read in and scaled to the specified temperature.
int Thermodynamics::SetTemperature |
( |
double |
temperature | ) |
|
Set the temperature of folding in K.
This function allows the user to specify folding temperatures other than 310.15 K (37 degrees C). This changes folding free energy changes that would be returned for existing structures and would alter the set of structures predicted. When this function is called, the thermodynamic parameter files are immediately read from disk. These include both enthalpy parameters (.dh files) and free energy changes at 310.15 (.dat files). The files must either be at a location indicated by the $DATAPATH environment variable or in pwd. Changing the temperature only alters subsequent calculations. For example, if a structure prediction method has been called, the set of predicted structures are not changed at the time of a call to SetTemperature. Likewise, SetTemperature must be called before calling a structure prediction method if a temperature other than the 310.15 K default is desired. The function returns an error code where 0 is no error and non-zero errors can be parsed by by GetErrorMessage() or GetErrorMessageString() in an inheriting class.
bool Thermodynamics::VerifyThermodynamic |
( |
| ) |
|
Force the datatables to be read if they haven't already. Return true if the tables were already loaded or if the attempt to (re)open them succeded.
bool Thermodynamics::copied |
|
protected |
datatable* Thermodynamics::data |
|
protected |
datatable* Thermodynamics::enthalpy |
|
protected |
bool Thermodynamics::isrna |
string Thermodynamics::nominal_alphabetName |
|
protected |
double Thermodynamics::nominal_temperature |
|
protected |
bool Thermodynamics::skipThermoTables |
|
protected |
The documentation for this class was generated from the following files: