RNAlib-2.4.0
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 
65 
72 PRIVATE INLINE FLT_OR_DBL exp_E_MLstem(int type,
73  int si1,
74  int sj1,
75  vrna_exp_param_t *P);
76 
77 
84  int i,
85  int j);
86 
87 
103 int
105  int *i,
106  int *j,
107  int *k,
108  int en,
109  int *component1,
110  int *component2);
111 
112 
113 int
114 vrna_E_mb_loop_fast(vrna_fold_compound_t *vc,
115  int i,
116  int j,
117  int *dmli1,
118  int *dmli2);
119 
120 
121 int
123  int i,
124  int j);
125 
126 
127 int
128 E_ml_rightmost_stem(int i,
129  int j,
131 
132 
133 int
134 vrna_E_ml_stems_fast(vrna_fold_compound_t *vc,
135  int i,
136  int j,
137  int *fmi,
138  int *dmli);
139 
140 
142 vrna_exp_E_mb_loop_fast(vrna_fold_compound_t *vc,
143  int i,
144  int j,
145  FLT_OR_DBL *qqm1);
146 
147 
149 vrna_exp_E_ml_fast_init(vrna_fold_compound_t *vc);
150 
151 
152 void
153 vrna_exp_E_ml_fast_rotate(vrna_fold_compound_t *vc,
154  vrna_mx_pf_aux_ml_t *aux_mx);
155 
156 
157 void
158 vrna_exp_E_ml_fast_free(vrna_fold_compound_t *vc,
159  vrna_mx_pf_aux_ml_t *aux_mx);
160 
161 
163 vrna_exp_E_ml_fast(vrna_fold_compound_t *vc,
164  int i,
165  int j,
166  vrna_mx_pf_aux_ml_t *aux_mx);
167 
168 
169 /*
170  #################################
171  # Backtracking functions below #
172  #################################
173  */
174 
175 int
176 vrna_BT_mb_loop_fake(vrna_fold_compound_t *vc,
177  int *u,
178  int *i,
179  int *j,
180  vrna_bp_stack_t *bp_stack,
181  int *stack_count);
182 
183 
184 int
185 vrna_BT_mb_loop_split(vrna_fold_compound_t *vc,
186  int *i,
187  int *j,
188  int *k,
189  int *l,
190  int *component1,
191  int *component2,
192  vrna_bp_stack_t *bp_stack,
193  int *stack_count);
194 
195 
196 int
198  int *i,
199  int *j,
200  int *k,
201  int en,
202  int *component1,
203  int *component2);
204 
205 
206 /*
207  ########################################
208  # BEGIN OF INLINE FUNCTION DEFINITIONS #
209  ########################################
210  */
211 PRIVATE INLINE int
212 E_MLstem(int type,
213  int si1,
214  int sj1,
215  vrna_param_t *P)
216 {
217  int energy = 0;
218 
219  if (si1 >= 0 && sj1 >= 0)
220  energy += P->mismatchM[type][si1][sj1];
221  else if (si1 >= 0)
222  energy += P->dangle5[type][si1];
223  else if (sj1 >= 0)
224  energy += P->dangle3[type][sj1];
225 
226  if (type > 2)
227  energy += P->TerminalAU;
228 
229  energy += P->MLintern[type];
230 
231  return energy;
232 }
233 
234 
235 PRIVATE INLINE FLT_OR_DBL
236 exp_E_MLstem(int type,
237  int si1,
238  int sj1,
239  vrna_exp_param_t *P)
240 {
241  double energy = 1.0;
242 
243  if (si1 >= 0 && sj1 >= 0)
244  energy = P->expmismatchM[type][si1][sj1];
245  else if (si1 >= 0)
246  energy = P->expdangle5[type][si1];
247  else if (sj1 >= 0)
248  energy = P->expdangle3[type][sj1];
249 
250  if (type > 2)
251  energy *= P->expTermAU;
252 
253  energy *= P->expMLintern[type];
254  return (FLT_OR_DBL)energy;
255 }
256 
257 
262 #endif
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:463
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:57
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
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)
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:229