\hypertarget{group__kl__neighborhood__pf}{
\section{Calculate Partition Functions of a Distance Based Partitioning}
\label{group__kl__neighborhood__pf}\index{Calculate Partition Functions of a Distance Based Partitioning@{Calculate Partition Functions of a Distance Based Partitioning}}
}


Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary structure space according to the base pair distance to two fixed reference structures.  


Collaboration diagram for Calculate Partition Functions of a Distance Based Partitioning:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=332pt]{group__kl__neighborhood__pf}
\end{center}
\end{figure}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \hyperlink{2Dpfold_8h}{2Dpfold.h}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} $\ast$ \hyperlink{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{get\_\-TwoDpfold\_\-variables} (const char $\ast$seq, const char $\ast$structure1, char $\ast$structure2, int \hyperlink{fold__vars_8h_af9202a1a09f5828dc731e2d9a10fa111}{circ})
\begin{DoxyCompactList}\small\item\em Get a datastructure containing all necessary attributes and global folding switches. \item\end{DoxyCompactList}\item 
\hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} $\ast$ \hyperlink{group__kl__neighborhood__pf_gacc2f66da7ee62096cab629fce7112216}{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE} (\hyperlink{structTwoDfold__vars}{TwoDfold\_\-vars} $\ast$mfe\_\-vars)
\begin{DoxyCompactList}\small\item\em Get the datastructure containing all necessary attributes and global folding switches from a pre-\/filled mfe-\/datastructure. \item\end{DoxyCompactList}\item 
void \hyperlink{group__kl__neighborhood__pf_gafe994291458ee2ac34d3eb825ef62a15}{destroy\_\-TwoDpfold\_\-variables} (\hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} $\ast$vars)
\begin{DoxyCompactList}\small\item\em Free all memory occupied by a \hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} datastructure. \item\end{DoxyCompactList}\item 
\hyperlink{structTwoDpfold__solution}{TwoDpfold\_\-solution} $\ast$ \hyperlink{group__kl__neighborhood__pf_ga3e1cd3b24eb635c65181182cbb4ae3eb}{TwoDpfoldList} (\hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} $\ast$vars, int maxDistance1, int maxDistance2)
\begin{DoxyCompactList}\small\item\em Compute the partition function for all distance classes. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary structure space according to the base pair distance to two fixed reference structures. 

\subsection{Function Documentation}
\hypertarget{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{
\index{kl\_\-neighborhood\_\-pf@{kl\_\-neighborhood\_\-pf}!get\_\-TwoDpfold\_\-variables@{get\_\-TwoDpfold\_\-variables}}
\index{get\_\-TwoDpfold\_\-variables@{get\_\-TwoDpfold\_\-variables}!kl_neighborhood_pf@{kl\_\-neighborhood\_\-pf}}
\subsubsection[{get\_\-TwoDpfold\_\-variables}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TwoDpfold\_\-vars}$\ast$ get\_\-TwoDpfold\_\-variables (const char $\ast$ {\em seq}, \/  const char $\ast$ {\em structure1}, \/  char $\ast$ {\em structure2}, \/  int {\em circ})}}
\label{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}


Get a datastructure containing all necessary attributes and global folding switches. This function prepares all necessary attributes and matrices etc which are needed for a call of TwoDpfoldList. A snapshot of all current global model switches (dangles, temperature and so on) is done and stored in the returned datastructure. Additionally, all matrices that will hold the partition function values are prepared.


\begin{DoxyParams}{Parameters}
\item[{\em seq}]the RNA sequence in uppercase format with letters from the alphabet \{AUCG\} \item[{\em structure1}]the first reference structure in dot-\/bracket notation \item[{\em structure2}]the second reference structure in dot-\/bracket notation \item[{\em circ}]a switch indicating if the sequence is linear (0) or circular (1) \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the datastructure containing all necessary partition function attributes 
\end{DoxyReturn}
\hypertarget{group__kl__neighborhood__pf_gacc2f66da7ee62096cab629fce7112216}{
\index{kl\_\-neighborhood\_\-pf@{kl\_\-neighborhood\_\-pf}!get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE@{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE}}
\index{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE@{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE}!kl_neighborhood_pf@{kl\_\-neighborhood\_\-pf}}
\subsubsection[{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TwoDpfold\_\-vars}$\ast$ get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE ({\bf TwoDfold\_\-vars} $\ast$ {\em mfe\_\-vars})}}
\label{group__kl__neighborhood__pf_gacc2f66da7ee62096cab629fce7112216}


Get the datastructure containing all necessary attributes and global folding switches from a pre-\/filled mfe-\/datastructure. This function actually does the same as get\_\-TwoDpfold\_\-variables but takes its switches and settings from a pre-\/filled MFE equivalent datastructure

