\hypertarget{group__mfe__fold}{
\section{Calculating Minimum Free Energy (MFE) Structures}
\label{group__mfe__fold}\index{Calculating Minimum Free Energy (MFE) Structures@{Calculating Minimum Free Energy (MFE) Structures}}
}


This module contains all functions and variables related to the calculation of global minimum free energy structures for single sequences.  


Collaboration diagram for Calculating Minimum Free Energy (MFE) Structures:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=419pt]{group__mfe__fold}
\end{center}
\end{figure}
\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__mfe__cofold}{MFE Structures of two hybridized Sequences}
\item 
\hyperlink{group__consensus__mfe__fold}{MFE Consensus Structures for Sequence Alignment(s)}
\item 
\hyperlink{group__local__mfe__fold}{Local MFE structure Prediction and Z-\/scores}
\item 
\hyperlink{group__kl__neighborhood__mfe}{Calculating MFE representatives of a Distance Based Partitioning}


\begin{DoxyCompactList}\small\item\em Compute the minimum free energy (MFE) and secondary structures for a partitioning of the secondary structure space according to the base pair distance to two fixed reference structures basepair distance to two fixed reference structures. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
float \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par} (const char $\ast$sequence, char $\ast$structure, \hyperlink{structparamT}{paramT} $\ast$parameters, int is\_\-constrained, int is\_\-circular)
\begin{DoxyCompactList}\small\item\em Compute minimum free energy and an appropriate secondary structure of an RNA sequence. \item\end{DoxyCompactList}\item 
float \hyperlink{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}{fold} (const char $\ast$sequence, char $\ast$structure)
\begin{DoxyCompactList}\small\item\em Compute minimum free energy and an appropriate secondary structure of an RNA sequence. \item\end{DoxyCompactList}\item 
float \hyperlink{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}{circfold} (const char $\ast$sequence, char $\ast$structure)
\begin{DoxyCompactList}\small\item\em Compute minimum free energy and an appropriate secondary structure of a circular RNA sequence. \item\end{DoxyCompactList}\item 
\hypertarget{group__mfe__fold_ga107fdfe5fd641868156bfd849f6866c7}{
void \hyperlink{group__mfe__fold_ga107fdfe5fd641868156bfd849f6866c7}{free\_\-arrays} (void)}
\label{group__mfe__fold_ga107fdfe5fd641868156bfd849f6866c7}

\begin{DoxyCompactList}\small\item\em Free arrays for mfe folding. \item\end{DoxyCompactList}\item 
\hypertarget{group__mfe__fold_ga41bf8f6fa15b94471f7095cad9f0ccf3}{
void \hyperlink{group__mfe__fold_ga41bf8f6fa15b94471f7095cad9f0ccf3}{update\_\-fold\_\-params} (void)}
\label{group__mfe__fold_ga41bf8f6fa15b94471f7095cad9f0ccf3}

\begin{DoxyCompactList}\small\item\em Recalculate energy parameters. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This module contains all functions and variables related to the calculation of global minimum free energy structures for single sequences. This section covers all functions and variables related to the calculation of minimum free energy (MFE) structures.

The library provides a fast dynamic programming minimum free energy folding algorithm as described by Zuker \& Stiegler (1981).

The library provides a fast dynamic programming minimum free energy folding algorithm as described in  zuker:1981. All relevant parts that directly implement the \char`\"{}Zuker \& Stiegler\char`\"{} algorithm for single sequences are described in this section.

Folding of circular RNA sequences is handled as a post-\/processing step of the forward recursions. See  hofacker:2006 for further details.

Nevertheless, the RNAlib also provides interfaces for the prediction of consensus MFE structures of sequence alignments, MFE structure for two hybridized sequences, local optimal structures and many more. For those more specialized variants of MFE folding routines, please consult the appropriate subsections (Modules) as listed above. 

\subsection{Function Documentation}
\hypertarget{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{
\index{mfe\_\-fold@{mfe\_\-fold}!fold\_\-par@{fold\_\-par}}
\index{fold\_\-par@{fold\_\-par}!mfe_fold@{mfe\_\-fold}}
\subsubsection[{fold\_\-par}]{\setlength{\rightskip}{0pt plus 5cm}float fold\_\-par (const char $\ast$ {\em sequence}, \/  char $\ast$ {\em structure}, \/  {\bf paramT} $\ast$ {\em parameters}, \/  int {\em is\_\-constrained}, \/  int {\em is\_\-circular})}}
\label{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}


Compute minimum free energy and an appropriate secondary structure of an RNA sequence. The first parameter given, the RNA sequence, must be {\itshape uppercase\/} and should only contain an alphabet $\Sigma$ that is understood by the RNAlib\par
 (e.g. $ \Sigma = \{A,U,C,G\} $)\par


The second parameter, {\itshape structure\/}, must always point to an allocated block of memory with a size of at least $\mathrm{strlen}(\mathrm{sequence})+1$

If the third parameter is NULL, global model detail settings are assumed for the folding recursions. Otherwise, the provided parameters are used.

The fourth parameter indicates whether a secondary structure constraint in enhanced dot-\/bracket notation is passed through the structure parameter or not. If so, the characters \char`\"{} $|$ x $<$ $>$ \char`\"{} are recognized to mark bases that are paired, unpaired, paired upstream, or downstream, respectively. Matching brackets \char`\"{} ( ) \char`\"{} denote base pairs, dots \char`\"{}.\char`\"{} are used for unconstrained bases.

To indicate that the RNA sequence is circular and thus has to be post-\/processed, set the last parameter to non-\/zero

After a successful call of \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()}, a backtracked secondary structure (in dot-\/bracket notation) that exhibits the minimum of free energy will be written to the memory {\itshape structure\/} is pointing to. The function returns the minimum of free energy for any fold of the sequence given.

