8 #define USE_PENALTY_EX 0
9 #define FASTMATCHCALC 1
11 static int impalloclen = 0;
12 static float **impmtx = NULL;
13 float part_imp_match_out_scQ( int i1, int j1 )
15 // fprintf( stderr, "impalloclen = %d\n", impalloclen );
16 // fprintf( stderr, "i1,j1=%d,%d -> impmtx=%f\n", i1, j1, impmtx[i1][j1] );
17 return( impmtx[i1][j1] );
19 if( i1 == l1 || j1 == l2 ) return( 0.0 );
20 return( impmtx[i1+start1][j1+start2] );
23 static void part_imp_match_out_vead_gapmapQ( float *imp, int i1, int lgth2, int start2, int *gapmap2 )
27 int *gapmappt = gapmap2;
29 *pt++ += impmtx[i1][start2+*gapmappt++];
32 for( j=0; j<lgth2; j++ )
34 imp[j] += impmtx[i1][start2+gapmap2[j]];
39 static void part_imp_match_out_vead_tate_gapmapQ( float *imp, int j1, int lgth1, int start1, int *gapmap1 )
43 int *gapmappt = gapmap1;
45 *pt++ = impmtx[start1+*gapmappt++][j1];
48 for( i=0; i<lgth1; i++ )
50 imp[i] += impmtx[start1+gapmap1[i]][j1];
55 void part_imp_match_init_strictQ( float *imp, int clus1, int clus2, int lgth1, int lgth2, char **seq1, char **seq2, double *eff1, double *eff2, LocalHom ***localhom, int forscore )
57 int i, j, k1, k2, tmpint, start1, start2, end1, end2;
62 if( impalloclen <= lgth1 + 2 || impalloclen <= lgth2 + 2 )
64 if( impmtx ) FreeFloatMtx( impmtx );
65 impalloclen = MAX( lgth1, lgth2 ) + 2;
66 impmtx = AllocateFloatMtx( impalloclen+100, impalloclen+100 );
71 fprintf( stderr, "eff1 in _init_strict = \n" );
72 for( i=0; i<clus1; i++ )
73 fprintf( stderr, "eff1[] = %f\n", eff1[i] );
74 for( i=0; i<clus2; i++ )
75 fprintf( stderr, "eff2[] = %f\n", eff2[i] );
78 for( i=0; i<lgth1; i++ ) for( j=0; j<lgth2; j++ )
80 effijx = 1.0 * fastathreshold;
81 for( i=0; i<clus1; i++ )
83 for( j=0; j<clus2; j++ )
85 effij = eff1[i] * eff2[j] * effijx;
86 tmpptr = localhom[i][j];
89 // fprintf( stderr, "start1 = %d\n", tmpptr->start1 );
90 // fprintf( stderr, "end1 = %d\n", tmpptr->end1 );
91 // fprintf( stderr, "i = %d, seq1 = \n%s\n", i, seq1[i] );
92 // fprintf( stderr, "j = %d, seq2 = \n%s\n", j, seq2[j] );
97 if( *pt++ != '-' ) tmpint++;
98 if( tmpint == tmpptr->start1 ) break;
100 start1 = (int)( pt - seq1[i] ) - 1;
102 if( tmpptr->start1 == tmpptr->end1 ) end1 = start1;
108 if( tmpint == tmpptr->end1 ) break;
109 if( *pt++ != '-' ) tmpint++;
111 end1 = (int)( pt - seq1[i] ) - 1;
115 // fprintf( stderr, "tmpint = %d, end1 = %d pos = %d\n", tmpint, tmpptr->end1, pt-seq1[i] );
116 if( *pt++ != '-' ) tmpint++;
117 if( tmpint == tmpptr->end1 ) break;
119 end1 = (int)( pt - seq1[i] ) - 1;
127 if( *pt++ != '-' ) tmpint++;
128 if( tmpint == tmpptr->start2 ) break;
130 start2 = (int)( pt - seq2[j] ) - 1;
131 if( tmpptr->start2 == tmpptr->end2 ) end2 = start2;
137 if( tmpint == tmpptr->end2 ) break;
138 if( *pt++ != '-' ) tmpint++;
140 end2 = (int)( pt - seq2[j] ) - 1;
144 if( *pt++ != '-' ) tmpint++;
145 if( tmpint == tmpptr->end2 ) break;
147 end2 = (int)( pt - seq2[j] ) - 1;
150 // fprintf( stderr, "start1 = %d (%c), end1 = %d (%c), start2 = %d (%c), end2 = %d (%c)\n", start1, seq1[i][start1], end1, seq1[i][end1], start2, seq2[j][start2], end2, seq2[j][end2] );
151 // fprintf( stderr, "step 0\n" );
152 if( end1 - start1 != end2 - start2 )
154 // fprintf( stderr, "CHUUI!!, start1 = %d, end1 = %d, start2 = %d, end2 = %d\n", start1, end1, start2, end2 );
157 k1 = start1; k2 = start2;
160 while( *pt1 && *pt2 )
162 if( *pt1 != '-' && *pt2 != '-' )
164 // ½Å¤ß¤òÆó½Å¤Ë¤«¤±¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
165 // impmtx[k1][k2] += tmpptr->wimportance * fastathreshold;
166 // impmtx[k1][k2] += tmpptr->importance * effij;
167 impmtx[k1][k2] += tmpptr->fimportance * effij;
168 // fprintf( stderr, "k1=%d, k2=%d, impalloclen=%d\n", k1, k2, impalloclen );
169 // fprintf( stderr, "mark, %d (%c) - %d (%c) \n", k1, *pt1, k2, *pt2 );
173 else if( *pt1 != '-' && *pt2 == '-' )
175 // fprintf( stderr, "skip, %d (%c) - %d (%c) \n", k1, *pt1, k2, *pt2 );
178 else if( *pt1 == '-' && *pt2 != '-' )
180 // fprintf( stderr, "skip, %d (%c) - %d (%c) \n", k1, *pt1, k2, *pt2 );
183 else if( *pt1 == '-' && *pt2 == '-' )
185 // fprintf( stderr, "skip, %d (%c) - %d (%c) \n", k1, *pt1, k2, *pt2 );
189 if( k1 > end1 || k2 > end2 ) break;
191 tmpptr = tmpptr->next;
196 fprintf( stderr, "impmtx = \n" );
197 for( k2=0; k2<lgth2; k2++ )
198 fprintf( stderr, "%6.3f ", (double)k2 );
199 fprintf( stderr, "\n" );
200 for( k1=0; k1<lgth1; k1++ )
202 fprintf( stderr, "%d", k1 );
203 for( k2=0; k2<lgth2; k2++ )
204 fprintf( stderr, "%2.1f ", impmtx[k1][k2] );
205 fprintf( stderr, "\n" );
211 static void match_calc( float *match, float **cpmx1, float **cpmx2, int i1, int lgth2, float **floatwork, int **intwork, int initialize )
216 float **cpmxpd = floatwork;
217 int **cpmxpdn = intwork;
218 float *matchpt, *cpmxpdpt, **cpmxpdptpt;
219 int *cpmxpdnpt, **cpmxpdnptpt;
223 for( j=0; j<lgth2; j++ )
226 for( l=0; l<26; l++ )
230 cpmxpd[j][count] = cpmx2[l][j];
231 cpmxpdn[j][count] = l;
235 cpmxpdn[j][count] = -1;
240 for( l=0; l<26; l++ )
243 for( j=0; j<26; j++ )
244 scarr[l] += n_dis[j][l] * cpmx1[j][i1];
247 cpmxpdnptpt = cpmxpdn;
252 cpmxpdnpt = *cpmxpdnptpt++;
253 cpmxpdpt = *cpmxpdptpt++;
254 while( *cpmxpdnpt>-1 )
255 *matchpt += scarr[*cpmxpdnpt++] * *cpmxpdpt++;
262 float **cpmxpd = floatwork;
263 int **cpmxpdn = intwork;
268 for( j=0; j<lgth2; j++ )
271 for( l=0; l<26; l++ )
275 cpmxpd[count][j] = cpmx2[l][j];
276 cpmxpdn[count][j] = l;
280 cpmxpdn[count][j] = -1;
283 for( l=0; l<26; l++ )
286 for( k=0; k<26; k++ )
287 scarr[l] += n_dis[k][l] * cpmx1[k][i1];
289 for( j=0; j<lgth2; j++ )
292 for( k=0; cpmxpdn[k][j]>-1; k++ )
293 match[j] += scarr[cpmxpdn[k][j]] * cpmxpd[k][j];
298 static void Atracking_localhom( float *impwmpt, float *lasthorizontalw, float *lastverticalw,
299 char **seq1, char **seq2,
300 char **mseq1, char **mseq2,
301 float **cpmx1, float **cpmx2,
302 short **ijp, int icyc, int jcyc,
303 int start1, int end1, int start2, int end2,
304 int *gapmap1, int *gapmap2 )
306 int i, j, l, iin, jin, ifi, jfi, lgth1, lgth2, k;
309 lgth1 = strlen( seq1[0] );
310 lgth2 = strlen( seq2[0] );
313 for( i=0; i<lgth1; i++ )
315 fprintf( stderr, "lastverticalw[%d] = %f\n", i, lastverticalw[i] );
323 wm = lastverticalw[0];
324 for( i=0; i<lgth1; i++ )
326 if( lastverticalw[i] >= wm )
328 wm = lastverticalw[i];
329 iin = i; jin = lgth2-1;
330 ijp[lgth1][lgth2] = +( lgth1 - i );
333 for( j=0; j<lgth2; j++ )
335 if( lasthorizontalw[j] >= wm )
337 wm = lasthorizontalw[j];
338 iin = lgth1-1; jin = j;
339 ijp[lgth1][lgth2] = -( lgth2 - j );
344 for( i=0; i<lgth1+1; i++ )
348 for( j=0; j<lgth2+1; j++ )
350 ijp[0][j] = -( j + 1 );
353 for( i=0; i<icyc; i++ )
355 mseq1[i] += lgth1+lgth2;
358 for( j=0; j<jcyc; j++ )
360 mseq2[j] += lgth1+lgth2;
363 iin = lgth1; jin = lgth2;
365 for( k=0; k<=lgth1+lgth2; k++ )
367 if( ijp[iin][jin] < 0 )
369 ifi = iin-1; jfi = jin+ijp[iin][jin];
371 else if( ijp[iin][jin] > 0 )
373 ifi = iin-ijp[iin][jin]; jfi = jin-1;
377 ifi = iin-1; jfi = jin-1;
382 for( i=0; i<icyc; i++ )
383 *--mseq1[i] = seq1[i][ifi+l];
384 for( j=0; j<jcyc; j++ )
391 for( i=0; i<icyc; i++ )
393 for( j=0; j<jcyc; j++ )
394 *--mseq2[j] = seq2[j][jfi+l];
397 if( iin != lgth1 && jin != lgth2 ) // ??
399 *impwmpt += part_imp_match_out_scQ( gapmap1[iin]+start1, gapmap2[jin]+start2 );
400 // fprintf( stderr, "impwm = %f (iin=%d, jin=%d) seq1=%c, seq2=%c\n", *impwmpt, iin, jin, seq1[0][iin], seq2[0][jin] );
402 if( iin <= 0 || jin <= 0 ) break;
403 for( i=0; i<icyc; i++ )
404 *--mseq1[i] = seq1[i][ifi];
405 for( j=0; j<jcyc; j++ )
406 *--mseq2[j] = seq2[j][jfi];
408 iin = ifi; jin = jfi;
411 static float Atracking( float *lasthorizontalw, float *lastverticalw,
412 char **seq1, char **seq2,
413 char **mseq1, char **mseq2,
414 float **cpmx1, float **cpmx2,
415 short **ijp, int icyc, int jcyc )
417 int i, j, l, iin, jin, ifi, jfi, lgth1, lgth2, k, lastk;
420 lgth1 = strlen( seq1[0] );
421 lgth2 = strlen( seq2[0] );
424 for( i=0; i<lgth1; i++ )
426 fprintf( stderr, "lastverticalw[%d] = %f\n", i, lastverticalw[i] );
434 wm = lastverticalw[0];
435 for( i=0; i<lgth1; i++ )
437 if( lastverticalw[i] >= wm )
439 wm = lastverticalw[i];
440 iin = i; jin = lgth2-1;
441 ijp[lgth1][lgth2] = +( lgth1 - i );
444 for( j=0; j<lgth2; j++ )
446 if( lasthorizontalw[j] >= wm )
448 wm = lasthorizontalw[j];
449 iin = lgth1-1; jin = j;
450 ijp[lgth1][lgth2] = -( lgth2 - j );
455 for( i=0; i<lgth1+1; i++ )
459 for( j=0; j<lgth2+1; j++ )
461 ijp[0][j] = -( j + 1 );
464 for( i=0; i<icyc; i++ )
466 mseq1[i] += lgth1+lgth2;
469 for( j=0; j<jcyc; j++ )
471 mseq2[j] += lgth1+lgth2;
474 iin = lgth1; jin = lgth2;
476 for( k=0; k<=lastk; k++ )
478 if( ijp[iin][jin] < 0 )
480 ifi = iin-1; jfi = jin+ijp[iin][jin];
482 else if( ijp[iin][jin] > 0 )
484 ifi = iin-ijp[iin][jin]; jfi = jin-1;
488 ifi = iin-1; jfi = jin-1;
493 for( i=0; i<icyc; i++ )
494 *--mseq1[i] = seq1[i][ifi+l];
495 for( j=0; j<jcyc; j++ )
502 for( i=0; i<icyc; i++ )
504 for( j=0; j<jcyc; j++ )
505 *--mseq2[j] = seq2[j][jfi+l];
508 if( iin <= 0 || jin <= 0 ) break;
509 for( i=0; i<icyc; i++ )
510 *--mseq1[i] = seq1[i][ifi];
511 for( j=0; j<jcyc; j++ )
512 *--mseq2[j] = seq2[j][jfi];
514 iin = ifi; jin = jfi;
519 float partQ__align( char **seq1, char **seq2, double *eff1, double *eff2, int icyc, int jcyc, int alloclen, LocalHom ***localhom, float *impmatch, int start1, int end1, int start2, int end2, int *gapmap1, int *gapmap2, char *sgap1, char *sgap2, char *egap1, char *egap2 )
520 /* score no keisan no sai motokaraaru gap no atukai ni mondai ga aru */
524 int lasti, lastj; /* outgap == 0 -> lgth1, outgap == 1 -> lgth1+1 */
527 float wm = 0.0; /* int ?????? */
529 float *currentw, *previousw;
533 float *mjpt, *prept, *curpt;
539 static float *w1, *w2;
541 static float *initverticalw; /* kufuu sureba iranai */
542 static float *lastverticalw; /* kufuu sureba iranai */
550 static float **cpmx1;
551 static float **cpmx2;
552 static int **intwork;
553 static float **floatwork;
554 static int orlgth1 = 0, orlgth2 = 0;
555 float fpenalty = (float)penalty;
557 float fpenalty_ex = (float)penalty_ex;
567 fprintf( stderr, "eff in SA+++align\n" );
568 for( i=0; i<icyc; i++ ) fprintf( stderr, "eff1[%d] = %f\n", i, eff1[i] );
572 mseq1 = AllocateCharMtx( njob, 0 );
573 mseq2 = AllocateCharMtx( njob, 0 );
577 lgth1 = strlen( seq1[0] );
578 lgth2 = strlen( seq2[0] );
580 if( lgth1 > orlgth1 || lgth2 > orlgth2 )
584 if( orlgth1 > 0 && orlgth2 > 0 )
588 FreeFloatVec( match );
589 FreeFloatVec( initverticalw );
590 FreeFloatVec( lastverticalw );
597 FreeFloatVec( ogcp1 );
598 FreeFloatVec( ogcp2 );
599 FreeFloatVec( fgcp1 );
600 FreeFloatVec( fgcp2 );
603 FreeFloatMtx( cpmx1 );
604 FreeFloatMtx( cpmx2 );
606 FreeFloatMtx( floatwork );
607 FreeIntMtx( intwork );
610 ll1 = MAX( (int)(1.3*lgth1), orlgth1 ) + 100;
611 ll2 = MAX( (int)(1.3*lgth2), orlgth2 ) + 100;
614 fprintf( stderr, "\ntrying to allocate (%d+%d)xn matrices ... ", ll1, ll2 );
617 w1 = AllocateFloatVec( ll2+2 );
618 w2 = AllocateFloatVec( ll2+2 );
619 match = AllocateFloatVec( ll2+2 );
621 initverticalw = AllocateFloatVec( ll1+2 );
622 lastverticalw = AllocateFloatVec( ll1+2 );
624 m = AllocateFloatVec( ll2+2 );
625 mp = AllocateIntVec( ll2+2 );
627 mseq = AllocateCharMtx( njob, ll1+ll2 );
629 ogcp1 = AllocateFloatVec( ll1+2 );
630 ogcp2 = AllocateFloatVec( ll2+2 );
631 fgcp1 = AllocateFloatVec( ll1+2 );
632 fgcp2 = AllocateFloatVec( ll2+2 );
634 cpmx1 = AllocateFloatMtx( 26, ll1+2 );
635 cpmx2 = AllocateFloatMtx( 26, ll2+2 );
638 floatwork = AllocateFloatMtx( MAX( ll1, ll2 )+2, 26 );
639 intwork = AllocateIntMtx( MAX( ll1, ll2 )+2, 26 );
641 floatwork = AllocateFloatMtx( 26, MAX( ll1, ll2 )+2 );
642 intwork = AllocateIntMtx( 26, MAX( ll1, ll2 )+2 );
646 fprintf( stderr, "succeeded\n" );
654 for( i=0; i<icyc; i++ ) mseq1[i] = mseq[i];
655 for( j=0; j<jcyc; j++ ) mseq2[j] = mseq[icyc+j];
658 if( orlgth1 > commonAlloc1 || orlgth2 > commonAlloc2 )
662 if( commonAlloc1 && commonAlloc2 )
664 FreeShortMtx( commonIP );
667 ll1 = MAX( orlgth1, commonAlloc1 );
668 ll2 = MAX( orlgth2, commonAlloc2 );
671 fprintf( stderr, "\n\ntrying to allocate %dx%d matrices ... ", ll1+1, ll2+1 );
674 commonIP = AllocateShortMtx( ll1+10, ll2+10 );
677 fprintf( stderr, "succeeded\n\n" );
685 cpmx_calc_new( seq1, cpmx1, eff1, lgth1, icyc );
686 cpmx_calc_new( seq2, cpmx2, eff2, lgth2, jcyc );
690 new_OpeningGapCount( ogcp1, icyc, seq1, eff1, lgth1, sgap1 );
691 new_OpeningGapCount( ogcp2, jcyc, seq2, eff2, lgth2, sgap2 );
692 new_FinalGapCount( fgcp1, icyc, seq1, eff1, lgth1, egap1 );
693 new_FinalGapCount( fgcp2, jcyc, seq2, eff2, lgth2, egap2 );
697 st_OpeningGapCount( ogcp1, icyc, seq1, eff1, lgth1 );
698 st_OpeningGapCount( ogcp2, jcyc, seq2, eff2, lgth2 );
699 st_FinalGapCount( fgcp1, icyc, seq1, eff1, lgth1 );
700 st_FinalGapCount( fgcp2, jcyc, seq2, eff2, lgth2 );
703 for( i=0; i<lgth1; i++ )
705 ogcp1[i] = 0.5 * ( 1.0 - ogcp1[i] ) * fpenalty;
706 fgcp1[i] = 0.5 * ( 1.0 - fgcp1[i] ) * fpenalty;
708 for( i=0; i<lgth2; i++ )
710 ogcp2[i] = 0.5 * ( 1.0 - ogcp2[i] ) * fpenalty;
711 fgcp2[i] = 0.5 * ( 1.0 - fgcp2[i] ) * fpenalty;
714 for( i=0; i<lgth1; i++ )
715 fprintf( stderr, "ogcp1[%d]=%f\n", i, ogcp1[i] );
722 match_calc( initverticalw, cpmx2, cpmx1, 0, lgth1, floatwork, intwork, 1 );
724 part_imp_match_out_vead_tate_gapmapQ( initverticalw, gapmap2[0]+start2, lgth1, start1, gapmap1 );
727 match_calc( currentw, cpmx1, cpmx2, 0, lgth2, floatwork, intwork, 1 );
729 part_imp_match_out_vead_gapmapQ( currentw, gapmap1[0]+start1, lgth2, start2, gapmap2 );
732 imp_match_calc( currentw, icyc, jcyc, lgth1, lgth2, seq1, seq2, eff1, eff2, localhom, 1, 0 );
738 for( i=1; i<lgth1+1; i++ )
740 initverticalw[i] += ( ogcp1[0] + fgcp1[i-1] ) ;
742 for( j=1; j<lgth2+1; j++ )
744 currentw[j] += ( ogcp2[0] + fgcp2[j-1] ) ;
750 for( j=1; j<lgth2+1; j++ )
751 currentw[j] -= offset * j / 2.0;
752 for( i=1; i<lgth1+1; i++ )
753 initverticalw[i] -= offset * i / 2.0;
757 for( j=1; j<lgth2+1; ++j )
759 m[j] = currentw[j-1] + ogcp1[1]; mp[j] = 0;
762 lastverticalw[0] = currentw[lgth2-1];
764 if( outgap ) lasti = lgth1+1; else lasti = lgth1;
768 fprintf( stderr, "currentw = \n" );
769 for( i=0; i<lgth1+1; i++ )
771 fprintf( stderr, "%5.2f ", currentw[i] );
773 fprintf( stderr, "\n" );
774 fprintf( stderr, "initverticalw = \n" );
775 for( i=0; i<lgth2+1; i++ )
777 fprintf( stderr, "%5.2f ", initverticalw[i] );
779 fprintf( stderr, "\n" );
780 fprintf( stderr, "fcgp\n" );
781 for( i=0; i<lgth1; i++ )
782 fprintf( stderr, "fgcp1[%d]=%f\n", i, ogcp1[i] );
783 for( i=0; i<lgth2; i++ )
784 fprintf( stderr, "fgcp2[%d]=%f\n", i, ogcp2[i] );
787 for( i=1; i<lasti; i++ )
790 previousw = currentw;
793 previousw[0] = initverticalw[i-1];
795 match_calc( currentw, cpmx1, cpmx2, i, lgth2, floatwork, intwork, 0 );
797 fprintf( stderr, "\n" );
798 fprintf( stderr, "i=%d\n", i );
799 fprintf( stderr, "currentw = \n" );
800 for( j=0; j<lgth2; j++ )
802 fprintf( stderr, "%5.2f ", currentw[j] );
804 fprintf( stderr, "\n" );
808 // fprintf( stderr, "Calling imp_match_calc (o) lgth = %d, i = %d\n", lgth1, i );
809 // imp_match_out_vead( currentw, i, lgth2 );
810 part_imp_match_out_vead_gapmapQ( currentw, gapmap1[i]+start1, lgth2, start2, gapmap2 );
813 fprintf( stderr, "\n" );
814 fprintf( stderr, "i=%d\n", i );
815 fprintf( stderr, "currentw = \n" );
816 for( j=0; j<lgth2; j++ )
818 fprintf( stderr, "%5.2f ", currentw[j] );
820 fprintf( stderr, "\n" );
822 currentw[0] = initverticalw[i];
825 mi = previousw[0] + ogcp2[1]; mpi = 0;
830 curpt = currentw + 1;
834 fgcp1va = fgcp1[i-1];
836 for( j=1; j<lastj; j++ )
842 fprintf( stderr, "%5.0f->", wm );
846 fprintf( stderr, "%5.0f?", g );
851 *ijppt = -( j - mpi );
853 g = *prept + *ogcp2pt;
865 fprintf( stderr, "%5.0f?", g );
870 *ijppt = +( i - *mpjpt );
872 g = *prept + ogcp1va;
883 fprintf( stderr, "%5.0f ", wm );
894 lastverticalw[i] = currentw[lgth2-1];
900 for( j=1; j<lgth2+1; j++ )
901 currentw[j] -= offset * ( lgth2 - j ) / 2.0;
902 for( i=1; i<lgth1+1; i++ )
903 lastverticalw[i] -= offset * ( lgth1 - i / 2.0);
908 fprintf( stderr, "\n" );
909 for( i=0; i<icyc; i++ ) fprintf( stderr,"%s\n", seq1[i] );
910 fprintf( stderr, "#####\n" );
911 for( j=0; j<jcyc; j++ ) fprintf( stderr,"%s\n", seq2[j] );
912 fprintf( stderr, "====>" );
913 for( i=0; i<icyc; i++ ) strcpy( mseq1[i], seq1[i] );
914 for( j=0; j<jcyc; j++ ) strcpy( mseq2[j], seq2[j] );
918 Atracking_localhom( impmatch, currentw, lastverticalw, seq1, seq2, mseq1, mseq2, cpmx1, cpmx2, ijp, icyc, jcyc, start1, end1, start2, end2, gapmap1, gapmap2 );
921 Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, cpmx1, cpmx2, ijp, icyc, jcyc );
923 // fprintf( stderr, "### impmatch = %f\n", *impmatch );
925 resultlen = strlen( mseq1[0] );
926 if( alloclen < resultlen || resultlen > N )
928 fprintf( stderr, "alloclen=%d, resultlen=%d, N=%d\n", alloclen, resultlen, N );
929 ErrorExit( "LENGTH OVER!\n" );
933 for( i=0; i<icyc; i++ ) strcpy( seq1[i], mseq1[i] );
934 for( j=0; j<jcyc; j++ ) strcpy( seq2[j], mseq2[j] );
936 fprintf( stderr, "\n" );
937 for( i=0; i<icyc; i++ ) fprintf( stderr, "%s\n", mseq1[i] );
938 fprintf( stderr, "#####\n" );
939 for( j=0; j<jcyc; j++ ) fprintf( stderr, "%s\n", mseq2[j] );