/* -*-C-*- */ /* this file contains code for folding circular RNAs */ /* it's #include'd into fold.c */ PRIVATE void fill_arrays_circ(const char *string, int *bt){ /* variant of fold() for circular RNAs */ /* auxiliarry arrays: fM2 = multiloop region with exactly two stems, extending to 3' end for stupid dangles=1 case we also need: fM_d3 = multiloop region with >= 2 stems, starting at pos 2 (a pair (k,n) will form 3' dangle with pos 1) fM_d5 = multiloop region with >= 2 stems, extending to pos n-1 (a pair (1,k) will form a 5' dangle with pos n) */ int Hi, Hj, Ii, Ij, Ip, Iq, Mi; int *fM_d3, *fM_d5, Md3i, Md5i, FcMd3, FcMd5; int i,j, p,q,length, energy; int dangle_model = P->model_details.dangles; length = (int) strlen(string); FcH = FcI= FcM = FcMd3= FcMd5= Fc = INF; for (i=1; i max_separation) type = 0; */ /* forces locality degree */ type=rtype[type]; if (!type) continue; if (no_close) new_c = FORBIDDEN; else { char loopseq[10]; /*int si1, sj1;*/ if (u<7) { strcpy(loopseq , string+j-1); strncat(loopseq, string, i); } new_c = E_Hairpin(u, type, S1[j+1], S1[i-1], loopseq, P)+bonus+c[ij]; } if (new_cMAXLOOP) break; qmin = u1+i-1+length-MAXLOOP; if (qminMAXLOOP) continue; energy = E_IntLoop(u1, u2, type, type_2, S1[j+1], S1[i-1], S1[p-1], S1[q+1], P); new_c = c[ij] + c[indx[q]+p] + energy; if (new_cMLclosing; if (fmMLclosing; if (fmMLclosing; if (fmMLclosing; if (fmMLclosing; if (fm0)?Md5i:-Md5i; sector[(*bt)].ml = 2; i = (Md5i>0)?Md5i+1 : -Md5i+2; /* let's backtrack fm_d5[Md5i+1] */ for (u=i+TURN; u0)?Md3i+1:-Md3i+1; sector[(*bt)].j = length; sector[(*bt)].ml = 2; i = (Md3i>0)? Md3i : -Md3i-1; /* let's backtrack fm_d3[Md3i] */ for (u=2+TURN; u