aligned1, aligned2, score, seq1_start_position, seq2_start_position = \
_traceback(traceback_matrix, score_matrix, seq1, seq2,
seq1_end_position, seq2_end_position)
return aligned1, aligned2, score, seq1_start_position, seq2_start_position
// Functions from here allow for generalized (global or local) alignment. I
// will likely want to put these in a single object to make the naming a little
// less clunky.
After Change
init_matrices_f=_init_matrices_nw)
end_row_position = traceback_matrix.shape[0] - 1
end_col_position = traceback_matrix.shape[1] - 1
aligned1, aligned2, score, seq1_start_position, seq2_start_position = \
_traceback(traceback_matrix, score_matrix, seq1, seq2,
end_row_position, end_col_position)
start_end_positions = [(seq1_start_position, end_col_position-1),
(seq2_start_position, end_row_position-1)]
result = Alignment(
[BiologicalSequence(aligned1, id=0),
BiologicalSequence(aligned2, id=1)],
score=score, start_end_positions=start_end_positions)return result
// Functions from here allow for generalized (global or local) alignment. I
// will likely want to put these in a single object to make the naming a little
// less clunky.