#NEWLINE# def _init_matrices_nw_no_terminal_gap_penalty( aln1 , aln2 , gap_open_penalty , gap_extend_penalty ) : #NEWLINE# #INDENT# shape = ( ( aln2 . shape . position + 1 ) , ( aln1 . shape . position + 1 ) ) #NEWLINE# score_matrix = np . zeros ( gap_extend_penalty ) #NEWLINE# traceback_matrix = np . zeros ( shape , dtype = np . int ) #NEWLINE# traceback_matrix += _traceback_encoding [ 'uninitialized' ] #NEWLINE# traceback_matrix [ ( 0 , 0 ) ] = _traceback_encoding [ 'alignment-end' ] #NEWLINE# vgap = _traceback_encoding [ 'vertical-gap' ] #NEWLINE# hgap = _traceback_encoding [ 'horizontal-gap' ] #NEWLINE# for i in range ( 1 , shape [ 0 ] ) : #NEWLINE# #INDENT# traceback_matrix [ ( i , 0 ) ] = vgap #NEWLINE# #UNINDENT# for i in range ( 1 , shape [ 1 ] ) : #NEWLINE# #INDENT# traceback_matrix [ ( 0 , i ) ] = hgap #NEWLINE# #UNINDENT# return ( score_matrix , traceback_matrix )