data_structures.h
Go to the documentation of this file.
#ifndef VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H
#define VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H
/* below are several convenience typedef's we use throughout the ViennaRNA library */
typedef struct vrna_fc_s vrna_fold_compound_t;
typedef struct vrna_basepair_s vrna_basepair_t;
typedef struct vrna_plist_s vrna_plist_t;
typedef struct vrna_bp_stack_s vrna_bp_stack_t;
typedef struct vrna_cpair_s vrna_cpair_t;
typedef struct vrna_sect_s vrna_sect_t;
#ifdef USE_FLOAT_PF
typedef float FLT_OR_DBL;
#else
typedef double FLT_OR_DBL;
#endif
typedef void (vrna_callback_free_auxdata)(void *data);
typedef void (vrna_callback_recursion_status)(unsigned char status, void *data);
#define VRNA_STATUS_MFE_PRE (unsigned char)1
#define VRNA_STATUS_MFE_POST (unsigned char)2
#define VRNA_STATUS_PF_PRE (unsigned char)3
#define VRNA_STATUS_PF_POST (unsigned char)4
/* make this interface backward compatible with RNAlib < 2.2.0 */
#define VRNA_BACKWARD_COMPAT
#ifdef VRNA_BACKWARD_COMPAT
/* the following typedefs are for backward compatibility only */
typedef struct vrna_basepair_s PAIR;
typedef struct vrna_plist_s plist;
typedef struct vrna_cpair_s cpair;
typedef struct vrna_sect_s sect;
typedef struct vrna_bp_stack_s bondT;
#endif
#include <ViennaRNA/energy_const.h>
#include <ViennaRNA/model.h>
#include <ViennaRNA/params.h>
#include <ViennaRNA/dp_matrices.h>
#include <ViennaRNA/constraints.h>
/*
* ############################################################
* Here are the type definitions of various datastructures
* shared among the Vienna RNA Package
* ############################################################
*/
struct vrna_basepair_s {
int i;
int j;
};
struct vrna_plist_s {
int i;
int j;
float p;
int type;
};
struct vrna_cpair_s {
int i,j,mfe;
float p, hue, sat;
};
struct vrna_sect_s {
int i;
int j;
int ml;
};
struct vrna_bp_stack_s {
unsigned int i;
unsigned int j;
};
/*
* ############################################################
* RNAup data structures
* ############################################################
*/
typedef struct pu_contrib {
double **H;
double **I;
double **M;
double **E;
int length;
int w;
} pu_contrib;
typedef struct interact {
double *Pi;
double *Gi;
double Gikjl;
double Gikjl_wo;
int i;
int k;
int j;
int l;
int length;
} interact;
typedef struct pu_out {
int len;
int u_vals;
int contribs;
char **header;
double **u_values;
} pu_out;
typedef struct constrain{
int *indx;
char *ptype;
} constrain;
/*
* ############################################################
* RNAduplex data structures
* ############################################################
*/
typedef struct {
int i;
int j;
int end;
char *structure;
double energy;
double energy_backtrack;
double opening_backtrack_x;
double opening_backtrack_y;
int offset;
double dG1;
double dG2;
double ddG;
int tb;
int te;
int qb;
int qe;
} duplexT;
/*
* ############################################################
* RNAsnoop data structures
* ############################################################
*/
typedef struct node {
int k;
int energy;
struct node *next;
} folden;
typedef struct {
int i;
int j;
int u;
char *structure;
float energy;
float Duplex_El;
float Duplex_Er;
float Loop_E;
float Loop_D;
float pscd;
float psct;
float pscg;
float Duplex_Ol;
float Duplex_Or;
float Duplex_Ot;
float fullStemEnergy;
} snoopT;
/*
* ############################################################
* PKplex data structures
* ############################################################
*/
typedef struct dupVar{
int i;
int j;
int end;
char *pk_helix;
char *structure;
double energy;
int offset;
double dG1;
double dG2;
double ddG;
int tb;
int te;
int qb;
int qe;
int inactive;
int processed;
} dupVar;
/*
* ############################################################
* VRNA fold compound related functions
* ############################################################
*/
typedef enum {
VRNA_VC_TYPE_SINGLE,
VRNA_VC_TYPE_ALIGNMENT
} vrna_fc_type_e;
struct vrna_fc_s{
vrna_fc_type_e type;
unsigned int length;
int cutpoint;
vrna_hc_t *hc;
vrna_mx_mfe_t *matrices;
vrna_mx_pf_t *exp_matrices;
vrna_param_t *params;
vrna_exp_param_t *exp_params;
int *iindx;
int *jindx;
vrna_callback_recursion_status *stat_cb;
void *auxdata;
vrna_callback_free_auxdata *free_auxdata;
#if __STDC_VERSION__ >= 201112L
/* C11 support for unnamed unions/structs */
union {
struct {
#endif
char *sequence;
short *sequence_encoding;
short *sequence_encoding2;
char *ptype;
char *ptype_pf_compat;
vrna_sc_t *sc;
#if __STDC_VERSION__ >= 201112L
/* C11 support for unnamed unions/structs */
};
struct {
#endif
char **sequences;
unsigned int n_seq;
char *cons_seq;
short *S_cons;
short **S;
short **S5;
short **S3;
char **Ss;
unsigned short **a2s;
int *pscore;
short *pscore_pf_compat;
vrna_sc_t **scs;
int oldAliEn;
#if __STDC_VERSION__ >= 201112L
};
};
#endif
unsigned int maxD1;
unsigned int maxD2;
short *reference_pt1;
short *reference_pt2;
unsigned int *referenceBPs1;
unsigned int *referenceBPs2;
unsigned int *bpdist;
unsigned int *mm1;
unsigned int *mm2;
int window_size;
char **ptype_local;
};
/* the definitions below should be used for functions that return/receive/destroy fold compound data structures */
#define VRNA_OPTION_DEFAULT 0U
#define VRNA_OPTION_MFE 1U
#define VRNA_OPTION_PF 2U
#define VRNA_OPTION_HYBRID 4U
#define VRNA_OPTION_EVAL_ONLY 8U
#define VRNA_OPTION_WINDOW 16U
vrna_fold_compound_t *
vrna_fold_compound( const char *sequence,
vrna_md_t *md_p,
unsigned int options);
vrna_fold_compound_t *
vrna_fold_compound_comparative( const char **sequences,
vrna_md_t *md_p,
unsigned int options);
vrna_fold_compound_t *
vrna_fold_compound_TwoD(const char *sequence,
const char *s1,
const char *s2,
vrna_md_t *md_p,
unsigned int options);
int
vrna_fold_compound_prepare( vrna_fold_compound_t *vc,
unsigned int options);
void
vrna_fold_compound_free(vrna_fold_compound_t *vc);
void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *vc,
void *data,
vrna_callback_free_auxdata *f);
void vrna_fold_compound_add_callback( vrna_fold_compound_t *vc,
vrna_callback_recursion_status *f);
#endif
vrna_fc_s::S3
short ** S3
Sl[s][i] holds next base 3' of i in sequence s.
Definition: data_structures.h:511
vrna_fc_s::S
short ** S
Numerical encoding of the sequences in the alignment.
Definition: data_structures.h:505
vrna_fold_compound_add_callback
void vrna_fold_compound_add_callback(vrna_fold_compound_t *vc, vrna_callback_recursion_status *f)
Add a recursion status callback to the vrna_fold_compound_t.
interact::l
int l
j<l in shorter seq
Definition: data_structures.h:228
pu_contrib::M
double ** M
multi loops
Definition: data_structures.h:210
vrna_fc_s::mm1
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: data_structures.h:551
vrna_mx_mfe_s
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: dp_matrices.h:39
vrna_fold_compound_comparative
vrna_fold_compound_t * vrna_fold_compound_comparative(const char **sequences, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for sequence alignments.
vrna_fc_s::S_cons
short * S_cons
Numerical encoding of the consensus sequence.
Definition: data_structures.h:502
vrna_fc_s::ptype
char * ptype
Pair type array.
Definition: data_structures.h:460
dp_matrices.h
vrna_fc_s::sequence_encoding
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: data_structures.h:455
pu_contrib::H
double ** H
hairpin loops
Definition: data_structures.h:208
vrna_fc_s::exp_params
vrna_exp_param_t * exp_params
The precomputed free energy contributions as Boltzmann factors.
Definition: data_structures.h:414
constrain
struct constrain constrain
constraints for cofolding
pu_out::u_vals
int u_vals
number of different -u values
Definition: data_structures.h:237
dupVar
Definition: data_structures.h:326
vrna_fc_s::bpdist
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
Definition: data_structures.h:549
vrna_fc_s::reference_pt1
short * reference_pt1
A pairtable of the first reference structure.
Definition: data_structures.h:544
vrna_fc_s::sc
vrna_sc_t * sc
The soft constraints for usage in structure prediction and evaluation.
Definition: data_structures.h:474
pu_contrib
struct pu_contrib pu_contrib
contributions to p_u
FLT_OR_DBL
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:390
vrna_fc_s::sequences
char ** sequences
The aligned sequences.
Definition: data_structures.h:492
interact::j
int j
j<l in shorter seq
Definition: data_structures.h:227
node
Definition: data_structures.h:288
pu_contrib
contributions to p_u
Definition: data_structures.h:207
pu_out::contribs
int contribs
[-c "SHIME"]
Definition: data_structures.h:238
model.h
The model details data structure and its corresponding modifiers.
vrna_fc_s::auxdata
void * auxdata
A pointer to auxiliary, user-defined data.
Definition: data_structures.h:430
vrna_param_s
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:50
vrna_fc_s::pscore_pf_compat
short * pscore_pf_compat
Precomputed array of pair types expressed as pairing scores indexed via iindx.
Definition: data_structures.h:519
interact::i
int i
k<i in longer seq
Definition: data_structures.h:225
vrna_fold_compound_add_auxdata
void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *vc, void *data, vrna_callback_free_auxdata *f)
Add auxiliary data to the vrna_fold_compound_t.
snoopT
Definition: data_structures.h:297
pu_out::u_values
double ** u_values
(the -u values * [-c "SHIME"]) * seq len
Definition: data_structures.h:240
vrna_fc_s::cons_seq
char * cons_seq
The consensus sequence of the aligned sequences.
Definition: data_structures.h:499
vrna_fc_s::hc
vrna_hc_t * hc
The hard constraints data structure used for structure prediction.
Definition: data_structures.h:408
vrna_fc_s::ptype_pf_compat
char * ptype_pf_compat
ptype array indexed via iindx
Definition: data_structures.h:469
VRNA_VC_TYPE_SINGLE
Definition: data_structures.h:373
vrna_sect_s
Stack of partial structures for backtracking.
Definition: data_structures.h:183
vrna_cpair_s
this datastructure is used as input parameter in functions of PS_dot.c
Definition: data_structures.h:174
vrna_fc_s::jindx
int * jindx
DP matrix accessor.
Definition: data_structures.h:417
vrna_fold_compound_free
void vrna_fold_compound_free(vrna_fold_compound_t *vc)
Free memory occupied by a vrna_fold_compound_t.
vrna_fc_type_e
vrna_fc_type_e
An enumerator that is used to specify the type of a vrna_fold_compound_t.
Definition: data_structures.h:372
energy_const.h
vrna_fold_compound
vrna_fold_compound_t * vrna_fold_compound(const char *sequence, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for single sequences and hybridizing sequences...
vrna_basepair_s
Base pair data structure used in subopt.c.
Definition: data_structures.h:156
vrna_md_s
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:187
vrna_sc_s
The soft constraints data structure.
Definition: constraints_soft.h:111
pu_contrib::w
int w
longest unpaired region
Definition: data_structures.h:213
pu_out
struct pu_out pu_out
Collection of all free_energy of beeing unpaired values for output.
vrna_fc_s::S5
short ** S5
S5[s][i] holds next base 5' of i in sequence s.
Definition: data_structures.h:508
params.h
vrna_exp_param_s
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:94
vrna_fc_s::scs
vrna_sc_t ** scs
A set of soft constraints (for each sequence in the alignment)
Definition: data_structures.h:523
vrna_callback_free_auxdata
void( vrna_callback_free_auxdata)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: data_structures.h:51
interact::k
int k
k<i in longer seq
Definition: data_structures.h:226
vrna_hc_s
The hard constraints data structure.
Definition: constraints_hard.h:300
interact
Definition: data_structures.h:219
interact::Pi
double * Pi
probabilities of interaction
Definition: data_structures.h:220
constrain
constraints for cofolding
Definition: data_structures.h:246
pu_contrib::I
double ** I
interior loops
Definition: data_structures.h:209
pu_out::len
int len
sequence length
Definition: data_structures.h:236
vrna_callback_recursion_status
void( vrna_callback_recursion_status)(unsigned char status, void *data)
Callback to perform specific user-defined actions before, or after recursive computations.
Definition: data_structures.h:62
pu_contrib::length
int length
length of the input sequence
Definition: data_structures.h:212
pu_out::header
char ** header
header line
Definition: data_structures.h:239
vrna_plist_s
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:164
vrna_fc_s::params
vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition: data_structures.h:413
vrna_fc_s::pscore
int * pscore
Precomputed array of pair types expressed as pairing scores.
Definition: data_structures.h:516
vrna_fc_s::n_seq
unsigned int n_seq
The number of sequences in the alignment.
Definition: data_structures.h:496
vrna_fc_s::referenceBPs2
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: data_structures.h:548
interact::length
int length
length of longer sequence
Definition: data_structures.h:229
vrna_fc_s::sequence
char * sequence
The input sequence string.
Definition: data_structures.h:452
vrna_fc_s::matrices
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: data_structures.h:410
VRNA_VC_TYPE_ALIGNMENT
Definition: data_structures.h:374
vrna_fc_s::stat_cb
vrna_callback_recursion_status * stat_cb
Recursion status callback (usually called just before, and after recursive computations in the librar...
Definition: data_structures.h:425
vrna_fc_s::cutpoint
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint...
Definition: data_structures.h:404
vrna_fc_s::free_auxdata
vrna_callback_free_auxdata * free_auxdata
A callback to free auxiliary user data whenever the fold_compound itself is free'd.
Definition: data_structures.h:434
pu_out
Collection of all free_energy of beeing unpaired values for output.
Definition: data_structures.h:235
interact::Gikjl
double Gikjl
full free energy for interaction between [k,i] k<i in longer seq and [j,l] j<l in shorter seq ...
Definition: data_structures.h:222
vrna_fc_s::length
unsigned int length
The length of the sequence (or sequence alignment)
Definition: data_structures.h:403
vrna_bp_stack_s
Base pair stack element.
Definition: data_structures.h:192
constraints.h
Functions and data structures for constraining secondary structure predictions and evaluation...
interact::Gi
double * Gi
free energies of interaction
Definition: data_structures.h:221
vrna_fc_s::reference_pt2
short * reference_pt2
A pairtable of the second reference structure.
Definition: data_structures.h:545
vrna_fc_s::maxD1
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition: data_structures.h:542
vrna_fc_s::mm2
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition: data_structures.h:552
duplexT
Definition: data_structures.h:260
vrna_fc_s::referenceBPs1
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition: data_structures.h:547
vrna_fc_s::type
vrna_fc_type_e type
The type of the vrna_fold_compound_t.
Definition: data_structures.h:396
vrna_fc_s::window_size
int window_size
window size for local folding sliding window approach
Definition: data_structures.h:564
vrna_fc_s::ptype_local
char ** ptype_local
Pair type array (for local folding)
Definition: data_structures.h:565
interact::Gikjl_wo
double Gikjl_wo
Gikjl without contributions for prob_unpaired.
Definition: data_structures.h:224
vrna_fc_s::iindx
int * iindx
DP matrix accessor.
Definition: data_structures.h:416
pu_contrib::E
double ** E
exterior loop
Definition: data_structures.h:211
vrna_mx_pf_s
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:197
vrna_fc_s::maxD2
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: data_structures.h:543
vrna_fc_s::exp_matrices
vrna_mx_pf_t * exp_matrices
The PF DP matrices.
Definition: data_structures.h:411