RNAlib-2.4.4
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 
31 typedef struct {
32  FLT_OR_DBL *qqm;
33  FLT_OR_DBL *qqm1;
34 
35  int qqmu_size;
36  FLT_OR_DBL **qqmu;
38 
39 
59 PRIVATE INLINE int E_MLstem(int type,
60  int si1,
61  int sj1,
62  vrna_param_t *P);
63 
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 
83  int i,
84  int j);
85 
86 
102 int
104  int *i,
105  int *j,
106  int *k,
107  int en,
108  int *component1,
109  int *component2);
110 
111 
112 int
113 vrna_E_mb_loop_fast(vrna_fold_compound_t *vc,
114  int i,
115  int j,
116  int *dmli1,
117  int *dmli2);
118 
119 
120 int
122  int i,
123  int j);
124 
125 
126 int
127 E_ml_rightmost_stem(int i,
128  int j,
130 
131 
132 int
133 vrna_E_ml_stems_fast(vrna_fold_compound_t *vc,
134  int i,
135  int j,
136  int *fmi,
137  int *dmli);
138 
139 
141 vrna_exp_E_mb_loop_fast(vrna_fold_compound_t *vc,
142  int i,
143  int j,
144  FLT_OR_DBL *qqm1);
145 
146 
148 vrna_exp_E_ml_fast_init(vrna_fold_compound_t *vc);
149 
150 
151 void
152 vrna_exp_E_ml_fast_rotate(vrna_fold_compound_t *vc,
153  vrna_mx_pf_aux_ml_t *aux_mx);
154 
155 
156 void
157 vrna_exp_E_ml_fast_free(vrna_fold_compound_t *vc,
158  vrna_mx_pf_aux_ml_t *aux_mx);
159 
160 
162 vrna_exp_E_ml_fast(vrna_fold_compound_t *vc,
163  int i,
164  int j,
165  vrna_mx_pf_aux_ml_t *aux_mx);
166 
167 
168 /*
169  #################################
170  # Backtracking functions below #
171  #################################
172  */
173 
174 int
175 vrna_BT_mb_loop_fake(vrna_fold_compound_t *vc,
176  int *u,
177  int *i,
178  int *j,
179  vrna_bp_stack_t *bp_stack,
180  int *stack_count);
181 
182 
183 int
184 vrna_BT_mb_loop_split(vrna_fold_compound_t *vc,
185  int *i,
186  int *j,
187  int *k,
188  int *l,
189  int *component1,
190  int *component2,
191  vrna_bp_stack_t *bp_stack,
192  int *stack_count);
193 
194 
195 int
197  int *i,
198  int *j,
199  int *k,
200  int en,
201  int *component1,
202  int *component2);
203 
204 
205 /*
206  ########################################
207  # BEGIN OF INLINE FUNCTION DEFINITIONS #
208  ########################################
209  */
210 PRIVATE INLINE int
211 E_MLstem(int type,
212  int si1,
213  int sj1,
214  vrna_param_t *P)
215 {
216  int energy = 0;
217 
218  if (si1 >= 0 && sj1 >= 0)
219  energy += P->mismatchM[type][si1][sj1];
220  else if (si1 >= 0)
221  energy += P->dangle5[type][si1];
222  else if (sj1 >= 0)
223  energy += P->dangle3[type][sj1];
224 
225  if (type > 2)
226  energy += P->TerminalAU;
227 
228  energy += P->MLintern[type];
229 
230  return energy;
231 }
232 
233 
234 PRIVATE INLINE FLT_OR_DBL
235 exp_E_MLstem(int type,
236  int si1,
237  int sj1,
238  vrna_exp_param_t *P)
239 {
240  double energy = 1.0;
241 
242  if (si1 >= 0 && sj1 >= 0)
243  energy = P->expmismatchM[type][si1][sj1];
244  else if (si1 >= 0)
245  energy = P->expdangle5[type][si1];
246  else if (sj1 >= 0)
247  energy = P->expdangle3[type][sj1];
248 
249  if (type > 2)
250  energy *= P->expTermAU;
251 
252  energy *= P->expMLintern[type];
253  return (FLT_OR_DBL)energy;
254 }
255 
256 
261 #endif
int vrna_E_mb_loop_stack(vrna_fold_compound_t *vc, int i, int j)
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:31
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:131
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:56
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:101
Base pair stack element.
Definition: data_structures.h:141
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 .