data_structures.h
Go to the documentation of this file.
#ifndef __VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H__
#define __VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H__
#include "energy_const.h"
/* to use floats instead of doubles in pf_fold() comment next line */
#define LARGE_PF
#ifdef LARGE_PF
#define FLT_OR_DBL double
#else
#define FLT_OR_DBL float
#endif
#ifndef NBASES
#define NBASES 8
#endif
#ifndef MAXALPHA
#define MAXALPHA 20
#endif
#define MAXDOS 1000
#define VRNA_GQUAD_MAX_STACK_SIZE 7
#define VRNA_GQUAD_MIN_STACK_SIZE 2
#define VRNA_GQUAD_MAX_LINKER_LENGTH 15
#define VRNA_GQUAD_MIN_LINKER_LENGTH 1
#define VRNA_GQUAD_MIN_BOX_SIZE ((4*VRNA_GQUAD_MIN_STACK_SIZE)+(3*VRNA_GQUAD_MIN_LINKER_LENGTH))
#define VRNA_GQUAD_MAX_BOX_SIZE ((4*VRNA_GQUAD_MAX_STACK_SIZE)+(3*VRNA_GQUAD_MAX_LINKER_LENGTH))
/*
* ############################################################
* Here are the type definitions of various datastructures
* shared among the Vienna RNA Package
* ############################################################
*/
typedef struct plist {
int i;
int j;
float p;
int type;
} plist;
typedef struct cpair {
int i,j,mfe;
float p, hue, sat;
} cpair;
typedef struct {
float X; /* X coords */
float Y; /* Y coords */
} COORDINATE;
typedef struct sect {
int i;
int j;
int ml;
} sect;
typedef struct bondT {
unsigned int i;
unsigned int j;
} bondT;
typedef struct bondTEn {
int i;
int j;
int energy;
} bondTEn;
typedef struct{
int dangles;
int special_hp;
int noLP;
int noGU;
int noGUclosure;
int logML;
int circ;
int gquad;
int canonicalBPonly;
} model_detailsT;
typedef struct{
int id;
int stack[NBPAIRS+1][NBPAIRS+1];
int hairpin[31];
int bulge[MAXLOOP+1];
int internal_loop[MAXLOOP+1];
int mismatchExt[NBPAIRS+1][5][5];
int mismatchI[NBPAIRS+1][5][5];
int mismatch1nI[NBPAIRS+1][5][5];
int mismatch23I[NBPAIRS+1][5][5];
int mismatchH[NBPAIRS+1][5][5];
int mismatchM[NBPAIRS+1][5][5];
int dangle5[NBPAIRS+1][5];
int dangle3[NBPAIRS+1][5];
int int11[NBPAIRS+1][NBPAIRS+1][5][5];
int int21[NBPAIRS+1][NBPAIRS+1][5][5][5];
int int22[NBPAIRS+1][NBPAIRS+1][5][5][5][5];
int ninio[5];
double lxc;
int MLbase;
int MLintern[NBPAIRS+1];
int MLclosing;
int TerminalAU;
int DuplexInit;
int Tetraloop_E[200];
char Tetraloops[1401];
int Triloop_E[40];
char Triloops[241];
int Hexaloop_E[40];
char Hexaloops[1801];
int TripleC;
int MultipleCA;
int MultipleCB;
int gquad [VRNA_GQUAD_MAX_STACK_SIZE + 1]
[3*VRNA_GQUAD_MAX_LINKER_LENGTH + 1];
double temperature;
model_detailsT model_details;
} paramT;
typedef struct{
int id;
double expstack[NBPAIRS+1][NBPAIRS+1];
double exphairpin[31];
double expbulge[MAXLOOP+1];
double expinternal[MAXLOOP+1];
double expmismatchExt[NBPAIRS+1][5][5];
double expmismatchI[NBPAIRS+1][5][5];
double expmismatch23I[NBPAIRS+1][5][5];
double expmismatch1nI[NBPAIRS+1][5][5];
double expmismatchH[NBPAIRS+1][5][5];
double expmismatchM[NBPAIRS+1][5][5];
double expdangle5[NBPAIRS+1][5];
double expdangle3[NBPAIRS+1][5];
double expint11[NBPAIRS+1][NBPAIRS+1][5][5];
double expint21[NBPAIRS+1][NBPAIRS+1][5][5][5];
double expint22[NBPAIRS+1][NBPAIRS+1][5][5][5][5];
double expninio[5][MAXLOOP+1];
double lxc;
double expMLbase;
double expMLintern[NBPAIRS+1];
double expMLclosing;
double expTermAU;
double expDuplexInit;
double exptetra[40];
double exptri[40];
double exphex[40];
char Tetraloops[1401];
double expTriloop[40];
char Triloops[241];
char Hexaloops[1801];
double expTripleC;
double expMultipleCA;
double expMultipleCB;
double expgquad[VRNA_GQUAD_MAX_STACK_SIZE + 1]
[3*VRNA_GQUAD_MAX_LINKER_LENGTH + 1];
double kT;
double pf_scale;
double temperature;
double alpha;
model_detailsT model_details;
} pf_paramT;
/*
* ############################################################
* SUBOPT data structures
* ############################################################
*/
typedef struct {
int i;
int j;
} PAIR;
typedef struct {
int i;
int j;
int array_flag;
} INTERVAL;
typedef struct {
float energy;
char *structure;
} SOLUTION;
/*
* ############################################################
* COFOLD data structures
* ############################################################
*/
typedef struct cofoldF {
/* free energies for: */
double F0AB;
double FAB;
double FcAB;
double FA;
double FB;
} cofoldF;
typedef struct ConcEnt {
double A0;
double B0;
double ABc;
double AAc;
double BBc;
double Ac;
double Bc;
} ConcEnt;
typedef struct pairpro{
struct plist *AB;
struct plist *AA;
struct plist *A;
struct plist *B;
struct plist *BB;
}pairpro;
typedef struct {
unsigned i;
unsigned j;
float p;
float ent;
short bp[8];
char comp;
} pair_info;
/*
* ############################################################
* FINDPATH data structures
* ############################################################
*/
typedef struct move {
int i; /* i,j>0 insert; i,j<0 delete */
int j;
int when; /* 0 if still available, else resulting distance from start */
int E;
} move_t;
typedef struct intermediate {
short *pt;
int Sen;
int curr_en;
move_t *moves;
} intermediate_t;
typedef struct path {
double en;
char *s;
} path_t;
/*
* ############################################################
* 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;
/*
* ############################################################
* 2Dfold data structures
* ############################################################
*/
typedef struct{
int k;
int l;
float en;
char *s;
} TwoDfold_solution;
typedef struct{
paramT *P;
int do_backtrack;
char *ptype;
char *sequence;
short *S, *S1;
unsigned int maxD1;
unsigned int maxD2;
unsigned int *mm1;
unsigned int *mm2;
int *my_iindx;
double temperature;
unsigned int *referenceBPs1;
unsigned int *referenceBPs2;
unsigned int *bpdist;
short *reference_pt1;
short *reference_pt2;
int circ;
int dangles;
unsigned int seq_length;
int ***E_F5;
int ***E_F3;
int ***E_C;
int ***E_M;
int ***E_M1;
int ***E_M2;
int **E_Fc;
int **E_FcH;
int **E_FcI;
int **E_FcM;
int **l_min_values;
int **l_max_values;
int *k_min_values;
int *k_max_values;
int **l_min_values_m;
int **l_max_values_m;
int *k_min_values_m;
int *k_max_values_m;
int **l_min_values_m1;
int **l_max_values_m1;
int *k_min_values_m1;
int *k_max_values_m1;
int **l_min_values_f;
int **l_max_values_f;
int *k_min_values_f;
int *k_max_values_f;
int **l_min_values_f3;
int **l_max_values_f3;
int *k_min_values_f3;
int *k_max_values_f3;
int **l_min_values_m2;
int **l_max_values_m2;
int *k_min_values_m2;
int *k_max_values_m2;
int *l_min_values_fc;
int *l_max_values_fc;
int k_min_values_fc;
int k_max_values_fc;
int *l_min_values_fcH;
int *l_max_values_fcH;
int k_min_values_fcH;
int k_max_values_fcH;
int *l_min_values_fcI;
int *l_max_values_fcI;
int k_min_values_fcI;
int k_max_values_fcI;
int *l_min_values_fcM;
int *l_max_values_fcM;
int k_min_values_fcM;
int k_max_values_fcM;
/* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
int *E_F5_rem;
int *E_F3_rem;
int *E_C_rem;
int *E_M_rem;
int *E_M1_rem;
int *E_M2_rem;
int E_Fc_rem;
int E_FcH_rem;
int E_FcI_rem;
int E_FcM_rem;
#ifdef COUNT_STATES
unsigned long ***N_F5;
unsigned long ***N_C;
unsigned long ***N_M;
unsigned long ***N_M1;
#endif
} TwoDfold_vars;
typedef struct{
int k;
int l;
FLT_OR_DBL q;
} TwoDpfold_solution;
typedef struct{
unsigned int alloc;
char *ptype;
char *sequence;
short *S, *S1;
unsigned int maxD1;
unsigned int maxD2;
double temperature; /* temperature in last call to scale_pf_params */
double init_temp; /* temperature in last call to scale_pf_params */
FLT_OR_DBL *scale;
FLT_OR_DBL pf_scale;
pf_paramT *pf_params; /* holds all [unscaled] pf parameters */
int *my_iindx;
int *jindx;
short *reference_pt1;
short *reference_pt2;
unsigned int *referenceBPs1;
unsigned int *referenceBPs2;
unsigned int *bpdist;
unsigned int *mm1;
unsigned int *mm2;
int circ;
int dangles;
unsigned int seq_length;
FLT_OR_DBL ***Q;
FLT_OR_DBL ***Q_B;
FLT_OR_DBL ***Q_M;
FLT_OR_DBL ***Q_M1;
FLT_OR_DBL ***Q_M2;
FLT_OR_DBL **Q_c;
FLT_OR_DBL **Q_cH;
FLT_OR_DBL **Q_cI;
FLT_OR_DBL **Q_cM;
int **l_min_values;
int **l_max_values;
int *k_min_values;
int *k_max_values;
int **l_min_values_b;
int **l_max_values_b;
int *k_min_values_b;
int *k_max_values_b;
int **l_min_values_m;
int **l_max_values_m;
int *k_min_values_m;
int *k_max_values_m;
int **l_min_values_m1;
int **l_max_values_m1;
int *k_min_values_m1;
int *k_max_values_m1;
int **l_min_values_m2;
int **l_max_values_m2;
int *k_min_values_m2;
int *k_max_values_m2;
int *l_min_values_qc;
int *l_max_values_qc;
int k_min_values_qc;
int k_max_values_qc;
int *l_min_values_qcH;
int *l_max_values_qcH;
int k_min_values_qcH;
int k_max_values_qcH;
int *l_min_values_qcI;
int *l_max_values_qcI;
int k_min_values_qcI;
int k_max_values_qcI;
int *l_min_values_qcM;
int *l_max_values_qcM;
int k_min_values_qcM;
int k_max_values_qcM;
/* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
FLT_OR_DBL *Q_rem;
FLT_OR_DBL *Q_B_rem;
FLT_OR_DBL *Q_M_rem;
FLT_OR_DBL *Q_M1_rem;
FLT_OR_DBL *Q_M2_rem;
FLT_OR_DBL Q_c_rem;
FLT_OR_DBL Q_cH_rem;
FLT_OR_DBL Q_cI_rem;
FLT_OR_DBL Q_cM_rem;
} TwoDpfold_vars;
#endif