@@ -217,13 +217,18 @@ int calc_prec_recall_aln(
217217 prev_wave.insert (x);
218218
219219 // allow match on query
220- idx4 y (x.qni , x.tni , x.qi +1 , x.ti +1 );
221- if (y.qi < int (graph->qseqs [y.qni ].length ()) && y.ti < int (graph->tseqs [y.tni ].length ()) &&
222- graph->qseqs [y.qni ][y.qi ] == graph->tseqs [y.tni ][y.ti ]) {
223- if (!contains (done, y) && !contains (curr_wave, y)) {
224- /* if (print) printf(" y = node (%d, %d) cell (%d, %d)\n", y.qni, y.tni, y.qi, y.ti); */
225- queue.push (y); curr_wave.insert (y); ptrs[y] = x;
226- }
220+ idx4 y (x.qni , x.tni , x.qi , x.ti );
221+ bool match = false ;
222+ while (y.qi +1 < int (graph->qseqs [y.qni ].length ()) &&
223+ y.ti +1 < int (graph->tseqs [y.tni ].length ()) &&
224+ graph->qseqs [y.qni ][y.qi +1 ] == graph->tseqs [y.tni ][y.ti +1 ]) {
225+ y.qi ++;
226+ y.ti ++;
227+ match = true ;
228+ }
229+ if (match && !contains (done, y) && !contains (curr_wave, y)) {
230+ /* if (print) printf(" y = node (%d, %d) cell (%d, %d)\n", y.qni, y.tni, y.qi, y.ti); */
231+ queue.push (y); curr_wave.insert (y); ptrs[y] = x;
227232 }
228233
229234 // allow bottom-right corner to move diagonally into next truth and query nodes
@@ -517,10 +522,10 @@ void calc_prec_recall(
517522 bool diff_submatrix = curr.qni != prev.qni && curr.tni != prev.tni ; // both must differ
518523 bool ref_query_move = graph->qtypes [curr.qni ] == TYPE_REF
519524 && prev.qni == curr.qni
520- && prev.qi + 1 == curr.qi ;
525+ && prev.qi < curr.qi ;
521526 bool ref_truth_move = graph->ttypes [curr.tni ] == TYPE_REF
522527 && prev.tni == curr.tni
523- && prev.ti + 1 == curr.ti ;
528+ && prev.ti < curr.ti ;
524529 bool sync_point = on_main_diag && (
525530 (same_submatrix && ref_query_move && ref_truth_move) || diff_submatrix);
526531 if (sync_point) {
0 commit comments