\hypertarget{group__up__cofold}{
\section{Partition Function for two hybridized Sequences as a stepwise Process}
\label{group__up__cofold}\index{Partition Function for two hybridized Sequences as a stepwise Process@{Partition Function for two hybridized Sequences as a stepwise Process}}
}


Partition Function Cofolding as a stepwise process.  


Collaboration diagram for Partition Function for two hybridized Sequences as a stepwise Process:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=359pt]{group__up__cofold}
\end{center}
\end{figure}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \hyperlink{part__func__up_8h}{part\_\-func\_\-up.h}


\begin{DoxyCompactList}\small\item\em Partition Function Cofolding as stepwise process. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structpu__contrib}{pu\_\-contrib} $\ast$ \hyperlink{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{pf\_\-unstru} (char $\ast$sequence, int max\_\-w)
\begin{DoxyCompactList}\small\item\em Calculate the partition function over all unpaired regions of a maximal length. \item\end{DoxyCompactList}\item 
\hyperlink{structinteract}{interact} $\ast$ \hyperlink{group__up__cofold_ga1aa0aa02bc3a724f87360c03097afd00}{pf\_\-interact} (const char $\ast$s1, const char $\ast$s2, \hyperlink{structpu__contrib}{pu\_\-contrib} $\ast$p\_\-c, \hyperlink{structpu__contrib}{pu\_\-contrib} $\ast$p\_\-c2, int max\_\-w, char $\ast$cstruc, int incr3, int incr5)
\begin{DoxyCompactList}\small\item\em Calculates the probability of a local interaction between two sequences. \item\end{DoxyCompactList}\item 
\hypertarget{group__up__cofold_gadde308fd5f696dc271b1532aa96fd12f}{
void \hyperlink{group__up__cofold_gadde308fd5f696dc271b1532aa96fd12f}{free\_\-interact} (\hyperlink{structinteract}{interact} $\ast$pin)}
\label{group__up__cofold_gadde308fd5f696dc271b1532aa96fd12f}

\begin{DoxyCompactList}\small\item\em Frees the output of function \hyperlink{group__up__cofold_ga1aa0aa02bc3a724f87360c03097afd00}{pf\_\-interact()}. \item\end{DoxyCompactList}\item 
\hypertarget{group__up__cofold_gac20bd61824981d45ce0dc9934aa56df8}{
void \hyperlink{group__up__cofold_gac20bd61824981d45ce0dc9934aa56df8}{free\_\-pu\_\-contrib\_\-struct} (\hyperlink{structpu__contrib}{pu\_\-contrib} $\ast$pu)}
\label{group__up__cofold_gac20bd61824981d45ce0dc9934aa56df8}

\begin{DoxyCompactList}\small\item\em Frees the output of function \hyperlink{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{pf\_\-unstru()}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Partition Function Cofolding as a stepwise process. 

\subsection{Function Documentation}
\hypertarget{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{
\index{up\_\-cofold@{up\_\-cofold}!pf\_\-unstru@{pf\_\-unstru}}
\index{pf\_\-unstru@{pf\_\-unstru}!up_cofold@{up\_\-cofold}}
\subsubsection[{pf\_\-unstru}]{\setlength{\rightskip}{0pt plus 5cm}{\bf pu\_\-contrib}$\ast$ pf\_\-unstru (char $\ast$ {\em sequence}, \/  int {\em max\_\-w})}}
\label{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}


Calculate the partition function over all unpaired regions of a maximal length. You have to call function \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\_\-fold()} providing the same sequence before calling \hyperlink{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{pf\_\-unstru()}. If you want to calculate unpaired regions for a constrained structure, set variable 'structure' in function 'pf\_\-fold()' to the \hyperlink{structconstrain}{constrain} string. It returns a \hyperlink{structpu__contrib}{pu\_\-contrib} struct containing four arrays of dimension \mbox{[}i = 1 to length(sequence)\mbox{]}\mbox{[}j = 0 to u-\/1\mbox{]} containing all possible contributions to the probabilities of unpaired regions of maximum length u. Each array in \hyperlink{structpu__contrib}{pu\_\-contrib} contains one of the contributions to the total probability of being unpaired: The probability of being unpaired within an exterior loop is in array \hyperlink{structpu__contrib}{pu\_\-contrib}-\/$>$E, the probability of being unpaired within a hairpin loop is in array \hyperlink{structpu__contrib}{pu\_\-contrib}-\/$>$H, the probability of being unpaired within an interior loop is in array \hyperlink{structpu__contrib}{pu\_\-contrib}-\/$>$I and probability of being unpaired within a multi-\/loop is in array \hyperlink{structpu__contrib}{pu\_\-contrib}-\/$>$M. The total probability of being unpaired is the sum of the four arrays of \hyperlink{structpu__contrib}{pu\_\-contrib}.

This function frees everything allocated automatically. To free the output structure call free\_\-pu\_\-contrib().


\begin{DoxyParams}{Parameters}
\item[{\em sequence}]\item[{\em max\_\-w}]\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{group__up__cofold_ga1aa0aa02bc3a724f87360c03097afd00}{
\index{up\_\-cofold@{up\_\-cofold}!pf\_\-interact@{pf\_\-interact}}
\index{pf\_\-interact@{pf\_\-interact}!up_cofold@{up\_\-cofold}}
\subsubsection[{pf\_\-interact}]{\setlength{\rightskip}{0pt plus 5cm}{\bf interact}$\ast$ pf\_\-interact (const char $\ast$ {\em s1}, \/  const char $\ast$ {\em s2}, \/  {\bf pu\_\-contrib} $\ast$ {\em p\_\-c}, \/  {\bf pu\_\-contrib} $\ast$ {\em p\_\-c2}, \/  int {\em max\_\-w}, \/  char $\ast$ {\em cstruc}, \/  int {\em incr3}, \/  int {\em incr5})}}
\label{group__up__cofold_ga1aa0aa02bc3a724f87360c03097afd00}


Calculates the probability of a local interaction between two sequences. The function considers the probability that the region of interaction is unpaired within 's1' and 's2'. The longer sequence has to be given as 's1'. The shorter sequence has to be given as 's2'. Function \hyperlink{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{pf\_\-unstru()} has to be called for 's1' and 's2', where the probabilities of being unpaired have to be given in 'p\_\-c' and 'p\_\-c2', respectively. If you do not want to include the probabilities of being unpaired for 's2' set 'p\_\-c2' to NULL. If variable 'cstruc' is not NULL, constrained folding is done: The available constrains for intermolecular interaction are: '.' (no \hyperlink{structconstrain}{constrain}), 'x' (the base has no intermolecular interaction) and '$|$' (the corresponding base has to be paired intermolecularily).\par
 The parameter 'w' determines the maximal length of the interaction. The parameters 'incr5' and 'incr3' allows inclusion of unpaired residues left ('incr5') and right ('incr3') of the region of interaction in 's1'. If the 'incr' options are used, function \hyperlink{group__up__cofold_ga5b4ee40e190d2f633cd01cf0d2fe93cf}{pf\_\-unstru()} has to be called with w=w+incr5+incr3 for the longer sequence 's1'.

It returns a structure of type \hyperlink{structinteract}{interact} which contains the probability of the best local interaction including residue i in Pi and the minimum free energy in Gi, where i is the position in sequence 's1'. The member Gikjl of structure \hyperlink{structinteract}{interact} is the best interaction between region \mbox{[}k,i\mbox{]} k$<$i in longer sequence 's1' and region \mbox{[}j,l\mbox{]} j$<$l in 's2'. Gikjl\_\-wo is Gikjl without the probability of beeing unpaired.\par
 Use \hyperlink{group__up__cofold_gadde308fd5f696dc271b1532aa96fd12f}{free\_\-interact()} to free the returned structure, all other stuff is freed inside \hyperlink{group__up__cofold_ga1aa0aa02bc3a724f87360c03097afd00}{pf\_\-interact()}.


\begin{DoxyParams}{Parameters}
\item[{\em s1}]\item[{\em s2}]\item[{\em p\_\-c}]\item[{\em p\_\-c2}]\item[{\em max\_\-w}]\item[{\em cstruc}]\item[{\em incr3}]\item[{\em incr5}]\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
