1 #ifndef __VIENNA_RNA_PACKAGE_RNASTRUCT_H__
2 #define __VIENNA_RNA_PACKAGE_RNASTRUCT_H__
6 * \brief Parsing and Coarse Graining of Structures
10 * .((..(((...)))..((..)))). is the bracket or full tree
11 * becomes expanded: - expand_Full() -
12 * ((U)(((U)(U)((((U)(U)(U)P)P)P)(U)(U)(((U)(U)P)P)P)P)(U)R)
14 * ((U1)((U2)((U3)P3)(U2)((U2)P2)P2)(U1)R)
17 * becomes expanded: - expand_Shapiro() -
18 * (((((H)S)((H)S)M)S)R)
19 * weighted Shapiro: - b2Shapiro() -
20 * ((((((H3)S3)((H2)S2)M4)S2)E2)R)
27 * \brief Converts the full structure from bracket notation to the HIT
28 * notation including root.
33 char *b2HIT(const char *structure); /* Full -> HIT [incl. root] */
36 * \brief Converts the full structure from bracket notation to the a
37 * coarse grained notation using the 'H' 'B' 'I' 'M' and 'R' identifiers.
42 char *b2C(const char *structure); /* Full -> Coarse [incl. root] */
45 * \brief Converts the full structure from bracket notation to the
46 * <i>weighted</i> coarse grained notation using the 'H' 'B' 'I' 'M' 'S' 'E' and
52 char *b2Shapiro(const char *structure); /* Full -> weighted Shapiro [i.r.] */
55 * \brief Adds a root to an un-rooted tree in any except bracket notation.
60 char *add_root(const char *structure); /* {Tree} -> ({Tree}R) */
63 * \brief Inserts missing 'S' identifiers in unweighted coarse grained structures
64 * as obtained from b2C().
69 char *expand_Shapiro(const char *coarse);
71 /* add S for stacks to coarse struct */
73 * \brief Convert the full structure from bracket notation to the
74 * expanded notation including root.
79 char *expand_Full(const char *structure); /* Full -> FFull */
82 * \brief Restores the bracket notation from an expanded full or HIT tree, that is
83 * any tree using only identifiers 'U' 'P' and 'R'.
88 char *unexpand_Full(const char *ffull); /* FFull -> Full */
91 * \brief Strip weights from any weighted tree.
96 char *unweight(const char *wcoarse); /* remove weights from coarse struct */
99 * \brief Converts two aligned structures in expanded notation.
101 * Takes two aligned structures as produced by
102 * tree_edit_distance() function back to bracket notation with '_'
103 * as the gap character. The result overwrites the input.
107 void unexpand_aligned_F(char *align[2]);
110 * \brief Collects a statistic of structure elements of the full structure in
113 * The function writes to the following global variables:
114 * #loop_size, #loop_degree, #helix_size, #loops, #pairs, #unpaired
119 void parse_structure(const char *structure); /* make structure statistics */
122 * \brief contains a list of all loop sizes. loop_size[0] contains the
123 * number of external bases.
125 extern int loop_size[STRUC]; /* loop sizes of a structure */
128 * \brief contains a list of all stack sizes.
130 extern int helix_size[STRUC]; /* helix sizes of a structure */
133 * \brief contains the corresponding list of loop degrees.
135 extern int loop_degree[STRUC]; /* loop degrees of a structure */
138 * \brief contains the number of loops ( and therefore of stacks ).
140 extern int loops; /* n of loops and stacks */
143 * \brief contains the number of unpaired bases.
148 * \brief contains the number of base pairs in the last parsed structure.
150 extern int pairs; /* n of unpaired digits and pairs */