Structure Modules and Pseudoknots#

Basic Structure Modules API#

Pseudoknots#

Implementations to predict pseudoknotted structures.

Typedefs

typedef int (*vrna_pk_plex_score_f)(const short *pt, int start_5, int end_5, int start_3, int end_3, void *data)#

Pseudoknot loop scoring function prototype.

#include <ViennaRNA/pk_plex.h>

This function is used to evaluate a formed pseudoknot (PK) interaction in vrna_pk_plex(). It is supposed to take a PK-free secondary structure as input and coordinates of an additional interaction site. From this data, the energy (penalty) to score the PK loop is derived and returned in decakal/mol. Upon passing zero in any of the interaction site coordinates (start_5, end_5, start_3, end_3) or a NULL pointer in pt, the function must return a PK loop score. This minimum PK loop score is used in the first phase of the heuristic implemented in vrna_pk_plex() to assess whether a particular interaction is further taken into account in a later, more thorough evaluation step.

The simplest scoring function would simply return a constant score for any PK loop, no matter what type of loop is formed and how large the loop is. This is the default if vrna_pk_plex_opt_defaults() or vrna_pk_plex_opt() is used to generate options for vrna_pk_plex().

Param pt:

The secondary structure (without pseudoknot) in pair table notation

Param start_5:

The start coordinate of the 5’ site of the pseudoknot interaction

Param end_5:

The end coordinate of the 5’ site of the pseudoknot interaction

Param start_3:

The start coordinate of the 3’ site of the pseudoknot interaction

Param end_3:

The end coordinate of the 3’ site of the pseudoknot interaction

Param data:

An arbitrary data structure passed from the calling function

Return:

The energy (penalty) of the resulting pseudoknot

typedef int vrna_callback_pk_plex_score(const short *pt, int start_5, int end_5, int start_3, int end_3, void *data)#
#include <ViennaRNA/pk_plex.h>
typedef struct vrna_pk_plex_option_s *vrna_pk_plex_opt_t#

RNA PKplex options object.

#include <ViennaRNA/pk_plex.h>

typedef struct vrna_pk_plex_result_s vrna_pk_plex_t#

Convenience typedef for results of the RNA PKplex prediction.

#include <ViennaRNA/pk_plex.h>

See also

#vrna_pk_plex_results_s, vrna_pk_plex()

Functions

vrna_pk_plex_t *vrna_pk_plex(vrna_fold_compound_t *fc, const int **accessibility, vrna_pk_plex_opt_t options)#

Predict Pseudoknot interactions in terms of a two-step folding process.

#include <ViennaRNA/pk_plex.h>

Computes simple pseudoknot interactions according to the PKplex algorithm. This simple heuristic first compiles a list of potential interaction sites that may form a pseudoknot. The resulting candidate interactions are then fixed and an PK-free MFE structure for the remainder of the sequence is computed.

The accessibility argument is a list of opening energies for potential interaction sites. It is used in the first step of the algorithm to identify potential interactions. Upon passing NULL, the opening energies are determined automatically based on the current model settings.

Depending on the options, the function can return the MFE (incl. PK loops) or suboptimal structures within an energy band around the MFE. The PK loop is internally scored by a scoring function that in the simplest cases assigns a constant value for each PK loop. More complicated scoring functions can be passed as well, see vrna_pk_plex_score_f and vrna_pk_plex_opt_fun().

The function returns NULL on any error. Otherwise, a list of structures and interaction coordinates with corresponding energy contributions is returned. If no PK-interaction that satisfies the options is found, the list only consists of the PK-free MFE structure.

Parameters:
  • fc – fold compound with the input sequence and model settings

  • accessibility – An array of opening energies for the implemented heuristic (maybe NULL)

  • options – An vrna_pk_plex_opt_t options data structure that determines the algorithm parameters

Returns:

A list of potentially pseudoknotted structures (Last element in the list indicated by NULL value in vrna_pk_plex_result_s.structure)

int **vrna_pk_plex_accessibility(vrna_fold_compound_t *fc, unsigned int unpaired, double cutoff)#

Obtain a list of opening energies suitable for PKplex computations.

#include <ViennaRNA/pk_plex.h>

See also

vrna_pk_plex()

Parameters:
  • fc – fold compound with the input sequence and model settings for accessibility computations

  • unpaired – The maximum number of unpaired nucleotides, i.e. length of interaction

  • cutoff – A cutoff value for unpaired probabilities

Returns:

Opening energies as required for vrna_pk_plex()

vrna_pk_plex_opt_t vrna_pk_plex_opt_defaults(void)#

Default options for PKplex algorithm.

#include <ViennaRNA/pk_plex.h>

