26 #include <utility/exit.hh>
28 #include <utility/vector1.hh>
45 runtime_assert( ss != 0 );
46 runtime_assert( seq_x != 0 );
47 runtime_assert( seq_y != 0 );
50 runtime_assert( seq_y->ungapped_length() == seq_y->length() );
51 runtime_assert( seq_x->ungapped_length() == seq_x->length() );
65 Size current_x = current_cell->x();
66 Size current_y = current_cell->y();
70 if ( current_cell->came_from() ==
diagonal ) {
72 aligned_seq_x = (*seq_x)[ current_x ] + aligned_seq_x;
73 aligned_seq_y = (*seq_y)[ current_y ] + aligned_seq_y;
74 }
else if ( current_cell->came_from() ==
left ) {
76 aligned_seq_x = (*seq_x)[current_x] + aligned_seq_x;
77 aligned_seq_y =
'-' + aligned_seq_y;
78 seq_y->insert_gap( current_y + 1 );
80 }
else if ( current_cell->came_from() ==
above ) {
82 aligned_seq_x =
'-' + aligned_seq_x;
83 aligned_seq_y = (*seq_y)[current_y] + aligned_seq_y;
84 seq_x->insert_gap( current_x + 1 );
93 utility_exit_with_message(
"Error in traceback: pointer doesn't go anywhere!\n" );
96 if ( current_cell->next()->came_from() ==
end ) {
100 current_cell = current_cell->next();
114 seq_x_clone->start( current_cell->x() - 2 + seq_x->start() );
115 seq_y_clone->start( current_cell->y() - 2 + seq_y->start() );
117 seq_x_clone->sequence( aligned_seq_x );
118 seq_y_clone->sequence( aligned_seq_y );
124 alignment.
score( start->score() );