RNAlib-2.2.0RC0
structure_utils.h File Reference

Various utility- and helper-functions for secondary structure parsing, converting, etc. More...

+ Include dependency graph for structure_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * vrna_pack_structure (const char *struc)
 Pack secondary secondary structure, 5:1 compression using base 3 encoding. More...
 
char * pack_structure (const char *struc)
 Pack secondary secondary structure, 5:1 compression using base 3 encoding. More...
 
char * vrna_unpack_structure (const char *packed)
 Unpack secondary structure previously packed with pack_structure() More...
 
char * unpack_structure (const char *packed)
 Unpack secondary structure previously packed with pack_structure() More...
 
short * vrna_pt_get (const char *structure)
 Create a pair table of a secondary structure. More...
 
short * make_pair_table (const char *structure)
 Create a pair table of a secondary structure. More...
 
short * vrna_pt_pk_get (const char *structure)
 Create a pair table of a secondary structure (pseudo-knot version) More...
 
short * vrna_pt_copy (const short *pt)
 Get an exact copy of a pair table. More...
 
short * copy_pair_table (const short *pt)
 Get an exact copy of a pair table. More...
 
short * vrna_pt_ali_get (const char *structure)
 Create a pair table of a secondary structure (snoop align version)
 
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) More...
 
short * make_pair_table_snoop (const char *structure)
 
int * vrna_get_loop_index (const short *pt)
 Get a loop index representation of a structure.
 
char * vrna_pt_to_db (short *pt)
 Convert a pair table into dot-parenthesis notation. More...
 
int vrna_bp_distance (const char *str1, const char *str2)
 Compute the "base pair" distance between two secondary structures s1 and s2. More...
 
int bp_distance (const char *str1, const char *str2)
 Compute the "base pair" distance between two secondary structures s1 and s2. More...
 
unsigned int * vrna_refBPcnt_matrix (const short *reference_pt, unsigned int turn)
 Make a reference base pair count matrix. More...
 
unsigned int * make_referenceBP_array (short *reference_pt, unsigned int turn)
 Make a reference base pair count matrix. More...
 
unsigned int * vrna_refBPdist_matrix (const short *pt1, const short *pt2, unsigned int turn)
 Make a reference base pair distance matrix. More...
 
unsigned int * compute_BPdifferences (short *pt1, short *pt2, unsigned int turn)
 Make a reference base pair distance matrix. More...
 
plistvrna_get_plist_from_pr (vrna_fold_compound *vc, double cut_off)
 Create a plist from base pair probability matrix. More...
 
void assign_plist_from_pr (plist **pl, FLT_OR_DBL *probs, int length, double cutoff)
 Create a plist from a probability matrix. More...
 
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.
 
char bppm_symbol (const float *x)
 Get a pseudo dot bracket notation for a given probability information.
 
void vrna_parenthesis_structure (char *structure, bondT *bp, int length)
 Create a dot-backet/parenthesis structure from backtracking stack.
 
void parenthesis_structure (char *structure, bondT *bp, int length)
 Create a dot-backet/parenthesis structure from backtracking stack. More...
 
void vrna_parenthesis_zuker (char *structure, bondT *bp, int length)
 Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calculation in cofold.c. More...
 
void parenthesis_zuker (char *structure, bondT *bp, int length)
 Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calculation in cofold.c. More...
 
plistvrna_get_plist_from_db (const char *struc, float pr)
 Create a plist from a dot-bracket string. More...
 
void assign_plist_from_db (plist **pl, const char *struc, float pr)
 Create a plist from a dot-bracket string. More...
 

Detailed Description

Various utility- and helper-functions for secondary structure parsing, converting, etc.

Function Documentation

char* vrna_pack_structure ( const char *  struc)

Pack secondary secondary structure, 5:1 compression using base 3 encoding.

Returns a binary string encoding of the secondary structure using a 5:1 compression scheme. The string is NULL terminated and can therefore be used with standard string functions such as strcmp(). Useful for programs that need to keep many structures in memory.

Parameters
strucThe secondary structure in dot-bracket notation
Returns
The binary encoded structure
char* pack_structure ( const char *  struc)

Pack secondary secondary structure, 5:1 compression using base 3 encoding.

Returns a binary string encoding of the secondary structure using a 5:1 compression scheme. The string is NULL terminated and can therefore be used with standard string functions such as strcmp(). Useful for programs that need to keep many structures in memory.

Deprecated:
Use vrna_pack_structure() as a replacement
Parameters
strucThe secondary structure in dot-bracket notation
Returns
The binary encoded structure
char* vrna_unpack_structure ( const char *  packed)

Unpack secondary structure previously packed with pack_structure()

Translate a compressed binary string produced by pack_structure() back into the familiar dot-bracket notation.

Parameters
packedThe binary encoded packed secondary structure
Returns
The unpacked secondary structure in dot-bracket notation
char* unpack_structure ( const char *  packed)

Unpack secondary structure previously packed with pack_structure()

Translate a compressed binary string produced by pack_structure() back into the familiar dot-bracket notation.

Deprecated:
Use vrna_unpack_structure() as a replacement
Parameters
packedThe binary encoded packed secondary structure
Returns
The unpacked secondary structure in dot-bracket notation
short* vrna_pt_get ( const char *  structure)

Create a pair table of a secondary structure.

Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the structure.

Parameters
structureThe secondary structure in dot-bracket notation
Returns
A pointer to the created pair_table
short* make_pair_table ( const char *  structure)