Returns:

An options data structure suitabe for PKplex computations

vrna_pk_plex_opt_t vrna_pk_plex_opt(unsigned int delta, unsigned int max_interaction_length, int pk_penalty)#

Simple options for PKplex algorithm.

#include <ViennaRNA/pk_plex.h>

Parameters:
  • delta – Size of energy band around MFE for suboptimal results in dekacal/mol

  • max_interaction_length – Maximum length of interaction

  • pk_penalty – Energy constant to score the PK forming loop

Returns:

An options data structure suitabe for PKplex computations

vrna_pk_plex_opt_t vrna_pk_plex_opt_fun(unsigned int delta, unsigned int max_interaction_length, vrna_pk_plex_score_f scoring_function, void *scoring_data)#

Simple options for PKplex algorithm.

#include <ViennaRNA/pk_plex.h>

Parameters:
  • delta – Size of energy band around MFE for suboptimal results in dekacal/mol

  • max_interaction_length – Maximum length of interaction

  • scoring_function – Energy evaluating function to score the PK forming loop

  • scoring_data – An arbitrary data structure passed to the scoring function (maybe NUL)

Returns:

An options data structure suitabe for PKplex computations

struct vrna_pk_plex_result_s#
#include <ViennaRNA/pk_plex.h>

A result of the RNA PKplex interaction prediction.

See also

vrna_pk_plex_t

Public Members

char *structure#

Secondary Structure in dot-bracket notation.

#include <ViennaRNA/pk_plex.h>
double energy#

Net free energy in kcal/mol.

#include <ViennaRNA/pk_plex.h>
double dGpk#

Free energy of PK loop in kcal/mol.

#include <ViennaRNA/pk_plex.h>
double dGint#

Free energy of PK forming duplex interaction.

#include <ViennaRNA/pk_plex.h>
double dG1#

Opening energy for the 5’ interaction site used in the heuristic.

#include <ViennaRNA/pk_plex.h>
double dG2#

Opening energy for the 3’ interaction site used in the heuristic.

#include <ViennaRNA/pk_plex.h>
unsigned int start_5#

Start coordinate of the 5’ interaction site.

#include <ViennaRNA/pk_plex.h>
unsigned int end_5#

End coordinate of the 5’ interaction site.

#include <ViennaRNA/pk_plex.h>
unsigned int start_3#

Start coordinate of the 3’ interaction site.

#include <ViennaRNA/pk_plex.h>
unsigned int end_3#

End coordinate of the 3’ interaction site.

#include <ViennaRNA/pk_plex.h>

G-Quadruplexes#

Energy Evaluation#

Functions

int vrna_E_gquad(unsigned int L, unsigned int l[3], vrna_param_t *P)#
#include <ViennaRNA/eval/gquad.h>
FLT_OR_DBL vrna_exp_E_gquad(unsigned int L, unsigned int l[3], vrna_exp_param_t *pf)#
#include <ViennaRNA/eval/gquad.h>
void vrna_E_consensus_gquad(unsigned int L, unsigned int l[3], unsigned int position, unsigned int length, unsigned int n_seq, const short **S, const unsigned int **a2s, vrna_param_t *P, int en[2])#
#include <ViennaRNA/eval/gquad.h>
FLT_OR_DBL vrna_exp_E_consensus_gquad(unsigned int L, unsigned int l[3], vrna_exp_param_t *pf, unsigned int position, unsigned int length, unsigned int n_seq, const short **S, const unsigned int **a2s)#
#include <ViennaRNA/eval/gquad.h>
int vrna_mfe_gquad_internal_loop(vrna_fold_compound_t *fc, unsigned int i, unsigned int j)#
#include <ViennaRNA/mfe/gquad.h>
FLT_OR_DBL vrna_gq_int_loop_pf(vrna_fold_compound_t *fc, unsigned int i, unsigned int j)#
#include <ViennaRNA/partfunc/gquad.h>
int *vrna_gq_int_loop_subopt(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, unsigned int **p_p, unsigned int **q_p, int threshold)#
#include <ViennaRNA/subopt/gquad.h>
void get_gquad_pattern_exhaustive(short *S, unsigned int i, unsigned int j, vrna_param_t *P, unsigned int *L, unsigned int *l, int threshold)#
#include <ViennaRNA/subopt/gquad.h>
unsigned int get_gquad_count(short *S, unsigned int i, unsigned int j)#
#include <ViennaRNA/subopt/gquad.h>

Dynamic Programming Matrices#

Functions

vrna_smx_csr_int_t *vrna_mfe_gquad_mx(vrna_fold_compound_t *fc)#

