I am attempting to implement the Dynamic Programming Table Needleman-Wunsch Algorithm in Python:
My code is inspired by this.
The far left column and top row need to start from 0, decrementing downwards
Note: this works perfectly fine if I limit the 2 sequences to just 100 characters long each. So maybe it's because the data is too big?
m, n = len(seqA), len(seqB) # let m, n denote the lengths of two sequences score_matrix = tasks.empty_matrix(m+1, n+1) for i in range(0, m+1): score_matrix[i] = i * -1 for j in range(0, n+1): score_matrix[j] = j * -1
for j in range(0, n+1): score_matrix[j] = j * -1 IndexError: list assignment index out of range
Note: my DNA sequences are all ~10,000 characters long. So,
10K * 10K DP table.