1 #ifndef VIENNA_RNA_PACKAGE_GQUAD_H 2 #define VIENNA_RNA_PACKAGE_GQUAD_H 10 # define INLINE inline 40 void E_gquad_ali_en(
int i,
70 int *get_gquad_ali_matrix(
short *S_cons,
82 FLT_OR_DBL *get_gquad_pf_matrix_comparative(
short *S_cons,
90 int **get_gquad_L_matrix(
short *S,
102 void get_gquad_pattern_mfe(
short *S,
111 get_gquad_pattern_exhaustive(
short *S,
120 void get_gquad_pattern_pf(
short *S,
128 plist *get_plist_gquad_from_pr(
short *S,
137 plist *get_plist_gquad_from_pr_max(
short *S,
148 plist *get_plist_gquad_from_db(
const char *structure,
166 int get_gquad_count(
short *S,
171 int get_gquad_layer_count(
short *S,
176 void get_gquad_pattern_mfe_ali(
short **S,
214 INLINE PRIVATE
int backtrack_GQuad_IntLoop_comparative(
int c,
263 int l[3], L, a, n_seq;
270 S = vc->sequence_encoding2;
273 get_gquad_pattern_mfe(S, i, j, P, &L, l);
279 get_gquad_pattern_mfe_ali(vc->
S, vc->a2s, vc->
S_cons, n_seq, i, j, P, &L, l);
285 for (a = 0; a < L; a++) {
286 bp_stack[++(*stack_count)].i = i + a;
287 bp_stack[(*stack_count)].j = i + a;
288 bp_stack[++(*stack_count)].i = i + L + l[0] + a;
289 bp_stack[(*stack_count)].j = i + L + l[0] + a;
290 bp_stack[++(*stack_count)].i = i + L + l[0] + L + l[1] + a;
291 bp_stack[(*stack_count)].j = i + L + l[0] + L + l[1] + a;
292 bp_stack[++(*stack_count)].i = i + L + l[0] + L + l[1] + L + l[2] + a;
293 bp_stack[(*stack_count)].j = i + L + l[0] + L + l[1] + L + l[2] + a;
313 int energy,
dangles, *idx, ij, p, q, maxl, minl, c0, l1, *ggg;
316 short si, sj, *S, *S1;
326 type = (
unsigned char)ptype[ij];
328 S = vc->sequence_encoding2;
336 energy += P->mismatchI[type][si][sj];
339 energy += P->TerminalAU;
343 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
344 minl = j - i + p -
MAXLOOP - 2;
345 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
346 minl =
MAX2(c0, minl);
348 maxl = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
349 maxl =
MIN2(c0, maxl);
350 for (q = minl; q < maxl; q++) {
354 if (en == energy + ggg[idx[q] + p] + P->internal_loop[j - q - 1])
355 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
361 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
370 minl = j - i + p - MAXLOOP - 2;
371 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
372 minl =
MAX2(c0, minl);
374 maxl = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
375 maxl =
MIN2(c0, maxl);
376 for (q = minl; q < maxl; q++) {
380 if (en == energy + ggg[idx[q] + p] + P->internal_loop[l1 + j - q - 1])
381 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
388 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
397 if (en == energy + ggg[idx[q] + p] + P->internal_loop[l1])
398 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
434 int energy,
dangles, k, l, maxl, minl, c0, l1;
443 energy += P->mismatchI[type][si][sj];
446 energy += P->TerminalAU;
450 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
451 minl = j - i + k - MAXLOOP - 2;
452 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
453 minl =
MAX2(c0, minl);
455 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
456 maxl =
MIN2(c0, maxl);
457 for (l = minl; l < maxl; l++) {
461 if (c == energy + ggg[index[l] + k] + P->internal_loop[j - l - 1]) {
471 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
480 minl = j - i + k - MAXLOOP - 2;
481 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
482 minl =
MAX2(c0, minl);
484 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
485 maxl =
MIN2(c0, maxl);
486 for (l = minl; l < maxl; l++) {
490 if (c == energy + ggg[index[l] + k] + P->internal_loop[l1 + j - l - 1]) {
501 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
510 if (c == energy + ggg[index[l] + k] + P->internal_loop[l1]) {
522 backtrack_GQuad_IntLoop_comparative(
int c,
537 int energy,
dangles, k, l, maxl, minl, c0, l1, ss, tt, u1, u2, eee;
542 for (ss = 0; ss < n_seq; ss++) {
548 energy += P->mismatchI[tt][S3[ss][i]][S5[ss][j]];
551 energy += P->TerminalAU;
555 if (S_cons[k] == 3) {
556 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
557 minl = j - i + k - MAXLOOP - 2;
558 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
559 minl =
MAX2(c0, minl);
561 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
562 maxl =
MIN2(c0, maxl);
563 for (l = minl; l < maxl; l++) {
569 for (ss = 0; ss < n_seq; ss++) {
570 u1 = a2s[ss][j - 1] - a2s[ss][l];
571 eee += P->internal_loop[u1];
574 if (c == energy + ggg[index[l] + k] + eee) {
584 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
593 minl = j - i + k - MAXLOOP - 2;
594 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
595 minl =
MAX2(c0, minl);
597 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
598 maxl =
MIN2(c0, maxl);
599 for (l = minl; l < maxl; l++) {
605 for (ss = 0; ss < n_seq; ss++) {
606 u1 = a2s[ss][k - 1] - a2s[ss][i];
607 u2 = a2s[ss][j - 1] - a2s[ss][l];
608 eee += P->internal_loop[u1 + u2];
611 if (c == energy + ggg[index[l] + k] + eee) {
622 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
633 for (ss = 0; ss < n_seq; ss++) {
634 u1 = a2s[ss][k - 1] - a2s[ss][i];
635 eee += P->internal_loop[u1];
638 if (c == energy + ggg[index[l] + k] + eee) {
677 int energy,
dangles, k, l, maxl, minl, c0, l1;
686 energy += P->mismatchI[type][si][sj];
689 energy += P->TerminalAU;
693 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
694 minl = j - i + k - MAXLOOP - 2;
695 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
696 minl =
MAX2(c0, minl);
698 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
699 maxl =
MIN2(c0, maxl);
700 for (l = minl; l < maxl; l++) {
704 if (c == energy + ggg[k][l - k] + P->internal_loop[j - l - 1]) {
714 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
723 minl = j - i + k - MAXLOOP - 2;
724 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
725 minl =
MAX2(c0, minl);
727 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
728 maxl =
MIN2(c0, maxl);
729 for (l = minl; l < maxl; l++) {
733 if (c == energy + ggg[k][l - k] + P->internal_loop[l1 + j - l - 1]) {
744 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
753 if (c == energy + ggg[k][l - k] + P->internal_loop[l1]) {
765 backtrack_GQuad_IntLoop_L_comparative(
int c,
785 int mm, dangle_model, k, l, maxl, minl, c0, l1, ss, tt, eee, u1, u2;
790 for (ss = 0; ss < n_seq; ss++) {
793 if (dangle_model == 2)
794 mm += P->mismatchI[tt][S3[ss][i]][S5[ss][j]];
801 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
810 minl = j - i + k - MAXLOOP - 2;
811 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
812 minl =
MAX2(c0, minl);
814 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
815 maxl =
MIN2(c0, maxl);
816 for (l = minl; l < maxl; l++) {
822 for (ss = 0; ss < n_seq; ss++) {
823 u1 = a2s[ss][k - 1] - a2s[ss][i];
824 u2 = a2s[ss][j - 1] - a2s[ss][l];
825 eee += P->internal_loop[u1 + u2];
840 if (S_cons[k] == 3) {
841 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
842 minl = j - i + k - MAXLOOP - 2;
843 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
844 minl =
MAX2(c0, minl);
846 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
847 maxl =
MIN2(c0, maxl);
848 for (l = minl; l < maxl; l++) {
854 for (ss = 0; ss < n_seq; ss++) {
855 u1 = a2s[ss][j - 1] - a2s[ss][l];
856 eee += P->internal_loop[u1];
859 if (c == mm + ggg[k][l - k] + eee) {
869 if (S_cons[l] == 3) {
870 for (k = i + 4; k < j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
880 for (ss = 0; ss < n_seq; ss++) {
881 u1 = a2s[ss][k - 1] - a2s[ss][i];
882 eee += P->internal_loop[u1];
885 if (c == mm + ggg[k][l - k] + eee) {
899 E_GQuad_IntLoop(
int i,
907 int energy, ge,
dangles, p, q, l1, minq, maxq, c0;
916 energy += P->mismatchI[type][si][sj];
919 energy += P->TerminalAU;
925 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
926 minq = j - i + p - MAXLOOP - 2;
927 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
928 minq =
MAX2(c0, minq);
930 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
931 maxq =
MIN2(c0, maxq);
932 for (q = minq; q < maxq; q++) {
936 c0 = energy + ggg[index[q] + p] + P->internal_loop[j - q - 1];
943 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
952 minq = j - i + p - MAXLOOP - 2;
953 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
954 minq =
MAX2(c0, minq);
956 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
957 maxq =
MIN2(c0, maxq);
958 for (q = minq; q < maxq; q++) {
962 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
970 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
979 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1];
986 en1 = energy + P->dangle5[type][si];
987 en2 = energy + P->dangle5[type][sj];
988 en3 = energy + P->mismatchI[type][si][sj];
993 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
994 minq = j - i + p - MAXLOOP - 2;
995 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
996 minq =
MAX2(c0, minq);
998 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
999 maxq =
MIN2(c0, maxq);
1000 for (q = minq; q < maxq; q++) {
1004 c0 = en1 + ggg[index[q] + p] + P->internal_loop[j - q - 1];
1010 for (p = i + 2; p < j - VRNA_GQUAD_MIN_BOX_SIZE; p++) {
1018 minq = j - i + p - MAXLOOP - 2;
1019 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1020 minq =
MAX2(c0, minq);
1022 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1023 maxq =
MIN2(c0, maxq);
1024 for (q = minq; q < maxq; q++) {
1028 c0 = en1 + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
1035 for (p = i + 4; p < j - VRNA_GQUAD_MIN_BOX_SIZE; p++) {
1043 c0 = en1 + ggg[index[q] + p] + P->internal_loop[l1 + 1];
1057 E_GQuad_IntLoop_comparative(
int i,
1070 int eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;
1076 for (s = 0; s < n_seq; s++) {
1079 energy += P->mismatchI[type][S3[s][i]][S5[s][j]];
1082 energy += P->TerminalAU;
1088 if (S_cons[p] == 3) {
1089 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1090 minq = j - i + p - MAXLOOP - 2;
1091 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1092 minq =
MAX2(c0, minq);
1094 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1095 maxq =
MIN2(c0, maxq);
1096 for (q = minq; q < maxq; q++) {
1102 for (s = 0; s < n_seq; s++) {
1103 u1 = a2s[s][j - 1] - a2s[s][q];
1104 eee += P->internal_loop[u1];
1116 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1125 minq = j - i + p - MAXLOOP - 2;
1126 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1127 minq =
MAX2(c0, minq);
1129 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1130 maxq =
MIN2(c0, maxq);
1131 for (q = minq; q < maxq; q++) {
1137 for (s = 0; s < n_seq; s++) {
1138 u1 = a2s[s][p - 1] - a2s[s][i];
1139 u2 = a2s[s][j - 1] - a2s[s][q];
1140 eee += P->internal_loop[u1 + u2];
1153 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1164 for (s = 0; s < n_seq; s++) {
1165 u1 = a2s[s][p - 1] - a2s[s][i];
1166 eee += P->internal_loop[u1];
1181 E_GQuad_IntLoop_L_comparative(
int i,
1193 int eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;
1199 for (s = 0; s < n_seq; s++) {
1202 energy += P->mismatchI[type][S3[s][i]][S5[s][j]];
1205 energy += P->TerminalAU;
1211 if (S_cons[p] == 3) {
1212 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1213 minq = j - i + p - MAXLOOP - 2;
1214 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1215 minq =
MAX2(c0, minq);
1217 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1218 maxq =
MIN2(c0, maxq);
1219 for (q = minq; q < maxq; q++) {
1225 for (s = 0; s < n_seq; s++) {
1226 u1 = a2s[s][j - 1] - a2s[s][q];
1227 eee += P->internal_loop[u1];
1239 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1248 minq = j - i + p - MAXLOOP - 2;
1249 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1250 minq =
MAX2(c0, minq);
1252 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1253 maxq =
MIN2(c0, maxq);
1254 for (q = minq; q < maxq; q++) {
1260 for (s = 0; s < n_seq; s++) {
1261 u1 = a2s[s][p - 1] - a2s[s][i];
1262 u2 = a2s[s][j - 1] - a2s[s][q];
1263 eee += P->internal_loop[u1 + u2];
1276 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1287 for (s = 0; s < n_seq; s++) {
1288 u1 = a2s[s][p - 1] - a2s[s][i];
1289 eee += P->internal_loop[u1];
1304 E_GQuad_IntLoop_exhaustive(
int i,
1315 int energy, *ge,
dangles, p, q, l1, minq, maxq, c0;
1325 energy += P->mismatchI[type][si][sj];
1328 energy += P->TerminalAU;
1337 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1338 minq = j - i + p - MAXLOOP - 2;
1339 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1340 minq =
MAX2(c0, minq);
1342 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1343 maxq =
MIN2(c0, maxq);
1344 for (q = minq; q < maxq; q++) {
1348 c0 = energy + ggg[index[q] + p] + P->internal_loop[j - q - 1];
1349 if (c0 <= threshold) {
1350 ge[cnt] = energy + P->internal_loop[j - q - 1];
1359 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1368 minq = j - i + p - MAXLOOP - 2;
1369 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1370 minq =
MAX2(c0, minq);
1372 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1373 maxq =
MIN2(c0, maxq);
1374 for (q = minq; q < maxq; q++) {
1378 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
1379 if (c0 <= threshold) {
1380 ge[cnt] = energy + P->internal_loop[l1 + j - q - 1];
1390 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1399 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1];
1400 if (c0 <= threshold) {
1401 ge[cnt] = energy + P->internal_loop[l1];
1415 E_GQuad_IntLoop_L(
int i,
1423 int energy, ge,
dangles, p, q, l1, minq, maxq, c0;
1432 energy += P->mismatchI[type][si][sj];
1435 energy += P->TerminalAU;
1441 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1442 minq = j - i + p - MAXLOOP - 2;
1443 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1444 minq =
MAX2(c0, minq);
1446 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1447 maxq =
MIN2(c0, maxq);
1448 for (q = minq; q < maxq; q++) {
1452 c0 = energy + ggg[p][q - p] + P->internal_loop[j - q - 1];
1459 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1468 minq = j - i + p - MAXLOOP - 2;
1469 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1470 minq =
MAX2(c0, minq);
1472 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1473 maxq =
MIN2(c0, maxq);
1474 for (q = minq; q < maxq; q++) {
1478 c0 = energy + ggg[p][q - p] + P->internal_loop[l1 + j - q - 1];
1486 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1495 c0 = energy + ggg[p][q - p] + P->internal_loop[l1];
1505 exp_E_GQuad_IntLoop(
int i,
1514 int k, l, minl, maxl, u, r;
1522 qe = (
FLT_OR_DBL)pf->expmismatchI[type][si][sj];
1523 expintern = &(pf->expinternal[0]);
1530 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1531 minl = j - MAXLOOP - 1;
1532 u = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1533 minl =
MAX2(u, minl);
1535 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1536 maxl =
MIN2(u, maxl);
1537 for (l = minl; l < maxl; l++) {
1541 if (G[index[k] - l] == 0.)
1553 k <= j - VRNA_GQUAD_MIN_BOX_SIZE;
1562 minl = j - i + k - MAXLOOP - 2;
1563 r = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1564 minl =
MAX2(r, minl);
1565 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1567 maxl =
MIN2(r, maxl);
1568 for (l = minl; l < maxl; l++) {
1572 if (G[index[k] - l] == 0.)
1578 * scale[u + j - l + 1];
1584 for (k = i + 4; k <= j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
1592 if (G[index[k] - l] == 0.)
1607 exp_E_GQuad_IntLoop_comparative(
int i,
1621 int k, l, minl, maxl, u, u1, u2, r, s;
1629 expintern = &(pf->expinternal[0]);
1631 for (s = 0; s < n_seq; s++) {
1634 qe *= (
FLT_OR_DBL)pf->expmismatchI[type][S3[s][i]][S5[s][j]];
1641 if (S_cons[k] == 3) {
1642 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1643 minl = j - MAXLOOP - 1;
1644 u = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1645 minl =
MAX2(u, minl);
1647 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1648 maxl =
MIN2(u, maxl);
1649 for (l = minl; l < maxl; l++) {
1653 if (G[index[k] - l] == 0.)
1658 for (s = 0; s < n_seq; s++) {
1659 u1 = a2s[s][j - 1] - a2s[s][l];
1660 qqq *= expintern[u1];
1672 k <= j - VRNA_GQUAD_MIN_BOX_SIZE;
1681 minl = j - i + k - MAXLOOP - 2;
1682 r = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1683 minl =
MAX2(r, minl);
1684 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1686 maxl =
MIN2(r, maxl);
1687 for (l = minl; l < maxl; l++) {
1691 if (G[index[k] - l] == 0.)
1696 for (s = 0; s < n_seq; s++) {
1697 u1 = a2s[s][k - 1] - a2s[s][i];
1698 u2 = a2s[s][j - 1] - a2s[s][l];
1699 qqq *= expintern[u1 + u2];
1705 scale[u + j - l + 1];
1711 for (k = i + 4; k <= j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
1719 if (G[index[k] - l] == 0.)
1724 for (s = 0; s < n_seq; s++) {
1725 u1 = a2s[s][k - 1] - a2s[s][i];
1726 qqq *= expintern[u1];
void * vrna_alloc(unsigned size)
Allocate space safely.
short ** S
Numerical encoding of the sequences in the alignment.
Definition: fold_compound.h:271
short * S_cons
Numerical encoding of the consensus sequence.
Definition: fold_compound.h:268
char * ptype
Pair type array.
Definition: fold_compound.h:226
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: fold_compound.h:221
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:96
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:154
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
The datastructure that contains temperature scaled energy parameters.
Definition: basic.h:57
#define MIN2(A, B)
Get the minimum of two comparable values.
Definition: basic.h:111
#define MAXLOOP
Definition: constants.h:29
int parse_gquad(const char *struc, int *L, int l[3])
#define INF
Definition: constants.h:17
int * jindx
DP matrix accessor.
Definition: fold_compound.h:167
Various data structures and pre-processor macros.
PRIVATE int backtrack_GQuad_IntLoop(int c, int i, int j, int type, short *S, int *ggg, int *index, int *p, int *q, vrna_param_t *P)
Definition: gquad.h:423
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:180
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: basic.h:103
Definition: fold_compound.h:116
#define MAX2(A, B)
Get the maximum of two comparable values.
Definition: basic.h:116
vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition: fold_compound.h:163
unsigned int n_seq
The number of sequences in the alignment.
Definition: fold_compound.h:262
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: fold_compound.h:160
Definition: fold_compound.h:115
int dangles
Specifies the dangle model used in any energy evaluation (0,1,2 or 3)
Definition: model.h:184
Base pair stack element.
Definition: basic.h:143
FLT_OR_DBL * pr
A pointer to the base pair probability matrix.
Functions to deal with sets of energy parameters.
The Basic Fold Compound API.
int dangles
Switch the energy model for dangling end contributions (0, 1, 2, 3)
int * get_gquad_matrix(short *S, vrna_param_t *P)
Get a triangular matrix prefilled with minimum free energy contributions of G-quadruplexes.
Data structure representing a single entry of an element probability list (e.g. list of pair probabil...
Definition: structures.h:453
int * ggg
Energies of g-quadruplexes.
Definition: dp_matrices.h:73
const vrna_fc_type_e type
The type of the vrna_fold_compound_t.
Definition: fold_compound.h:137
PRIVATE int backtrack_GQuad_IntLoop_L(int c, int i, int j, int type, short *S, int **ggg, int maxdist, int *p, int *q, vrna_param_t *P)
Definition: gquad.h:666