Get G-Quadruplexes (MFE).

#include <ViennaRNA/mfe/gquad.h>

This function yields a sparse, two-dimensional matrix \( G \) that at position \( G(i,j) \) stores the minimum free energy of a G-Quadruplex that starts at \( i \) and ends at \( j \).

Parameters:
  • fc – The fold_compound

Returns:

A sparse matrix with all MFE G-Quadruplexes

int **get_gquad_L_matrix(short *S, int start, int maxdist, int n, int **g, vrna_param_t *P)#
#include <ViennaRNA/mfe/gquad.h>
void vrna_gquad_mx_local_update(vrna_fold_compound_t *fc, int start)#
#include <ViennaRNA/mfe/gquad.h>
vrna_smx_csr_FLT_OR_DBL_t *vrna_gq_pos_pf(vrna_fold_compound_t *fc)#
#include <ViennaRNA/partfunc/gquad.h>

Backtracking#

Functions

int vrna_bt_gquad(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, unsigned int *L, unsigned int l[3])#
#include <ViennaRNA/backtrack/gquad.h>
int vrna_bt_gquad_mfe(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, vrna_bps_t bp_stack)#
#include <ViennaRNA/backtrack/gquad.h>
int vrna_bt_gquad_internal(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, int en, vrna_bps_t bp_stack, vrna_bts_t bt_stack)#
#include <ViennaRNA/backtrack/gquad.h>

Parsing#

Functions

void get_gquad_pattern_pf(short *S, int i, int j, vrna_exp_param_t *pf, int *L, int l[3])#
#include <ViennaRNA/partfunc/gquad.h>
void vrna_get_gquad_pattern_pf(vrna_fold_compound_t *fc, unsigned int i, unsigned int j, unsigned int *L, unsigned int[3])#
#include <ViennaRNA/partfunc/gquad.h>
unsigned int vrna_gq_parse(const char *db_string, unsigned int *L, unsigned int l[3])#

Parse a G-Quadruplex from a dot-bracket structure string.

#include <ViennaRNA/structures/dotbracket.h>

Given a dot-bracket structure (possibly) containing gquads encoded by ‘+’ signs (and an optional ‘~’ end sign, find first gquad, return end position (1-based) or 0 if none found. Upon return L and l[] contain the number of stacked layers, as well as the lengths of the linker regions.

To parse a string with many gquads, call vrna_gq_parse() repeatedly e.g.

end1 = vrna_gq_parse(struc, &L, l); ... ;
end2 = vrna_gq_parse(struc+end1, &L, l); end2+=end1; ... ;
end3 = vrna_gq_parse(struc+end2, &L, l); end3+=end2; ... ;

Note

For circular RNAs and G-Quadruplexes spanning the n,1-junction the sum of linkers and g-runs is lower than the end position. This condition can be used to check whether or not to accept a G-Quadruplex parsed from the dot-bracket string. Also note, that such n,1-junction spanning G-Quadruplexes must end with a ~ sign, to be unambigous.

Parameters:
  • db_string – The input structure in dot-bracket notation

  • L – A pointer to an unsigned integer to store the layer (stack) size

  • l – An array of three values to store the respective linker lenghts

Returns:

The end position of the G-Quadruplex (1-based) or 0 if not found

void vrna_db_insert_gq(char *db, unsigned int i, unsigned int L, unsigned int l[3], unsigned int n)#
#include <ViennaRNA/structures/dotbracket.h>
plist *get_plist_gquad_from_db(const char *structure, float pr)#
#include <ViennaRNA/structures/problist.h>

Other#

Functions

plist *get_plist_gquad_from_pr(short *S, int gi, int gj, vrna_smx_csr_FLT_OR_DBL_t *q_gq, FLT_OR_DBL *probs, FLT_OR_DBL *scale, vrna_exp_param_t *pf)#
#include <ViennaRNA/partfunc/gquad.h>
vrna_ep_t *vrna_plist_gquad_from_pr(vrna_fold_compound_t *fc, int gi, int gj)#
#include <ViennaRNA/partfunc/gquad.h>
plist *get_plist_gquad_from_pr_max(short *S, int gi, int gj, vrna_smx_csr_FLT_OR_DBL_t *q_gq, FLT_OR_DBL *probs, FLT_OR_DBL *scale, int *L, int l[3], vrna_exp_param_t *pf)#
#include <ViennaRNA/partfunc/gquad.h>
vrna_ep_t *vrna_plist_gquad_from_pr_max(vrna_fold_compound_t *fc, unsigned int gi, unsigned int gj, unsigned int *Lmax, unsigned int lmax[3])#
#include <ViennaRNA/partfunc/gquad.h>