1 #ifndef VIENNA_RNA_PACKAGE_GQUAD_H 2 #define VIENNA_RNA_PACKAGE_GQUAD_H 39 void E_gquad_ali_en(
int i,
69 int *get_gquad_ali_matrix(
short *S_cons,
81 FLT_OR_DBL *get_gquad_pf_matrix_comparative(
short *S_cons,
89 int **get_gquad_L_matrix(
short *S,
101 void get_gquad_pattern_mfe(
short *S,
110 get_gquad_pattern_exhaustive(
short *S,
119 void get_gquad_pattern_pf(
short *S,
127 plist *get_plist_gquad_from_pr(
short *S,
136 plist *get_plist_gquad_from_pr_max(
short *S,
147 plist *get_plist_gquad_from_db(
const char *structure,
165 int get_gquad_count(
short *S,
170 int get_gquad_layer_count(
short *S,
175 void get_gquad_pattern_mfe_ali(
short **S,
213 INLINE PRIVATE
int backtrack_GQuad_IntLoop_comparative(
int c,
262 int l[3], L, a, n_seq;
269 S = vc->sequence_encoding2;
272 get_gquad_pattern_mfe(S, i, j, P, &L, l);
278 get_gquad_pattern_mfe_ali(vc->
S, vc->a2s, vc->
S_cons, n_seq, i, j, P, &L, l);
284 for (a = 0; a < L; a++) {
285 bp_stack[++(*stack_count)].i = i + a;
286 bp_stack[(*stack_count)].j = i + a;
287 bp_stack[++(*stack_count)].i = i + L + l[0] + a;
288 bp_stack[(*stack_count)].j = i + L + l[0] + a;
289 bp_stack[++(*stack_count)].i = i + L + l[0] + L + l[1] + a;
290 bp_stack[(*stack_count)].j = i + L + l[0] + L + l[1] + a;
291 bp_stack[++(*stack_count)].i = i + L + l[0] + L + l[1] + L + l[2] + a;
292 bp_stack[(*stack_count)].j = i + L + l[0] + L + l[1] + L + l[2] + a;
312 int energy,
dangles, *idx, ij, p, q, maxl, minl, c0, l1, *ggg;
315 short si, sj, *S, *S1;
325 type = (
unsigned char)ptype[ij];
327 S = vc->sequence_encoding2;
335 energy += P->mismatchI[type][si][sj];
338 energy += P->TerminalAU;
342 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
343 minl = j - i + p -
MAXLOOP - 2;
344 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
345 minl =
MAX2(c0, minl);
347 maxl = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
348 maxl =
MIN2(c0, maxl);
349 for (q = minl; q < maxl; q++) {
353 if (en == energy + ggg[idx[q] + p] + P->internal_loop[j - q - 1])
354 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
360 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
369 minl = j - i + p - MAXLOOP - 2;
370 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
371 minl =
MAX2(c0, minl);
373 maxl = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
374 maxl =
MIN2(c0, maxl);
375 for (q = minl; q < maxl; q++) {
379 if (en == energy + ggg[idx[q] + p] + P->internal_loop[l1 + j - q - 1])
380 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
387 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
396 if (en == energy + ggg[idx[q] + p] + P->internal_loop[l1])
397 return vrna_BT_gquad_mfe(vc, p, q, bp_stack, stack_count);
433 int energy,
dangles, k, l, maxl, minl, c0, l1;
442 energy += P->mismatchI[type][si][sj];
445 energy += P->TerminalAU;
449 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
450 minl = j - i + k - MAXLOOP - 2;
451 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
452 minl =
MAX2(c0, minl);
454 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
455 maxl =
MIN2(c0, maxl);
456 for (l = minl; l < maxl; l++) {
460 if (c == energy + ggg[index[l] + k] + P->internal_loop[j - l - 1]) {
470 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
479 minl = j - i + k - MAXLOOP - 2;
480 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
481 minl =
MAX2(c0, minl);
483 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
484 maxl =
MIN2(c0, maxl);
485 for (l = minl; l < maxl; l++) {
489 if (c == energy + ggg[index[l] + k] + P->internal_loop[l1 + j - l - 1]) {
500 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
509 if (c == energy + ggg[index[l] + k] + P->internal_loop[l1]) {
521 backtrack_GQuad_IntLoop_comparative(
int c,
536 int energy,
dangles, k, l, maxl, minl, c0, l1, ss, tt, u1, u2, eee;
541 for (ss = 0; ss < n_seq; ss++) {
547 energy += P->mismatchI[tt][S3[ss][i]][S5[ss][j]];
550 energy += P->TerminalAU;
554 if (S_cons[k] == 3) {
555 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
556 minl = j - i + k - MAXLOOP - 2;
557 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
558 minl =
MAX2(c0, minl);
560 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
561 maxl =
MIN2(c0, maxl);
562 for (l = minl; l < maxl; l++) {
568 for (ss = 0; ss < n_seq; ss++) {
569 u1 = a2s[ss][j - 1] - a2s[ss][l];
570 eee += P->internal_loop[u1];
573 if (c == energy + ggg[index[l] + k] + eee) {
583 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
592 minl = j - i + k - MAXLOOP - 2;
593 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
594 minl =
MAX2(c0, minl);
596 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
597 maxl =
MIN2(c0, maxl);
598 for (l = minl; l < maxl; l++) {
604 for (ss = 0; ss < n_seq; ss++) {
605 u1 = a2s[ss][k - 1] - a2s[ss][i];
606 u2 = a2s[ss][j - 1] - a2s[ss][l];
607 eee += P->internal_loop[u1 + u2];
610 if (c == energy + ggg[index[l] + k] + eee) {
621 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
632 for (ss = 0; ss < n_seq; ss++) {
633 u1 = a2s[ss][k - 1] - a2s[ss][i];
634 eee += P->internal_loop[u1];
637 if (c == energy + ggg[index[l] + k] + eee) {
676 int energy,
dangles, k, l, maxl, minl, c0, l1;
685 energy += P->mismatchI[type][si][sj];
688 energy += P->TerminalAU;
692 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
693 minl = j - i + k - MAXLOOP - 2;
694 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
695 minl =
MAX2(c0, minl);
697 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
698 maxl =
MIN2(c0, maxl);
699 for (l = minl; l < maxl; l++) {
703 if (c == energy + ggg[k][l - k] + P->internal_loop[j - l - 1]) {
713 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
722 minl = j - i + k - MAXLOOP - 2;
723 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
724 minl =
MAX2(c0, minl);
726 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
727 maxl =
MIN2(c0, maxl);
728 for (l = minl; l < maxl; l++) {
732 if (c == energy + ggg[k][l - k] + P->internal_loop[l1 + j - l - 1]) {
743 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
752 if (c == energy + ggg[k][l - k] + P->internal_loop[l1]) {
764 backtrack_GQuad_IntLoop_L_comparative(
int c,
784 int mm, dangle_model, k, l, maxl, minl, c0, l1, ss, tt, eee, u1, u2;
789 for (ss = 0; ss < n_seq; ss++) {
792 if (dangle_model == 2)
793 mm += P->mismatchI[tt][S3[ss][i]][S5[ss][j]];
800 k < j - VRNA_GQUAD_MIN_BOX_SIZE;
809 minl = j - i + k - MAXLOOP - 2;
810 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
811 minl =
MAX2(c0, minl);
813 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
814 maxl =
MIN2(c0, maxl);
815 for (l = minl; l < maxl; l++) {
821 for (ss = 0; ss < n_seq; ss++) {
822 u1 = a2s[ss][k - 1] - a2s[ss][i];
823 u2 = a2s[ss][j - 1] - a2s[ss][l];
824 eee += P->internal_loop[u1 + u2];
839 if (S_cons[k] == 3) {
840 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
841 minl = j - i + k - MAXLOOP - 2;
842 c0 = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
843 minl =
MAX2(c0, minl);
845 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
846 maxl =
MIN2(c0, maxl);
847 for (l = minl; l < maxl; l++) {
853 for (ss = 0; ss < n_seq; ss++) {
854 u1 = a2s[ss][j - 1] - a2s[ss][l];
855 eee += P->internal_loop[u1];
858 if (c == mm + ggg[k][l - k] + eee) {
868 if (S_cons[l] == 3) {
869 for (k = i + 4; k < j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
879 for (ss = 0; ss < n_seq; ss++) {
880 u1 = a2s[ss][k - 1] - a2s[ss][i];
881 eee += P->internal_loop[u1];
884 if (c == mm + ggg[k][l - k] + eee) {
898 E_GQuad_IntLoop(
int i,
906 int energy, ge,
dangles, p, q, l1, minq, maxq, c0;
915 energy += P->mismatchI[type][si][sj];
918 energy += P->TerminalAU;
924 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
925 minq = j - i + p - MAXLOOP - 2;
926 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
927 minq =
MAX2(c0, minq);
929 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
930 maxq =
MIN2(c0, maxq);
931 for (q = minq; q < maxq; q++) {
935 c0 = energy + ggg[index[q] + p] + P->internal_loop[j - q - 1];
942 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
951 minq = j - i + p - MAXLOOP - 2;
952 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
953 minq =
MAX2(c0, minq);
955 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
956 maxq =
MIN2(c0, maxq);
957 for (q = minq; q < maxq; q++) {
961 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
969 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
978 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1];
985 en1 = energy + P->dangle5[type][si];
986 en2 = energy + P->dangle5[type][sj];
987 en3 = energy + P->mismatchI[type][si][sj];
992 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
993 minq = j - i + p - MAXLOOP - 2;
994 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
995 minq =
MAX2(c0, minq);
997 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
998 maxq =
MIN2(c0, maxq);
999 for (q = minq; q < maxq; q++) {
1003 c0 = en1 + ggg[index[q] + p] + P->internal_loop[j - q - 1];
1009 for (p = i + 2; p < j - VRNA_GQUAD_MIN_BOX_SIZE; p++) {
1017 minq = j - i + p - MAXLOOP - 2;
1018 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1019 minq =
MAX2(c0, minq);
1021 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1022 maxq =
MIN2(c0, maxq);
1023 for (q = minq; q < maxq; q++) {
1027 c0 = en1 + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
1034 for (p = i + 4; p < j - VRNA_GQUAD_MIN_BOX_SIZE; p++) {
1042 c0 = en1 + ggg[index[q] + p] + P->internal_loop[l1 + 1];
1056 E_GQuad_IntLoop_comparative(
int i,
1069 int eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;
1075 for (s = 0; s < n_seq; s++) {
1078 energy += P->mismatchI[type][S3[s][i]][S5[s][j]];
1081 energy += P->TerminalAU;
1087 if (S_cons[p] == 3) {
1088 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1089 minq = j - i + p - MAXLOOP - 2;
1090 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1091 minq =
MAX2(c0, minq);
1093 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1094 maxq =
MIN2(c0, maxq);
1095 for (q = minq; q < maxq; q++) {
1101 for (s = 0; s < n_seq; s++) {
1102 u1 = a2s[s][j - 1] - a2s[s][q];
1103 eee += P->internal_loop[u1];
1115 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1124 minq = j - i + p - MAXLOOP - 2;
1125 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1126 minq =
MAX2(c0, minq);
1128 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1129 maxq =
MIN2(c0, maxq);
1130 for (q = minq; q < maxq; q++) {
1136 for (s = 0; s < n_seq; s++) {
1137 u1 = a2s[s][p - 1] - a2s[s][i];
1138 u2 = a2s[s][j - 1] - a2s[s][q];
1139 eee += P->internal_loop[u1 + u2];
1152 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1163 for (s = 0; s < n_seq; s++) {
1164 u1 = a2s[s][p - 1] - a2s[s][i];
1165 eee += P->internal_loop[u1];
1180 E_GQuad_IntLoop_L_comparative(
int i,
1192 int eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;
1198 for (s = 0; s < n_seq; s++) {
1201 energy += P->mismatchI[type][S3[s][i]][S5[s][j]];
1204 energy += P->TerminalAU;
1210 if (S_cons[p] == 3) {
1211 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1212 minq = j - i + p - MAXLOOP - 2;
1213 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1214 minq =
MAX2(c0, minq);
1216 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1217 maxq =
MIN2(c0, maxq);
1218 for (q = minq; q < maxq; q++) {
1224 for (s = 0; s < n_seq; s++) {
1225 u1 = a2s[s][j - 1] - a2s[s][q];
1226 eee += P->internal_loop[u1];
1238 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1247 minq = j - i + p - MAXLOOP - 2;
1248 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1249 minq =
MAX2(c0, minq);
1251 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1252 maxq =
MIN2(c0, maxq);
1253 for (q = minq; q < maxq; q++) {
1259 for (s = 0; s < n_seq; s++) {
1260 u1 = a2s[s][p - 1] - a2s[s][i];
1261 u2 = a2s[s][j - 1] - a2s[s][q];
1262 eee += P->internal_loop[u1 + u2];
1275 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1286 for (s = 0; s < n_seq; s++) {
1287 u1 = a2s[s][p - 1] - a2s[s][i];
1288 eee += P->internal_loop[u1];
1303 E_GQuad_IntLoop_exhaustive(
int i,
1314 int energy, *ge,
dangles, p, q, l1, minq, maxq, c0;
1324 energy += P->mismatchI[type][si][sj];
1327 energy += P->TerminalAU;
1336 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1337 minq = j - i + p - MAXLOOP - 2;
1338 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1339 minq =
MAX2(c0, minq);
1341 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1342 maxq =
MIN2(c0, maxq);
1343 for (q = minq; q < maxq; q++) {
1347 c0 = energy + ggg[index[q] + p] + P->internal_loop[j - q - 1];
1348 if (c0 <= threshold) {
1349 ge[cnt] = energy + P->internal_loop[j - q - 1];
1358 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1367 minq = j - i + p - MAXLOOP - 2;
1368 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1369 minq =
MAX2(c0, minq);
1371 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1372 maxq =
MIN2(c0, maxq);
1373 for (q = minq; q < maxq; q++) {
1377 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1 + j - q - 1];
1378 if (c0 <= threshold) {
1379 ge[cnt] = energy + P->internal_loop[l1 + j - q - 1];
1389 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1398 c0 = energy + ggg[index[q] + p] + P->internal_loop[l1];
1399 if (c0 <= threshold) {
1400 ge[cnt] = energy + P->internal_loop[l1];
1414 E_GQuad_IntLoop_L(
int i,
1422 int energy, ge,
dangles, p, q, l1, minq, maxq, c0;
1431 energy += P->mismatchI[type][si][sj];
1434 energy += P->TerminalAU;
1440 if (p < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1441 minq = j - i + p - MAXLOOP - 2;
1442 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1443 minq =
MAX2(c0, minq);
1445 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1446 maxq =
MIN2(c0, maxq);
1447 for (q = minq; q < maxq; q++) {
1451 c0 = energy + ggg[p][q - p] + P->internal_loop[j - q - 1];
1458 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1467 minq = j - i + p - MAXLOOP - 2;
1468 c0 = p + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1469 minq =
MAX2(c0, minq);
1471 maxq = p + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1472 maxq =
MIN2(c0, maxq);
1473 for (q = minq; q < maxq; q++) {
1477 c0 = energy + ggg[p][q - p] + P->internal_loop[l1 + j - q - 1];
1485 p < j - VRNA_GQUAD_MIN_BOX_SIZE;
1494 c0 = energy + ggg[p][q - p] + P->internal_loop[l1];
1504 exp_E_GQuad_IntLoop(
int i,
1513 int k, l, minl, maxl, u, r;
1521 qe = (
FLT_OR_DBL)pf->expmismatchI[type][si][sj];
1522 expintern = &(pf->expinternal[0]);
1529 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1530 minl = j - MAXLOOP - 1;
1531 u = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1532 minl =
MAX2(u, minl);
1534 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1535 maxl =
MIN2(u, maxl);
1536 for (l = minl; l < maxl; l++) {
1540 if (G[index[k] - l] == 0.)
1552 k <= j - VRNA_GQUAD_MIN_BOX_SIZE;
1561 minl = j - i + k - MAXLOOP - 2;
1562 r = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1563 minl =
MAX2(r, minl);
1564 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1566 maxl =
MIN2(r, maxl);
1567 for (l = minl; l < maxl; l++) {
1571 if (G[index[k] - l] == 0.)
1577 * scale[u + j - l + 1];
1583 for (k = i + 4; k <= j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
1591 if (G[index[k] - l] == 0.)
1606 exp_E_GQuad_IntLoop_comparative(
int i,
1620 int k, l, minl, maxl, u, u1, u2, r, s;
1628 expintern = &(pf->expinternal[0]);
1630 for (s = 0; s < n_seq; s++) {
1633 qe *= (
FLT_OR_DBL)pf->expmismatchI[type][S3[s][i]][S5[s][j]];
1640 if (S_cons[k] == 3) {
1641 if (k < j - VRNA_GQUAD_MIN_BOX_SIZE) {
1642 minl = j - MAXLOOP - 1;
1643 u = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1644 minl =
MAX2(u, minl);
1646 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1647 maxl =
MIN2(u, maxl);
1648 for (l = minl; l < maxl; l++) {
1652 if (G[index[k] - l] == 0.)
1657 for (s = 0; s < n_seq; s++) {
1658 u1 = a2s[s][j - 1] - a2s[s][l];
1659 qqq *= expintern[u1];
1671 k <= j - VRNA_GQUAD_MIN_BOX_SIZE;
1680 minl = j - i + k - MAXLOOP - 2;
1681 r = k + VRNA_GQUAD_MIN_BOX_SIZE - 1;
1682 minl =
MAX2(r, minl);
1683 maxl = k + VRNA_GQUAD_MAX_BOX_SIZE + 1;
1685 maxl =
MIN2(r, maxl);
1686 for (l = minl; l < maxl; l++) {
1690 if (G[index[k] - l] == 0.)
1695 for (s = 0; s < n_seq; s++) {
1696 u1 = a2s[s][k - 1] - a2s[s][i];
1697 u2 = a2s[s][j - 1] - a2s[s][l];
1698 qqq *= expintern[u1 + u2];
1704 scale[u + j - l + 1];
1710 for (k = i + 4; k <= j - VRNA_GQUAD_MIN_BOX_SIZE; k++) {
1718 if (G[index[k] - l] == 0.)
1723 for (s = 0; s < n_seq; s++) {
1724 u1 = a2s[s][k - 1] - a2s[s][i];
1725 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:270
short * S_cons
Numerical encoding of the consensus sequence.
Definition: fold_compound.h:267
char * ptype
Pair type array.
Definition: fold_compound.h:225
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: fold_compound.h:220
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:95
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:153
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:56
#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:166
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:422
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:177
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: basic.h:102
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:162
unsigned int n_seq
The number of sequences in the alignment.
Definition: fold_compound.h:261
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: fold_compound.h:159
Definition: fold_compound.h:115
int dangles
Specifies the dangle model used in any energy evaluation (0,1,2 or 3)
Definition: model.h:180
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.
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:358
int * ggg
Energies of g-quadruplexes.
Definition: dp_matrices.h:72
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:665