RNAlib-2.3.1
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 DEPRECATION_WARNINGS
8 # ifdef __GNUC__
9 # define DEPRECATED(func) func __attribute__ ((deprecated))
10 # else
11 # define DEPRECATED(func) func
12 # endif
13 #else
14 # define DEPRECATED(func) func
15 #endif
16 
31 typedef struct vrna_hx_s vrna_hx_t;
32 
33 #include <stdio.h>
34 
36 
40 struct vrna_hx_s {
41  unsigned int start;
42  unsigned int end;
43  unsigned int length;
44  unsigned int up5;
45  unsigned int up3;
46 };
47 
60 char *vrna_db_pack(const char *struc);
61 
72 char *vrna_db_unpack(const char *packed);
73 
83 short *vrna_ptable(const char *structure);
84 
85 
98 short *vrna_pt_pk_get(const char *structure);
99 
106 short *vrna_ptable_copy(const short *pt);
107 
112 short *vrna_pt_ali_get(const char *structure);
113 
121 short *vrna_pt_snoop_get(const char *structure);
122 
126 int *vrna_loopidx_from_ptable(const short *pt);
127 
134 char *vrna_db_from_ptable(short *pt);
135 
136 
148 int vrna_bp_distance( const char *str1,
149  const char *str2);
150 
157 unsigned int *vrna_refBPcnt_matrix(const short *reference_pt,
158  unsigned int turn);
159 
167 unsigned int *vrna_refBPdist_matrix( const short *pt1,
168  const short *pt2,
169  unsigned int turn);
170 
174 char *vrna_db_from_probs( const FLT_OR_DBL *pr,
175  unsigned int length);
176 
180 char vrna_bpp_symbol(const float *x);
181 
194  unsigned int length);
195 
196 void vrna_letter_structure( char *structure,
197  vrna_bp_stack_t *bp,
198  unsigned int length);
199 
215 vrna_plist_t *vrna_plist(const char *struc, float pr);
216 
234 
244 char *vrna_db_from_plist(vrna_plist_t *pairs, unsigned int n);
245 
246 char *vrna_db_to_element_string(const char *structure);
247 
248 vrna_hx_t *vrna_hx_from_ptable(short *pt);
249 vrna_hx_t *vrna_hx_merge(const vrna_hx_t *list, int maxdist);
250 
251 #ifdef VRNA_BACKWARD_COMPAT
252 
253 /*###########################################*/
254 /*# deprecated functions below #*/
255 /*###########################################*/
256 
274 DEPRECATED(void assign_plist_from_db(vrna_plist_t **pl, const char *struc, float pr));
275 
288 DEPRECATED(char *pack_structure(const char *struc));
289 
300 DEPRECATED(char *unpack_structure(const char *packed));
301 
313 DEPRECATED(short *make_pair_table(const char *structure));
314 
315 DEPRECATED(short *make_pair_table_pk(const char *structure));
316 
325 DEPRECATED(short *copy_pair_table(const short *pt));
326 
332 DEPRECATED(short *alimake_pair_table(const char *structure));
333 
340 DEPRECATED(short *make_pair_table_snoop(const char *structure));
341 
342 DEPRECATED(int *make_loop_index_pt(short *pt));
343 
356 DEPRECATED(int bp_distance(const char *str1, const char *str2));
357 
366 DEPRECATED(unsigned int *make_referenceBP_array(short *reference_pt,
367  unsigned int turn));
376 DEPRECATED(unsigned int *compute_BPdifferences( short *pt1,
377  short *pt2,
378  unsigned int turn));
379 
399 DEPRECATED(void assign_plist_from_pr( vrna_plist_t **pl,
400  FLT_OR_DBL *probs,
401  int length,
402  double cutoff));
403 
411 DEPRECATED(void parenthesis_structure(char *structure,
412  vrna_bp_stack_t *bp,
413  int length));
414 
423 DEPRECATED(void parenthesis_zuker(char *structure,
424  vrna_bp_stack_t *bp,
425  int length));
426 
427 DEPRECATED(void letter_structure( char *structure,
428  vrna_bp_stack_t *bp,
429  int length));
430 
435 DEPRECATED(void bppm_to_structure(char *structure, FLT_OR_DBL *pr, unsigned int length));
436 
441 DEPRECATED(char bppm_symbol(const float *x));
442 
443 #endif
444 
449 #endif
char vrna_bpp_symbol(const float *x)
Get a pseudo dot bracket notation for a given probability information.
vrna_plist_t * vrna_plist_from_probs(vrna_fold_compound_t *vc, double cut_off)
Create a vrna_plist_t from base pair probability matrix.
int * vrna_loopidx_from_ptable(const short *pt)
Get a loop index representation of a structure.
int vrna_bp_distance(const char *str1, const char *str2)
Compute the "base pair" distance between two secondary structures s1 and s2.
vrna_plist_t * vrna_plist(const char *struc, float pr)
Create a vrna_plist_t from a dot-bracket string.
Data structure representing an entry of a helix list.
Definition: structure_utils.h:40
char * vrna_db_from_plist(vrna_plist_t *pairs, unsigned int n)
Convert a list of base pairs into dot-bracket notation.
char * vrna_db_from_bp_stack(vrna_bp_stack_t *bp, unsigned int length)
Create a dot-backet/parenthesis structure from backtracking stack.
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.
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:48
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:454
short * vrna_ptable(const char *structure)
Create a pair table of a secondary structure.
char * vrna_db_from_probs(const FLT_OR_DBL *pr, unsigned int length)
Create a dot-bracket like structure string from base pair probability matrix.
void parenthesis_zuker(char *structure, vrna_bp_stack_t *bp, int length)
Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calcul...
char * vrna_db_from_ptable(short *pt)
Convert a pair table into dot-parenthesis notation.
Various data structures and pre-processor macros.
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.
char * vrna_db_unpack(const char *packed)
Unpack secondary structure previously packed with vrna_db_pack()
short * copy_pair_table(const short *pt)
Get an exact copy of a pair table.
void assign_plist_from_db(vrna_plist_t **pl, const char *struc, float pr)
Create a vrna_plist_t from a dot-bracket string.
short * vrna_pt_ali_get(const char *structure)
Create a pair table of a secondary structure (snoop align version)
void assign_plist_from_pr(vrna_plist_t **pl, FLT_OR_DBL *probs, int length, double cutoff)
Create a vrna_plist_t from a probability matrix.
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:182
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.
void parenthesis_structure(char *structure, vrna_bp_stack_t *bp, int length)
Create a dot-backet/parenthesis structure from backtracking stack.
Base pair stack element.
Definition: data_structures.h:222
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)
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)
short * vrna_ptable_copy(const short *pt)
Get an exact copy of a pair table.
int pairs
contains the number of base pairs in the last parsed structure.
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.