RNAlib-2.3.2
multibranch_loops.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_MULTIBRANCH_LOOPS_H
2 #define VIENNA_RNA_PACKAGE_MULTIBRANCH_LOOPS_H
3 
4 #include <ViennaRNA/utils.h>
6 #include <ViennaRNA/params.h>
7 
8 #ifdef __GNUC__
9 # define INLINE inline
10 #else
11 # define INLINE
12 #endif
13 
32 typedef struct {
33  FLT_OR_DBL *qqm;
34  FLT_OR_DBL *qqm1;
35 
36  int qqmu_size;
37  FLT_OR_DBL **qqmu;
39 
40 
60 PRIVATE INLINE int E_MLstem( int type,
61  int si1,
62  int sj1,
63  vrna_param_t *P);
64 
71 PRIVATE INLINE FLT_OR_DBL exp_E_MLstem(int type,
72  int si1,
73  int sj1,
74  vrna_exp_param_t *P);
75 
76 
77 
83 int E_mb_loop_stack(int i, int j, vrna_fold_compound_t *vc);
84 
100 int
102  int *i,
103  int *j,
104  int *k,
105  int en,
106  int *component1,
107  int *component2);
108 
109 int
110 vrna_E_mb_loop_fast(vrna_fold_compound_t *vc,
111  int i,
112  int j,
113  int *dmli1,
114  int *dmli2);
115 
116 int
117 E_mb_loop_stack(int i,
118  int j,
120 
121 int
122 E_ml_rightmost_stem(int i,
123  int j,
125 
126 int
127 vrna_E_ml_stems_fast( vrna_fold_compound_t *vc,
128  int i,
129  int j,
130  int *fmi,
131  int *dmli);
132 
133 
135 vrna_exp_E_mb_loop_fast( vrna_fold_compound_t *vc,
136  int i,
137  int j,
138  FLT_OR_DBL *qqm1);
139 
140 
142 vrna_exp_E_ml_fast_init(vrna_fold_compound_t *vc);
143 
144 
145 void
146 vrna_exp_E_ml_fast_rotate(vrna_fold_compound_t *vc,
147  vrna_mx_pf_aux_ml_t *aux_mx);
148 
149 
150 void
151 vrna_exp_E_ml_fast_free(vrna_fold_compound_t *vc,
152  vrna_mx_pf_aux_ml_t *aux_mx);
153 
154 
156 vrna_exp_E_ml_fast(vrna_fold_compound_t *vc,
157  int i,
158  int j,
159  vrna_mx_pf_aux_ml_t *aux_mx);
160 
161 /*
162 #################################
163 # Backtracking functions below #
164 #################################
165 */
166 
167 int
168 vrna_BT_mb_loop_fake( vrna_fold_compound_t *vc,
169  int *u,
170  int *i,
171  int *j,
172  vrna_bp_stack_t *bp_stack,
173  int *stack_count);
174 
175 int
176 vrna_BT_mb_loop_split(vrna_fold_compound_t *vc,
177  int *i,
178  int *j,
179  int *k,
180  int *l,
181  int *component1,
182  int *component2,
183  vrna_bp_stack_t *bp_stack,
184  int *stack_count);
185 
186 int
188  int *i,
189  int *j,
190  int *k,
191  int en,
192  int *component1,
193  int *component2);
194 
195 /*
196 ########################################
197 # BEGIN OF INLINE FUNCTION DEFINITIONS #
198 ########################################
199 */
200 
201 
202 PRIVATE INLINE int E_MLstem(int type, int si1, int sj1, vrna_param_t *P){
203  int energy = 0;
204  if(si1 >= 0 && sj1 >= 0){
205  energy += P->mismatchM[type][si1][sj1];
206  }
207  else if (si1 >= 0){
208  energy += P->dangle5[type][si1];
209  }
210  else if (sj1 >= 0){
211  energy += P->dangle3[type][sj1];
212  }
213 
214  if(type > 2)
215  energy += P->TerminalAU;
216 
217  energy += P->MLintern[type];
218 
219  return energy;
220 }
221 
222 
223 
224 PRIVATE INLINE FLT_OR_DBL
225 exp_E_MLstem( int type,
226  int si1,
227  int sj1,
228  vrna_exp_param_t *P){
229 
230  double energy = 1.0;
231  if(si1 >= 0 && sj1 >= 0){
232  energy = P->expmismatchM[type][si1][sj1];
233  }
234  else if(si1 >= 0){
235  energy = P->expdangle5[type][si1];
236  }
237  else if(sj1 >= 0){
238  energy = P->expdangle3[type][sj1];
239  }
240 
241  if(type > 2)
242  energy *= P->expTermAU;
243 
244  energy *= P->expMLintern[type];
245  return (FLT_OR_DBL)energy;
246 }
247 
252 #endif
int E_mb_loop_stack(int i, int j, vrna_fold_compound_t *vc)
Evaluate energy of a multi branch helices stacking onto closing pair (i,j)
Auxiliary helper arrays for fast exterior loop computations.
Definition: multibranch_loops.h:32
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
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:55
General utility- and helper-functions used throughout the ViennaRNA Package.
Various data structures and pre-processor macros.
Functions to deal with sets of energy parameters.
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:99
int vrna_BT_mb_loop(vrna_fold_compound_t *vc, int *i, int *j, int *k, int en, int *component1, int *component2)
Backtrack the decomposition of a multi branch loop closed by .
Base pair stack element.
Definition: data_structures.h:222