2f1e0005120f8330ab9852733437bdac75186af2
[jabaws.git] / binaries / src / ViennaRNA / H / inverse.h
1 #ifndef __VIENNA_RNA_PACKAGE_INVERSE_H__
2 #define __VIENNA_RNA_PACKAGE_INVERSE_H__
3
4 /**
5  */
6
7 /**
8  *  \addtogroup inverse_fold
9  *  We provide two functions that search for sequences with a given
10  *  structure, thereby inverting the folding routines.
11  *  
12  *  @{
13  *    \file inverse.h
14  *    \brief Inverse folding routines
15  */
16
17 /**
18  *  \brief This global variable points to the allowed bases, initially "AUGC".
19  *  It can be used to design sequences from reduced alphabets.
20  */
21 extern char *symbolset;
22 /** when to stop inverse_pf_fold() */
23 extern  float final_cost;
24 /** default 0: try to minimize structure distance even if no exact solution can be found */
25 extern  int   give_up;
26 /** print out substructure on which inverse_fold() fails */
27 extern  int   inv_verbose;
28
29 /**
30  *  \brief Find sequences with predefined structure
31  * 
32  *  This function searches for a sequence with minimum free energy structure
33  *  provided in the parameter 'target', starting with sequence 'start'.
34  *  It returns 0 if the search was successful, otherwise a structure distance
35  *  in terms of the energy difference between the search result and the actual
36  *  target 'target' is returned. The found sequence is returned in 'start'.
37  *  If #give_up is set to 1, the function will return as soon as it is
38  *  clear that the search will be unsuccessful, this speeds up the algorithm
39  *  if you are only interested in exact solutions.
40  * 
41  *  \param  start   The start sequence
42  *  \param  target  The target secondary structure in dot-bracket notation
43  *  \return         The distance to the target in case a search was unsuccessful, 0 otherwise
44  */
45 float inverse_fold( char *start,
46                     const char *target);
47
48 /**
49  *  \brief Find sequence that maximizes probability of a predefined structure
50  * 
51  *  This function searches for a sequence with maximum probability to fold into
52  *  the provided structure 'target' using the partition function algorithm.
53  *  It returns \f$-kT \cdot \log(p)\f$ where \f$p\f$ is the frequency of 'target' in
54  *  the ensemble of possible structures. This is usually much slower than
55  *  inverse_fold().
56  * 
57  *  \param  start   The start sequence
58  *  \param  target  The target secondary structure in dot-bracket notation
59  *  \return         The distance to the target in case a search was unsuccessful, 0 otherwise
60  */
61 float inverse_pf_fold(char *start,
62                       const char *target);
63
64 /**
65  *  @}
66  */
67 #endif