\begin{DoxyNote}{Note}
OpenMP: Passing NULL to the 'parameters' argument involves access to several global model detail variables and thus is not to be considered threadsafe
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}{fold()}, \hyperlink{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}{circfold()}, \hyperlink{structmodel__detailsT}{model\_\-detailsT}, set\_\-energy\_\-model(), \hyperlink{group__energy__parameters_gac2f3ca440b7eaf4d999fb27da949fe72}{get\_\-scaled\_\-parameters()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em sequence}]RNA sequence \item[{\em structure}]A pointer to the character array where the secondary structure in dot-\/bracket notation will be written to \item[{\em parameters}]A data structure containing the prescaled energy contributions and the model details. (NULL may be passed, see OpenMP notes above) \item[{\em is\_\-constrained}]Switch to indicate that a structure contraint is passed via the structure argument (0==off) \item[{\em is\_\-circular}]Switch to (de-\/)activate postprocessing steps in case RNA sequence is circular (0==off)\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the minimum free energy (MFE) in kcal/mol 
\end{DoxyReturn}
\hypertarget{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}{
\index{mfe\_\-fold@{mfe\_\-fold}!fold@{fold}}
\index{fold@{fold}!mfe_fold@{mfe\_\-fold}}
\subsubsection[{fold}]{\setlength{\rightskip}{0pt plus 5cm}float fold (const char $\ast$ {\em sequence}, \/  char $\ast$ {\em structure})}}
\label{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}


Compute minimum free energy and an appropriate secondary structure of an RNA sequence. This function essentially does the same thing as \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()}. However, it takes its model details, i.e. \hyperlink{fold__vars_8h_ab4b11c8d9c758430960896bc3fe82ead}{temperature}, \hyperlink{fold__vars_8h_a72b511ed1201f7e23ec437e468790d74}{dangles}, \hyperlink{fold__vars_8h_a4f6265bdf0ead7ff4628a360adbfd77e}{tetra\_\-loop}, \hyperlink{fold__vars_8h_abf380d09e4f1ab94fc6af57cf0ad5d32}{noGU}, \hyperlink{fold__vars_8h_aa8d1c7b92489179e1eafa562b7bdd259}{no\_\-closingGU}, \hyperlink{fold__vars_8h_a0afc287c2464866d94858c39175154af}{fold\_\-constrained}, \hyperlink{fold__vars_8h_a097eccaabd6ae8b4fef83cccff85bb5d}{noLonelyPairs} from the current global settings within the library

Use \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()} for a completely threadsafe variant

\begin{DoxySeeAlso}{See also}
\hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()}, \hyperlink{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}{circfold()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em sequence}]RNA sequence \item[{\em structure}]A pointer to the character array where the secondary structure in dot-\/bracket notation will be written to \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the minimum free energy (MFE) in kcal/mol 
\end{DoxyReturn}
\hypertarget{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}{
\index{mfe\_\-fold@{mfe\_\-fold}!circfold@{circfold}}
\index{circfold@{circfold}!mfe_fold@{mfe\_\-fold}}
\subsubsection[{circfold}]{\setlength{\rightskip}{0pt plus 5cm}float circfold (const char $\ast$ {\em sequence}, \/  char $\ast$ {\em structure})}}
\label{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}


Compute minimum free energy and an appropriate secondary structure of a circular RNA sequence. This function essentially does the same thing as \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()}. However, it takes its model details, i.e. \hyperlink{fold__vars_8h_ab4b11c8d9c758430960896bc3fe82ead}{temperature}, \hyperlink{fold__vars_8h_a72b511ed1201f7e23ec437e468790d74}{dangles}, \hyperlink{fold__vars_8h_a4f6265bdf0ead7ff4628a360adbfd77e}{tetra\_\-loop}, \hyperlink{fold__vars_8h_abf380d09e4f1ab94fc6af57cf0ad5d32}{noGU}, \hyperlink{fold__vars_8h_aa8d1c7b92489179e1eafa562b7bdd259}{no\_\-closingGU}, \hyperlink{fold__vars_8h_a0afc287c2464866d94858c39175154af}{fold\_\-constrained}, \hyperlink{fold__vars_8h_a097eccaabd6ae8b4fef83cccff85bb5d}{noLonelyPairs} from the current global settings within the library

Use \hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()} for a completely threadsafe variant

\begin{DoxySeeAlso}{See also}
\hyperlink{group__mfe__fold_gadb973133c241d57c04b253df35e4d34e}{fold\_\-par()}, \hyperlink{group__mfe__fold_ga4ac63ab3e8d9a80ced28b8052d94e423}{circfold()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em sequence}]RNA sequence \item[{\em structure}]A pointer to the character array where the secondary structure in dot-\/bracket notation will be written to \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the minimum free energy (MFE) in kcal/mol 
\end{DoxyReturn}
