RNAlib-2.2.9
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 
42 PRIVATE INLINE int E_MLstem( int type,
43  int si1,
44  int sj1,
45  vrna_param_t *P);
46 
53 PRIVATE INLINE FLT_OR_DBL exp_E_MLstem(int type,
54  int si1,
55  int sj1,
56  vrna_exp_param_t *P);
57 
58 
59 
65 int E_mb_loop_stack(int i, int j, vrna_fold_compound_t *vc);
66 
82 int
84  int *i,
85  int *j,
86  int *k,
87  int en,
88  int *component1,
89  int *component2);
90 
91 int
92 vrna_E_mb_loop_fast(vrna_fold_compound_t *vc,
93  int i,
94  int j,
95  int *dmli1,
96  int *dmli2);
97 
98 int
99 E_mb_loop_stack(int i,
100  int j,
102 
103 int
104 E_ml_rightmost_stem(int i,
105  int j,
107 
108 int
109 vrna_E_ml_stems_fast( vrna_fold_compound_t *vc,
110  int i,
111  int j,
112  int *fmi,
113  int *dmli);
114 
115 
117 vrna_exp_E_mb_loop_fast( vrna_fold_compound_t *vc,
118  int i,
119  int j,
120  FLT_OR_DBL *qqm1);
121 
122 
123 
124 /*
125 #################################
126 # Backtracking functions below #
127 #################################
128 */
129 
130 int
131 vrna_BT_mb_loop_fake( vrna_fold_compound_t *vc,
132  int *u,
133  int *i,
134  int *j,
135  vrna_bp_stack_t *bp_stack,
136  int *stack_count);
137 
138 int
139 vrna_BT_mb_loop_split(vrna_fold_compound_t *vc,
140  int *i,
141  int *j,
142  int *k,
143  int *l,
144  int *component1,
145  int *component2,
146  vrna_bp_stack_t *bp_stack,
147  int *stack_count);
148 
149 int
151  int *i,
152  int *j,
153  int *k,
154  int en,
155  int *component1,
156  int *component2);
157 
158 /*
159 ########################################
160 # BEGIN OF INLINE FUNCTION DEFINITIONS #
161 ########################################
162 */
163 
164 
165 PRIVATE INLINE int E_MLstem(int type, int si1, int sj1, vrna_param_t *P){
166  int energy = 0;
167  if(si1 >= 0 && sj1 >= 0){
168  energy += P->mismatchM[type][si1][sj1];
169  }
170  else if (si1 >= 0){
171  energy += P->dangle5[type][si1];
172  }
173  else if (sj1 >= 0){
174  energy += P->dangle3[type][sj1];
175  }
176 
177  if(type > 2)
178  energy += P->TerminalAU;
179 
180  energy += P->MLintern[type];
181 
182  return energy;
183 }
184 
185 
186 
187 PRIVATE INLINE FLT_OR_DBL
188 exp_E_MLstem( int type,
189  int si1,
190  int sj1,
191  vrna_exp_param_t *P){
192 
193  double energy = 1.0;
194  if(si1 >= 0 && sj1 >= 0){
195  energy = P->expmismatchM[type][si1][sj1];
196  }
197  else if(si1 >= 0){
198  energy = P->expdangle5[type][si1];
199  }
200  else if(sj1 >= 0){
201  energy = P->expdangle3[type][sj1];
202  }
203 
204  if(type > 2)
205  energy *= P->expTermAU;
206 
207  energy *= P->expMLintern[type];
208  return (FLT_OR_DBL)energy;
209 }
210 
215 #endif
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:424
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:50
General utility- and helper-functions used throughout the ViennaRNA Package.
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)
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:94
Base pair stack element.
Definition: data_structures.h:192
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 .