RNAlib-2.2.0-RC3
structure_utils.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_STRUCT_UTILS_H
2 #define VIENNA_RNA_PACKAGE_STRUCT_UTILS_H
3 
4 /* make this interface backward compatible with RNAlib < 2.2.0 */
5 #define VRNA_BACKWARD_COMPAT
6 
7 #ifdef __GNUC__
8 #define DEPRECATED(func) func __attribute__ ((deprecated))
9 #else
10 #define DEPRECATED(func) func
11 #endif
12 
22 #include <stdio.h>
23 
25 
26 typedef struct{
27  unsigned int start;
28  unsigned int end;
29  unsigned int length;
30  unsigned int up5;
31  unsigned int up3;
32 } vrna_helix;
33 
46 char *vrna_db_pack(const char *struc);
47 
58 char *vrna_db_unpack(const char *packed);
59 
69 short *vrna_pt_get(const char *structure);
70 
71 
84 short *vrna_pt_pk_get(const char *structure);
85 
92 short *vrna_pt_copy(const short *pt);
93 
98 short *vrna_pt_ali_get(const char *structure);
99 
107 short *vrna_pt_snoop_get(const char *structure);
108 
112 int *vrna_get_loop_index(const short *pt);
113 
120 char *vrna_pt_to_db(short *pt);
121 
122 
134 int vrna_bp_distance( const char *str1,
135  const char *str2);
136 
143 unsigned int *vrna_refBPcnt_matrix(const short *reference_pt,
144  unsigned int turn);
145 
153 unsigned int *vrna_refBPdist_matrix( const short *pt1,
154  const short *pt2,
155  unsigned int turn);
156 
160 char *vrna_db_get_from_pr(const FLT_OR_DBL *pr,
161  unsigned int length);
162 
166 char vrna_bpp_symbol(const float *x);
167 
172 void vrna_parenthesis_structure( char *structure,
173  bondT *bp,
174  unsigned int length);
175 
182 void vrna_parenthesis_zuker(char *structure,
183  bondT *bp,
184  unsigned int length);
185 
186 void vrna_letter_structure( char *structure,
187  bondT *bp,
188  unsigned int length);
189 
205 plist *vrna_pl_get(const char *struc, float pr);
206 
223 plist *vrna_pl_get_from_pr(vrna_fold_compound *vc, double cut_off);
224 
234 char *vrna_pl_to_db(plist *pairs, unsigned int n);
235 
236 
237 vrna_helix *vrna_pt_to_hx(short *pt);
238 vrna_helix *vrna_hx_merge(const vrna_helix *list, int maxdist);
239 
240 
241 #ifdef VRNA_BACKWARD_COMPAT
242 
243 /*###########################################*/
244 /*# deprecated functions below #*/
245 /*###########################################*/
246 
264 DEPRECATED(void assign_plist_from_db(plist **pl, const char *struc, float pr));
265 
278 DEPRECATED(char *pack_structure(const char *struc));
279 
290 DEPRECATED(char *unpack_structure(const char *packed));
291 
303 DEPRECATED(short *make_pair_table(const char *structure));
304 
305 DEPRECATED(short *make_pair_table_pk(const char *structure));
306 
315 DEPRECATED(short *copy_pair_table(const short *pt));
316 
322 DEPRECATED(short *alimake_pair_table(const char *structure));
323 
330 DEPRECATED(short *make_pair_table_snoop(const char *structure));
331 
332 DEPRECATED(int *make_loop_index_pt(short *pt));
333 
346 DEPRECATED(int bp_distance(const char *str1, const char *str2));
347 
356 DEPRECATED(unsigned int *make_referenceBP_array(short *reference_pt,
357  unsigned int turn));
366 DEPRECATED(unsigned int *compute_BPdifferences( short *pt1,
367  short *pt2,
368  unsigned int turn));
369 
389 DEPRECATED(void assign_plist_from_pr( plist **pl,
390  FLT_OR_DBL *probs,
391  int length,
392  double cutoff));
393 
401 DEPRECATED(void parenthesis_structure(char *structure,
402  bondT *bp,
403  int length));
404 
413 DEPRECATED(void parenthesis_zuker(char *structure,
414  bondT *bp,
415  int length));
416 
417 DEPRECATED(void letter_structure( char *structure,
418  bondT *bp,
419  int length));
420 
425 DEPRECATED(void bppm_to_structure(char *structure, FLT_OR_DBL *pr, unsigned int length));
426 
431 DEPRECATED(char bppm_symbol(const float *x));
432 
433 #endif
434 
439 #endif
plist * vrna_pl_get_from_pr(vrna_fold_compound *vc, double cut_off)
Create a plist from base pair probability matrix.
char vrna_bpp_symbol(const float *x)
Get a pseudo dot bracket notation for a given probability information.
void vrna_parenthesis_structure(char *structure, bondT *bp, unsigned int length)
Create a dot-backet/parenthesis structure from backtracking stack.
void vrna_parenthesis_zuker(char *structure, bondT *bp, unsigned int length)
Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calcul...
int vrna_bp_distance(const char *str1, const char *str2)
Compute the "base pair" distance between two secondary structures s1 and s2.
int * vrna_get_loop_index(const short *pt)
Get a loop index representation of a structure.
int bp_distance(const char *str1, const char *str2)
Compute the "base pair" distance between two secondary structures s1 and s2.
char * vrna_db_pack(const char *struc)
Pack secondary secondary structure, 5:1 compression using base 3 encoding.
void parenthesis_zuker(char *structure, bondT *bp, int length)
Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calcul...
void parenthesis_structure(char *structure, bondT *bp, int length)
Create a dot-backet/parenthesis structure from backtracking stack.
char * vrna_pt_to_db(short *pt)
Convert a pair table into dot-parenthesis notation.
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:698
void assign_plist_from_db(plist **pl, const char *struc, float pr)
Create a plist from a dot-bracket string.
short * vrna_pt_pk_get(const char *structure)
Create a pair table of a secondary structure (pseudo-knot version)
short * make_pair_table(const char *structure)
Create a pair table of a secondary structure.
char bppm_symbol(const float *x)
Get a pseudo dot bracket notation for a given probability information.
unsigned int * compute_BPdifferences(short *pt1, short *pt2, unsigned int turn)
Make a reference base pair distance matrix.
unsigned int * vrna_refBPdist_matrix(const short *pt1, const short *pt2, unsigned int turn)
Make a reference base pair distance matrix.
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:45
char * vrna_db_unpack(const char *packed)
Unpack secondary structure previously packed with vrna_db_pack()
void assign_plist_from_pr(plist **pl, FLT_OR_DBL *probs, int length, double cutoff)
Create a plist from a probability matrix.
short * copy_pair_table(const short *pt)
Get an exact copy of a pair table.
short * vrna_pt_copy(const short *pt)
Get an exact copy of a pair table.
short * vrna_pt_ali_get(const char *structure)
Create a pair table of a secondary structure (snoop align version)
char * vrna_db_get_from_pr(const FLT_OR_DBL *pr, unsigned int length)
Create a dot-bracket like structure string from base pair probability matrix.
Base pair.
Definition: data_structures.h:73
void bppm_to_structure(char *structure, FLT_OR_DBL *pr, unsigned int length)
Create a dot-bracket like structure string from base pair probability matrix.
plist * vrna_pl_get(const char *struc, float pr)
Create a plist from a dot-bracket string.
FLT_OR_DBL * pr
A pointer to the base pair probability matrix.
char * unpack_structure(const char *packed)
Unpack secondary structure previously packed with pack_structure()
char * pack_structure(const char *struc)
Pack secondary secondary structure, 5:1 compression using base 3 encoding.
short * alimake_pair_table(const char *structure)
char * vrna_pl_to_db(plist *pairs, unsigned int n)
Convert a list of base pairs into dot-bracket notation.
short * vrna_pt_snoop_get(const char *structure)
Create a pair table of a secondary structure (snoop version)
short * make_pair_table_snoop(const char *structure)
int pairs
contains the number of base pairs in the last parsed structure.
short * vrna_pt_get(const char *structure)
Create a pair table of a secondary structure.
Definition: structure_utils.h:26
unsigned int * vrna_refBPcnt_matrix(const short *reference_pt, unsigned int turn)
Make a reference base pair count matrix.
unsigned int * make_referenceBP_array(short *reference_pt, unsigned int turn)
Make a reference base pair count matrix.