\begin{DoxySeeAlso}{See also}
\hyperlink{group__kl__neighborhood__mfe_gac9284f132cf0eaa0a2f43590eda05488}{get\_\-TwoDfold\_\-variables()}, \hyperlink{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{get\_\-TwoDpfold\_\-variables()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em mfe\_\-vars}]the pre-\/filled mfe datastructure \end{DoxyParams}
\begin{DoxyReturn}{Returns}
the datastructure containing all necessary partition function attributes 
\end{DoxyReturn}
\hypertarget{group__kl__neighborhood__pf_gafe994291458ee2ac34d3eb825ef62a15}{
\index{kl\_\-neighborhood\_\-pf@{kl\_\-neighborhood\_\-pf}!destroy\_\-TwoDpfold\_\-variables@{destroy\_\-TwoDpfold\_\-variables}}
\index{destroy\_\-TwoDpfold\_\-variables@{destroy\_\-TwoDpfold\_\-variables}!kl_neighborhood_pf@{kl\_\-neighborhood\_\-pf}}
\subsubsection[{destroy\_\-TwoDpfold\_\-variables}]{\setlength{\rightskip}{0pt plus 5cm}void destroy\_\-TwoDpfold\_\-variables ({\bf TwoDpfold\_\-vars} $\ast$ {\em vars})}}
\label{group__kl__neighborhood__pf_gafe994291458ee2ac34d3eb825ef62a15}


Free all memory occupied by a \hyperlink{structTwoDpfold__vars}{TwoDpfold\_\-vars} datastructure. This function free's all memory occupied by a datastructure obtained from from \hyperlink{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{get\_\-TwoDpfold\_\-variables()} or \hyperlink{group__kl__neighborhood__pf_gacc2f66da7ee62096cab629fce7112216}{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE()}

\begin{DoxySeeAlso}{See also}
\hyperlink{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{get\_\-TwoDpfold\_\-variables()}, \hyperlink{group__kl__neighborhood__pf_gacc2f66da7ee62096cab629fce7112216}{get\_\-TwoDpfold\_\-variables\_\-from\_\-MFE()}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em vars}]the datastructure to be free'd \end{DoxyParams}
\hypertarget{group__kl__neighborhood__pf_ga3e1cd3b24eb635c65181182cbb4ae3eb}{
\index{kl\_\-neighborhood\_\-pf@{kl\_\-neighborhood\_\-pf}!TwoDpfoldList@{TwoDpfoldList}}
\index{TwoDpfoldList@{TwoDpfoldList}!kl_neighborhood_pf@{kl\_\-neighborhood\_\-pf}}
\subsubsection[{TwoDpfoldList}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TwoDpfold\_\-solution}$\ast$ TwoDpfoldList ({\bf TwoDpfold\_\-vars} $\ast$ {\em vars}, \/  int {\em maxDistance1}, \/  int {\em maxDistance2})}}
\label{group__kl__neighborhood__pf_ga3e1cd3b24eb635c65181182cbb4ae3eb}


Compute the partition function for all distance classes. This function computes the partition functions for all distance classes according the two reference structures specified in the datastructure 'vars'. Similar to \hyperlink{group__kl__neighborhood__mfe_ga47da790166020558d27323aef489703e}{TwoDfoldList()} the arguments maxDistance1 and maxDistance2 specify the maximum distance to both reference structures. A value of '-\/1' in either of them makes the appropriate distance restrictionless, i.e. all basepair distancies to the reference are taken into account during computation. In case there is a restriction, the returned solution contains an entry where the attribute k=l=-\/1 contains the partition function for all structures exceeding the restriction. A values of \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF} in the attribute 'k' of the returned list denotes the end of the list

\begin{DoxySeeAlso}{See also}
\hyperlink{group__kl__neighborhood__pf_ga1aca740e2a75ab2b2951538266e53d64}{get\_\-TwoDpfold\_\-variables()}, \hyperlink{group__kl__neighborhood__pf_gafe994291458ee2ac34d3eb825ef62a15}{destroy\_\-TwoDpfold\_\-variables()}, \hyperlink{structTwoDpfold__solution}{TwoDpfold\_\-solution}
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
\item[{\em vars}]the datastructure containing all necessary folding attributes and matrices \item[{\em maxDistance1}]the maximum basepair distance to reference1 (may be -\/1) \item[{\em maxDistance2}]the maximum basepair distance to reference2 (may be -\/1) \end{DoxyParams}
\begin{DoxyReturn}{Returns}
a list of partition funtions for the appropriate distance classes 
\end{DoxyReturn}