Create a pair table of a secondary structure.

Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the structure.

Deprecated:
Use vrna_pt_get() instead
Parameters
structureThe secondary structure in dot-bracket notation
Returns
A pointer to the created pair_table
short* vrna_pt_pk_get ( const char *  structure)

Create a pair table of a secondary structure (pseudo-knot version)

Returns a newly allocated table, such that table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the structure.

In contrast to vrna_pt_get() this function also recognizes the base pairs denoted by '[' and ']' brackets.

Parameters
structureThe secondary structure in (extended) dot-bracket notation
Returns
A pointer to the created pair_table
short* vrna_pt_copy ( const short *  pt)

Get an exact copy of a pair table.

Parameters
ptThe pair table to be copied
Returns
A pointer to the copy of 'pt'
short* copy_pair_table ( const short *  pt)

Get an exact copy of a pair table.

Deprecated:
Use vrna_pt_copy() instead
Parameters
ptThe pair table to be copied
Returns
A pointer to the copy of 'pt'
short* alimake_pair_table ( const char *  structure)

Pair table for snoop align

Deprecated:
Use vrna_pt_ali_get() instead!
short* vrna_pt_snoop_get ( const char *  structure)

Create a pair table of a secondary structure (snoop version)

returns a newly allocated table, such that: table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the structure. The special pseudoknotted H/ACA-mRNA structure is taken into account.

short* make_pair_table_snoop ( const char *  structure)

returns a newly allocated table, such that: table[i]=j if (i.j) pair or 0 if i is unpaired, table[0] contains the length of the structure. The special pseudoknotted H/ACA-mRNA structure is taken into account.

Deprecated:
Use vrna_pt_snoop_get() instead!
char* vrna_pt_to_db ( short *  pt)

Convert a pair table into dot-parenthesis notation.

Parameters
ptThe pair table to be copied
Returns
A char pointer to the dot-bracket string
int vrna_bp_distance ( const char *  str1,
const char *  str2 
)

Compute the "base pair" distance between two secondary structures s1 and s2.

The sequences should have the same length. dist = number of base pairs in one structure but not in the other same as edit distance with open-pair close-pair as move-set

Parameters
str1First structure in dot-bracket notation
str2Second structure in dot-bracket notation
Returns
The base pair distance between str1 and str2
int bp_distance ( const char *  str1,
const char *  str2 
)

Compute the "base pair" distance between two secondary structures s1 and s2.

The sequences should have the same length. dist = number of base pairs in one structure but not in the other same as edit distance with open-pair close-pair as move-set

Deprecated:
Use vrna_bp_distance instead
Parameters
str1First structure in dot-bracket notation
str2Second structure in dot-bracket notation
Returns
The base pair distance between str1 and str2
unsigned int* vrna_refBPcnt_matrix ( const short *  reference_pt,
unsigned int  turn 
)

Make a reference base pair count matrix.

Get an upper triangular matrix containing the number of basepairs of a reference structure for each interval [i,j] with i<j. Access it via iindx!!!

unsigned int* make_referenceBP_array ( short *  reference_pt,
unsigned int  turn 
)

Make a reference base pair count matrix.

Get an upper triangular matrix containing the number of basepairs of a reference structure for each interval [i,j] with i<j. Access it via iindx!!!

Deprecated:
Use vrna_refBPcnt_matrix() instead
unsigned int* vrna_refBPdist_matrix ( const short *  pt1,
const short *  pt2,
unsigned int  turn 
)

Make a reference base pair distance matrix.

Get an upper triangular matrix containing the base pair distance of two reference structures for each interval [i,j] with i<j. Access it via iindx!!!

unsigned int* compute_BPdifferences ( short *  pt1,
short *  pt2,
unsigned int  turn 
)

Make a reference base pair distance matrix.

Get an upper triangular matrix containing the base pair distance of two reference structures for each interval [i,j] with i<j. Access it via iindx!!!

Deprecated:
Use vrna_refBPdist_matrix() instead
void parenthesis_structure ( char *  structure,
bondT bp,
int  length 
)

Create a dot-backet/parenthesis structure from backtracking stack.

Deprecated:
use vrna_parenthesis_structure() instead
Note
This function is threadsafe
void vrna_parenthesis_zuker ( char *  structure,
bondT bp,
int  length 
)

Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calculation in cofold.c.

Note
This function is threadsafe
void parenthesis_zuker ( char *  structure,
bondT bp,
int  length 
)

Create a dot-backet/parenthesis structure from backtracking stack obtained by zuker suboptimal calculation in cofold.c.

Deprecated:
use vrna_parenthesis_zuker instead
Note
This function is threadsafe
plist* vrna_get_plist_from_db ( const char *  struc,
float  pr 
)

Create a plist from a dot-bracket string.

The dot-bracket string is parsed and for each base pair an entry in the plist is created. The probability of each pair in the list is set by a function parameter.

The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries

Parameters
strucThe secondary structure in dot-bracket notation
prThe probability for each base pair used in the plist
Returns
The plist array
void assign_plist_from_db ( plist **  pl,
const char *  struc,
float  pr 
)

Create a plist from a dot-bracket string.

The dot-bracket string is parsed and for each base pair an entry in the plist is created. The probability of each pair in the list is set by a function parameter.

The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries

Deprecated:
Use vrna_get_plist_from_db() instead
Parameters
plA pointer to the plist that is to be created
strucThe secondary structure in dot-bracket notation
prThe probability for each base pair