RNAlib-2.2.0-RC3
exterior_loops.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_EXTERIOR_LOOPS_H
2 #define VIENNA_RNA_PACKAGE_EXTERIOR_LOOPS_H
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <math.h>
7 #include <ctype.h>
8 #include <string.h>
9 #include <ViennaRNA/fold_vars.h>
10 #include <ViennaRNA/energy_par.h>
11 #include <ViennaRNA/params.h>
12 #include <ViennaRNA/constraints.h>
13 #include <ViennaRNA/gquad.h>
14 
15 #ifdef __GNUC__
16 # define INLINE inline
17 #else
18 # define INLINE
19 #endif
20 
21 #ifdef ON_SAME_STRAND
22 #undef ON_SAME_STRAND
23 #endif
24 
25 #define ON_SAME_STRAND(I,J,C) (((I)>=(C))||((J)<(C)))
26 
54 INLINE PRIVATE int E_ExtLoop(int type,
55  int si1,
56  int sj1,
57  vrna_param_t *P);
58 
64 INLINE PRIVATE double exp_E_ExtLoop( int type,
65  int si1,
66  int sj1,
67  vrna_exp_param_t *P);
68 
114 INLINE PRIVATE int E_Stem( int type,
115  int si1,
116  int sj1,
117  int extLoop,
118  vrna_param_t *P);
119 
128 INLINE PRIVATE double exp_E_Stem(int type,
129  int si1,
130  int sj1,
131  int extLoop,
132  vrna_exp_param_t *P);
133 
134 
135 /*
136 #################################
137 # BEGIN OF FUNCTION DEFINITIONS #
138 #################################
139 */
140 
141 INLINE PRIVATE int
142 E_ext_loop( int i,
143  int j,
144  vrna_fold_compound *vc){
145 
146  int ij, en, e, type;
147 
148  int cp = vc->cutpoint;
149  short *S = vc->sequence_encoding;
150  int *idx = vc->jindx;
151  char *ptype = vc->ptype;
152  vrna_param_t *P = vc->params;
153  vrna_md_t *md = &(P->model_details);
154  char *hard_constraints = vc->hc->matrix;
155 
156  e = INF;
157  ij = idx[j] + i;
158  type = ptype[ij];
159 
160  if((cp < 0) || (((i)>=cp)||((j)<cp))){ /* regular exterior loop */
161  switch(md->dangles){
162  case 0: if(hard_constraints[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP)
163  e = E_ExtLoop(type, -1, -1, P);
164  break;
165  case 2: if(hard_constraints[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP)
166  e = E_ExtLoop(type, S[i-1], S[j+1], P);
167  break;
168  default: if(hard_constraints[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP)
169  e = E_ExtLoop(type, -1, -1, P);
170  ij = idx[j - 1] + i;
171  if(hard_constraints[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
172  type = vc->ptype[ij];
173  en = E_ExtLoop(type, -1, S[j], P);
174  e = MIN2(e, en);
175  }
176  ij = idx[j] + i + 1;
177  if(hard_constraints[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
178  type = vc->ptype[ij];
179  en = E_ExtLoop(type, S[i], -1, P);
180  e = MIN2(e, en);
181  }
182  break;
183  }
184  }
185 
186  return e;
187 }
188 
189 
190 INLINE PRIVATE void
191 E_ext_loop_5( vrna_fold_compound *vc){
192 
193  int en, i, j, ij, type;
194  int length = (int)vc->length;
195  char *ptype = vc->ptype;
196  short *S = vc->sequence_encoding;
197  int *indx = vc->jindx;
198  char *hc = vc->hc->matrix;
199  int *hc_up = vc->hc->up_ext;
200  vrna_sc_t *sc = vc->sc;
201  int *f5 = vc->matrices->f5;
202  int *c = vc->matrices->c;
203  vrna_param_t *P = vc->params;
204  int dangle_model = P->model_details.dangles;
205  int *ggg = vc->matrices->ggg;
206  int with_gquad = P->model_details.gquad;
207  int turn = P->model_details.min_loop_size;
208 
209  f5[0] = 0;
210  for(i = 1; i <= turn + 1; i++){
211  if(hc_up[i]){
212  f5[i] = f5[i-1];
213  if(sc && (f5[i] != INF))
214  if(sc->free_energies)
215  f5[i] += sc->free_energies[i][1];
216  } else {
217  f5[i] = INF;
218  }
219  }
220 
221  /* duplicated code may be faster than conditions inside loop ;) */
222  switch(dangle_model){
223  /* dont use dangling end and mismatch contributions at all */
224  case 0: for(j=turn+2; j<=length; j++){
225  f5[j] = INF;
226  if(hc_up[j]){
227  f5[j] = f5[j-1];
228  if(sc && (f5[j] != INF))
229  if(sc->free_energies)
230  f5[j] += sc->free_energies[j][1];
231  }
232  for (i=j-turn-1; i>1; i--){
233  ij = indx[j]+i;
234  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
235  continue;
236  if(f5[i-1] == INF)
237  continue;
238 
239  if(with_gquad){
240  f5[j] = MIN2(f5[j], f5[i-1] + ggg[indx[j]+i]);
241  }
242 
243  if(c[ij] != INF){
244  en = f5[i-1] + c[ij] + E_ExtLoop(ptype[ij], -1, -1, P);
245  f5[j] = MIN2(f5[j], en);
246  }
247  }
248 
249  ij = indx[j] + 1;
250  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
251  continue;
252 
253  if(with_gquad){
254  f5[j] = MIN2(f5[j], ggg[indx[j]+1]);
255  }
256 
257  if(c[ij] != INF){
258  en = c[ij] + E_ExtLoop(ptype[ij], -1, -1, P);
259  f5[j] = MIN2(f5[j], en);
260  }
261  }
262  break;
263 
264  /* always use dangles on both sides */
265  case 2: for(j=turn+2; j<length; j++){
266  f5[j] = INF;
267  if(hc_up[j]){
268  f5[j] = f5[j-1];
269  if(sc && (f5[j] != INF))
270  if(sc->free_energies)
271  f5[j] += sc->free_energies[j][1];
272  }
273  for (i=j-turn-1; i>1; i--){
274  ij = indx[j] + i;
275  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
276  continue;
277  if(f5[i-1] == INF)
278  continue;
279 
280  if(with_gquad){
281  f5[j] = MIN2(f5[j], f5[i-1] + ggg[indx[j]+i]);
282  }
283 
284  if(c[ij] != INF){
285  en = f5[i-1] + c[ij] + E_ExtLoop(ptype[ij], S[i-1], S[j+1], P);
286  f5[j] = MIN2(f5[j], en);
287  }
288  }
289  ij = indx[j] + 1;
290  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
291  continue;
292 
293  if(with_gquad){
294  f5[j] = MIN2(f5[j], ggg[indx[j]+1]);
295  }
296 
297  if(c[ij] != INF){
298  en = c[ij] + E_ExtLoop(ptype[ij], -1, S[j+1], P);
299  f5[j] = MIN2(f5[j], en);
300  }
301  }
302  if(hc_up[length]){
303  f5[length] = f5[length-1];
304  if(sc && (f5[length] != INF))
305  if(sc->free_energies)
306  f5[length] += sc->free_energies[length][1];
307  }
308  for (i=length-turn-1; i>1; i--){
309  ij = indx[length] + i;
310  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
311  continue;
312  if(f5[i-1] == INF)
313  continue;
314 
315  if(with_gquad){
316  f5[length] = MIN2(f5[length], f5[i-1] + ggg[indx[length]+i]);
317  }
318 
319  if(c[ij] != INF){
320  en = f5[i-1] + c[ij] + E_ExtLoop(ptype[ij], S[i-1], -1, P);
321  f5[length] = MIN2(f5[length], en);
322  }
323  }
324  ij = indx[length] + 1;
325  if(!(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP))
326  break;
327 
328  if(with_gquad){
329  f5[length] = MIN2(f5[length], ggg[indx[length]+1]);
330  }
331 
332  if(c[ij] != INF){
333  en = c[ij] + E_ExtLoop(ptype[ij], -1, -1, P);
334  f5[length] = MIN2(f5[length], en);
335  }
336  break;
337 
338  /* normal dangles, aka dangle_model = 1 || 3 */
339  default: for(j=turn+2; j<=length; j++){
340  f5[j] = INF;
341  if(hc_up[j]){
342  f5[j] = f5[j-1];
343  if(sc && (f5[j] != INF))
344  if(sc->free_energies)
345  f5[j] += sc->free_energies[j][1];
346  }
347  for (i=j-turn-1; i>1; i--){
348  ij = indx[j] + i;
349  if(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
350 
351  if(f5[i-1] != INF){
352  if(with_gquad){
353  f5[j] = MIN2(f5[j], f5[i-1] + ggg[indx[j]+i]);
354  }
355 
356  if(c[ij] != INF){
357  type = ptype[ij];
358  en = f5[i-1] + c[ij] + E_ExtLoop(type, -1, -1, P);
359  f5[j] = MIN2(f5[j], en);
360  }
361  }
362  if(hc_up[i-1]){
363  if((f5[i-2] != INF) && c[ij] != INF){
364  en = f5[i-2] + c[ij] + E_ExtLoop(type, S[i-1], -1, P);
365 
366  if(sc)
367  if(sc->free_energies)
368  en += sc->free_energies[i-1][1];
369 
370  f5[j] = MIN2(f5[j], en);
371  }
372  }
373  }
374  ij = indx[j-1] + i;
375  if(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
376  if(hc_up[j]){
377  if(c[ij] != INF){
378  type = ptype[ij];
379  if(f5[i - 1] != INF){
380  en = f5[i-1] + c[ij] + E_ExtLoop(type, -1, S[j], P);
381 
382  if(sc)
383  if(sc->free_energies)
384  en += sc->free_energies[j][1];
385 
386  f5[j] = MIN2(f5[j], en);
387  }
388 
389  if(hc_up[i-1]){
390  if(f5[i - 2] != INF){
391  en = f5[i-2] + c[ij] + E_ExtLoop(type, S[i-1], S[j], P);
392 
393  if(sc)
394  if(sc->free_energies)
395  en += sc->free_energies[i-1][1] + sc->free_energies[j][1];
396 
397  f5[j] = MIN2(f5[j], en);
398  }
399  }
400  }
401  }
402  }
403  }
404  ij = indx[j] + 1;
405  if(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
406 
407  if(with_gquad){
408  f5[j] = MIN2(f5[j], ggg[indx[j]+1]);
409  }
410 
411  if(c[ij] != INF){
412  type = ptype[ij];
413  en = c[ij] + E_ExtLoop(type, -1, -1, P);
414  f5[j] = MIN2(f5[j], en);
415  }
416  }
417  ij = indx[j-1] + 1;
418  if(hc[ij] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
419  if(hc_up[j]){
420  if(c[ij] != INF){
421  type = ptype[ij];
422  en = c[ij] + E_ExtLoop(type, -1, S[j], P);
423 
424  if(sc)
425  if(sc->free_energies)
426  en += sc->free_energies[j][1];
427 
428  f5[j] = MIN2(f5[j], en);
429  }
430  }
431  }
432  }
433  }
434 }
435 
436 INLINE PRIVATE int
437 E_Stem( int type,
438  int si1,
439  int sj1,
440  int extLoop,
441  vrna_param_t *P){
442 
443  int energy = 0;
444  int d5 = (si1 >= 0) ? P->dangle5[type][si1] : 0;
445  int d3 = (sj1 >= 0) ? P->dangle3[type][sj1] : 0;
446 
447  if(type > 2)
448  energy += P->TerminalAU;
449 
450  if(si1 >= 0 && sj1 >= 0)
451  energy += (extLoop) ? P->mismatchExt[type][si1][sj1] : P->mismatchM[type][si1][sj1];
452  else
453  energy += d5 + d3;
454 
455  if(!extLoop) energy += P->MLintern[type];
456  return energy;
457 }
458 
459 INLINE PRIVATE int
460 E_ExtLoop(int type,
461  int si1,
462  int sj1,
463  vrna_param_t *P){
464 
465  int energy = 0;
466  if(si1 >= 0 && sj1 >= 0){
467  energy += P->mismatchExt[type][si1][sj1];
468  }
469  else if (si1 >= 0){
470  energy += P->dangle5[type][si1];
471  }
472  else if (sj1 >= 0){
473  energy += P->dangle3[type][sj1];
474  }
475 
476  if(type > 2)
477  energy += P->TerminalAU;
478 
479  return energy;
480 }
481 
482 INLINE PRIVATE double
483 exp_E_Stem( int type,
484  int si1,
485  int sj1,
486  int extLoop,
487  vrna_exp_param_t *P){
488 
489  double energy = 1.0;
490  double d5 = (si1 >= 0) ? P->expdangle5[type][si1] : 1.;
491  double d3 = (sj1 >= 0) ? P->expdangle3[type][sj1] : 1.;
492 
493  if(si1 >= 0 && sj1 >= 0)
494  energy = (extLoop) ? P->expmismatchExt[type][si1][sj1] : P->expmismatchM[type][si1][sj1];
495  else
496  energy = d5 * d3;
497 
498  if(type > 2)
499  energy *= P->expTermAU;
500 
501  if(!extLoop) energy *= P->expMLintern[type];
502  return energy;
503 }
504 
505 INLINE PRIVATE double
506 exp_E_ExtLoop(int type,
507  int si1,
508  int sj1,
509  vrna_exp_param_t *P){
510 
511  double energy = 1.0;
512  if(si1 >= 0 && sj1 >= 0){
513  energy = P->expmismatchExt[type][si1][sj1];
514  }
515  else if(si1 >= 0){
516  energy = P->expdangle5[type][si1];
517  }
518  else if(sj1 >= 0){
519  energy = P->expdangle3[type][sj1];
520  }
521 
522  if(type > 2)
523  energy *= P->expTermAU;
524 
525  return energy;
526 }
527 
528 INLINE PRIVATE int
529 vrna_BT_ext_loop_f5(vrna_fold_compound *vc,
530  int *k,
531  int *i,
532  int *j,
533  bondT *bp_stack,
534  int *stack_count){
535 
536  int length, cp, fij, fi, jj, u, en, *my_f5, *my_c, *my_ggg, *idx, dangle_model, turn, with_gquad;
537  unsigned char type;
538  char *ptype;
539  short mm5, mm3, *S1;
540 
541  vrna_param_t *P;
542  vrna_md_t *md;
543  vrna_hc_t *hc;
544  vrna_sc_t *sc;
545 
546  length = vc->length;
547  cp = vc->cutpoint;
548  P = vc->params;
549  md = &(P->model_details);
550  hc = vc->hc;
551  sc = vc->sc;
552  my_f5 = vc->matrices->f5;
553  my_c = vc->matrices->c;
554  my_ggg = vc->matrices->ggg;
555  idx = vc->jindx;
556  ptype = vc->ptype;
557  S1 = vc->sequence_encoding;
558  dangle_model = md->dangles;
559  turn = md->min_loop_size;
560  with_gquad = md->gquad;
561 
562  jj = *k;
563 
564  /* nibble off unpaired 3' bases */
565  do{
566  fij = my_f5[jj];
567  fi = (hc->up_ext[jj]) ? my_f5[jj-1] : INF;
568 
569  if(sc){
570  if(sc->free_energies)
571  fi += sc->free_energies[jj][1];
572  }
573 
574  if(--jj == 0)
575  break;
576 
577  } while (fij == fi);
578  jj++;
579 
580  if (jj < turn + 2){ /* no more pairs */
581  *i = *j = -1;
582  *k = 0;
583  return 1;
584  }
585 
586  /* must have found a decomposition */
587  switch(dangle_model){
588  case 0: /* j is paired. Find pairing partner */
589  for(u = jj - turn - 1; u >= 1; u--){
590 
591  if(with_gquad){
592  if(fij == my_f5[u - 1] + my_ggg[idx[jj] + u]){
593  *i = *j = -1;
594  *k = u - 1;
595  vrna_BT_gquad_mfe(vc, u, jj, bp_stack, stack_count);
596  return 1;
597  }
598  }
599 
600  if(hc->matrix[idx[jj] + u] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
601  type = (unsigned char)ptype[idx[jj] + u];
602  en = my_c[idx[jj] + u];
603  if(!ON_SAME_STRAND(u, jj, cp))
604  en += P->DuplexInit;
605  if(fij == E_ExtLoop(type, -1, -1, P) + en + my_f5[u - 1]){
606  *i = u;
607  *j = jj;
608  *k = u - 1;
609  bp_stack[++(*stack_count)].i = u;
610  bp_stack[(*stack_count)].j = jj;
611  return 1;
612  }
613  }
614  }
615  break;
616 
617  case 2: mm3 = ((jj<length) && ON_SAME_STRAND(jj, jj + 1, cp)) ? S1[jj+1] : -1;
618  for(u = jj - turn - 1; u >= 1; u--){
619 
620  if(with_gquad){
621  if(fij == my_f5[u - 1] + my_ggg[idx[jj] + u]){
622  *i = *j = -1;
623  *k = u - 1;
624  vrna_BT_gquad_mfe(vc, u, jj, bp_stack, stack_count);
625  return 1;
626  }
627  }
628 
629  if(hc->matrix[idx[jj] + u] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
630  mm5 = ((u > 1) && ON_SAME_STRAND(u - 1, u, cp)) ? S1[u - 1] : -1;
631  type = (unsigned char)ptype[idx[jj] + u];
632  en = my_c[idx[jj] + u];
633  if(!ON_SAME_STRAND(u, jj, cp))
634  en += P->DuplexInit;
635  if(fij == E_ExtLoop(type, mm5, mm3, P) + en + my_f5[u - 1]){
636  *i = u;
637  *j = jj;
638  *k = u - 1;
639  bp_stack[++(*stack_count)].i = u;
640  bp_stack[(*stack_count)].j = jj;
641  return 1;
642  }
643  }
644  }
645  break;
646 
647  default: if(with_gquad){
648  if(fij == my_ggg[idx[jj] + 1]){
649  *i = *j = -1;
650  *k = 0;
651  vrna_BT_gquad_mfe(vc, 1, jj, bp_stack, stack_count);
652  return 1;
653  }
654  }
655 
656  if(hc->matrix[idx[jj] + 1] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
657  type = (unsigned char)ptype[idx[jj] + 1];
658  en = my_c[idx[jj] + 1];
659  if(!ON_SAME_STRAND(1, jj, cp))
660  en += P->DuplexInit;
661  if(fij == en + E_ExtLoop(type, -1, -1, P)){
662  *i = 1;
663  *j = jj;
664  *k = 0;
665  bp_stack[++(*stack_count)].i = 1;
666  bp_stack[(*stack_count)].j = jj;
667  return 1;
668  }
669  }
670 
671  if(hc->matrix[idx[jj - 1] + 1] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
672  if(hc->up_ext[jj]){
673  if(ON_SAME_STRAND(jj - 1, jj, cp)){
674  mm3 = S1[jj];
675  type = (unsigned char)ptype[idx[jj - 1] + 1];
676  en = my_c[idx[jj - 1] + 1];
677  if(sc)
678  if(sc->free_energies)
679  en += sc->free_energies[jj][1];
680  if(!ON_SAME_STRAND(1, jj - 1, cp))
681  en += P->DuplexInit;
682 
683  if(fij == en + E_ExtLoop(type, -1, mm3, P)){
684  *i = 1;
685  *j = jj - 1;
686  *k = 0;
687  bp_stack[++(*stack_count)].i = 1;
688  bp_stack[(*stack_count)].j = jj - 1;
689  return 1;
690  }
691  }
692  }
693  }
694 
695  for(u = jj - turn - 1; u > 1; u--){
696 
697  if(with_gquad){
698  if(fij == my_f5[u - 1] + my_ggg[idx[jj] + u]){
699  *i = *j = -1;
700  *k = u - 1;
701  vrna_BT_gquad_mfe(vc, u, jj, bp_stack, stack_count);
702  return 1;
703  }
704  }
705 
706  if(hc->matrix[idx[jj] + u] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
707  type = (unsigned char)ptype[idx[jj] + u];
708  en = my_c[idx[jj] + u];
709  if(!ON_SAME_STRAND(u, jj, cp))
710  en += P->DuplexInit;
711 
712  if(fij == my_f5[u - 1] + en + E_ExtLoop(type, -1, -1, P)){
713  *i = u;
714  *j = jj;
715  *k = u - 1;
716  bp_stack[++(*stack_count)].i = u;
717  bp_stack[(*stack_count)].j = jj;
718  return 1;
719  }
720  if(hc->up_ext[u - 1]){
721  if(ON_SAME_STRAND(u - 1, u, cp)){
722  mm5 = S1[u - 1];
723  if(sc)
724  if(sc->free_energies)
725  en += sc->free_energies[u - 1][1];
726 
727  if(fij == my_f5[u - 2] + en + E_ExtLoop(type, mm5, -1, P)){
728  *i = u;
729  *j = jj;
730  *k = u - 2;
731  bp_stack[++(*stack_count)].i = u;
732  bp_stack[(*stack_count)].j = jj;
733  return 1;
734  }
735  }
736  }
737  }
738  if(hc->matrix[idx[jj-1] + u] & VRNA_CONSTRAINT_CONTEXT_EXT_LOOP){
739  if(hc->up_ext[jj])
740  if(ON_SAME_STRAND(jj - 1, jj, cp)){
741  mm3 = S1[jj];
742  type = (unsigned char)ptype[idx[jj - 1] + u];
743  en = my_c[idx[jj - 1] + u];
744  if(!ON_SAME_STRAND(u, jj - 1, cp))
745  en += P->DuplexInit;
746 
747  if(sc)
748  if(sc->free_energies)
749  en += sc->free_energies[jj][1];
750 
751  if(fij == my_f5[u - 1] + en + E_ExtLoop(type, -1, mm3, P)){
752  *i = u;
753  *j = jj - 1;
754  *k = u - 1;
755  bp_stack[++(*stack_count)].i = u;
756  bp_stack[(*stack_count)].j = jj - 1;
757  return 1;
758  }
759 
760  if(hc->up_ext[u - 1]){
761  mm5 = ON_SAME_STRAND(u - 1, u, cp) ? S1[u - 1] : -1;
762  if(sc)
763  if(sc->free_energies)
764  en += sc->free_energies[u - 1][1];
765 
766  if(fij == my_f5[u - 2] + en + E_ExtLoop(type, mm5, mm3, P)){
767  *i = u;
768  *j = jj - 1;
769  *k = u - 2;
770  bp_stack[++(*stack_count)].i = u;
771  bp_stack[(*stack_count)].j = jj - 1;
772  return 1;
773  }
774  }
775  }
776  }
777  }
778  break;
779  }
780 
781  return 0;
782 }
783 
789 #endif
PRIVATE double exp_E_Stem(int type, int si1, int sj1, int extLoop, vrna_exp_param_t *P)
Definition: exterior_loops.h:483
int * ggg
Energies of g-quadruplexes.
Definition: data_structures.h:432
int * c
Energy array, given that i-j pair.
Definition: data_structures.h:425
PRIVATE double exp_E_ExtLoop(int type, int si1, int sj1, vrna_exp_param_t *P)
Definition: exterior_loops.h:506
struct vrna_hc_t * hc
The hard constraints data structure used for structure prediction.
Definition: data_structures.h:716
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint...
Definition: data_structures.h:712
The hard constraints data structure.
Definition: constraints.h:390
char * matrix
Upper triangular matrix encoding where a base pair or unpaired nucleotide is allowed.
Definition: constraints.h:391
struct vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition: data_structures.h:721
int * jindx
DP matrix accessor.
Definition: data_structures.h:725
int gquad
Include G-quadruplexes in structure prediction.
Definition: model.h:184
PRIVATE int E_Stem(int type, int si1, int sj1, int extLoop, vrna_param_t *P)
Definition: exterior_loops.h:437
int * up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop...
Definition: constraints.h:394
int ** free_energies
Energy contribution for unpaired sequence stretches.
Definition: constraints.h:414
#define MIN2(A, B)
Get the minimum of two comparable values.
Definition: utils.h:118
vrna_md_t model_details
Model details to be used in the recursions.
Definition: params.h:79
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:698
PRIVATE int E_ExtLoop(int type, int si1, int sj1, vrna_param_t *P)
Definition: exterior_loops.h:460
#define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP
Hard constraints flag, base pair in the exterior loop.
Definition: constraints.h:201
#define INF
Definition: energy_const.h:16
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: data_structures.h:718
int min_loop_size
Minimum size of hairpin loops.
Definition: model.h:194
int dangles
Specifies the dangle model used in any energy evaluation (0,1,2 or 3)
Definition: model.h:172
unsigned int length
The length of the sequence (or sequence alignment)
Definition: data_structures.h:711
Various functions related to G-quadruplex computations.
char * ptype
Pair type array.
Definition: data_structures.h:749
Base pair.
Definition: data_structures.h:73
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:41
The soft constraints data structure.
Definition: constraints.h:413
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:169
Here all all declarations of the global variables used throughout RNAlib.
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: data_structures.h:744
struct vrna_sc_t * sc
The soft constraints for usage in structure prediction and evaluation.
Definition: data_structures.h:763
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:86
int * f5
Energy of 5' end.
Definition: data_structures.h:426