Please help me writing python code based on the pseudo code and solve the problem Pseudo code for the DP global alignment algorithmDP_GLOBAL_ALIGNMENT(x, y) // Input: x, y: two amino acid sequences // Output: x', y': the two input sequences under their best global alignment, with gaps allowed/included n = length(x) m = length(y) d = 8 for k in {A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, V} for l in {A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, V} assign values to substitution matrix entries S(k,l) using BLOSUM50 matrix values for i = 0 to n F(i, 0) = - i*d for j = 0 to m F(0, j) = - j*d for i = 1 to n for j = 1 to m F(i, j) <— max value among F(i-1,j-1)+S(x[i], y[j]), F(i-1,j) -d, and F(i, j-1)-d Pointer(i, j) <— pointer to the cell (above-left, left, or above) that gave the max value above traceback from F(n, m), following the pointers, back to F(0,0). Record the aligned sequences x', y', with gaps, during traceback return x', y' PROBLEM Task 1.1 Write the python code for using dynamic programming to solve for the making change problem. You can use the pseudo code in lecture notes as guidance, but please feel free to modify the pseudo code according to your own design (e.g. by having subroutines instead of having all code in one function). Then, implement the algorithm in Python code. Hint: For making an array of arrays, you can check out the array function in the Python library numpy. Task 1.2 Test your code by finding the solutions for making 13, 46, and 63 cents, using the coin set containing 1-cent, 5-cent, 10-cent, and 25-cent coins. Please show me the print statements as well. This is the code that are being made but not working.
Please help me writing python code based on the pseudo code and solve the problem
Pseudo code for the DP global alignment algorithmDP_GLOBAL_ALIGNMENT(x, y)
// Input: x, y: two amino acid sequences
// Output: x', y': the two input sequences under their best global alignment, with gaps allowed/included
n = length(x)
m = length(y)
d = 8
for k in {A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, V}
for l in {A, R, N, D, C, Q, E, G, H, I, L, K, M, F, P, S, T, W, Y, V}
assign values to substitution matrix entries S(k,l) using BLOSUM50 matrix values
for i = 0 to n
F(i, 0) = - i*d
for j = 0 to m
F(0, j) = - j*d
for i = 1 to n
for j = 1 to m
F(i, j) <— max value among F(i-1,j-1)+S(x[i], y[j]), F(i-1,j) -d, and F(i, j-1)-d
Pointer(i, j) <— pointer to the cell (above-left, left, or above) that gave the max value above
traceback from F(n, m), following the pointers, back to F(0,0). Record the aligned sequences x', y', with gaps, during traceback
return x', y'
PROBLEM
Task 1.1 Write the python code for using dynamic
Task 1.2 Test your code by finding the solutions for making 13, 46, and 63 cents, using the coin set containing 1-cent, 5-cent, 10-cent, and 25-cent coins.
Please show me the print statements as well.
This is the code that are being made but not working.
Step by step
Solved in 4 steps with 2 images