The weights attached to an edge should be the 'sum of pairs' weights. Specifically, each edge is labelled by 3 characters, say x_1, x_2, x_3, which may be residues or gap characters. There are 3 different unordered pairs of these characters, namely (x_1, x_2), (x_1, x_3) and (x_2, x_3). The weight attached to the edge is then the sum of the 3 pair weights, where the weight of (x_i, x_j) is
>tr|J3QS45|J3QS45_HUMAN L-xylulose reductase (Fragment) OS=Homo sapiens GN=DCXR PE=1 SV=1 XLVNNAAVALLQPFLEVTKEAFDRSFEVNLRAVIQVSQIVARGLIARGVPGAIVNVSSQC SQRAVTNHSVYCSTKGALDMLTKVMALELGPHKLSRCRSE >tr|A0A164NGQ8|A0A164NGQ8_9CRUS L-xylulose reductase OS=Daphnia magna GN=APZ42_030734 PE=4 SV=1 MIDSKTGGSIVHVSSQASQAPLKDHAVYCSAKAALDMLCKVMALELGQHKIRVNCVNPTV VLTEMGKLGWSDPTKANPMLAGIPLGRFAEVEEVVDAVV >tr|A0A1D2MGF9|A0A1D2MGF9_ORCCI L-xylulose reductase OS=Orchesella cincta GN=Ocin01_14604 PE=4 SV=1 MSQNYPICADLTDLEQTQKAVKPIEAVDCLINNAGIMELADFLGISPEHVERQFSVNLKA VVFLSQIIVKKMIAAGNGGSILNMSSILGQRPVKFCGIYNCTKAALTCusing the BLOSUM62 score matrix for the pairwise scores:
A R N D C Q E G H I L K M F P S T W Y V B Z X * A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0 -2 -1 0 -4 R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3 -1 0 -1 -4 N -2 0 6 1 -3 0 0 0 1 -3 -3 0 -2 -3 -2 1 0 -4 -2 -3 3 0 -1 -4 D -2 -2 1 6 -3 0 2 -1 -1 -3 -4 -1 -3 -3 -1 0 -1 -4 -3 -3 4 1 -1 -4 C 0 -3 -3 -3 9 -3 -4 -3 -3 -1 -1 -3 -1 -2 -3 -1 -1 -2 -2 -1 -3 -3 -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 0 1 -1 0 -3 -4 0 -3 -3 -2 0 -1 -4 -3 -3 4 1 -1 -4 Z -1 0 0 1 -3 3 4 -2 0 -3 -3 1 -1 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4 X 0 -1 -1 -1 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 0 0 -2 -1 -1 -1 -1 -1 -4 * -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1 Gap penalty: -6Then run your WDAG program from homework # 2 [you may have to modify it] on this file to produce a highest scoring path (and its score) giving a highest-scoring alignment of the three sequences. You should adjust the program output such that each of the edge labels (corresponding to an aligned column of residues) appears on a separate line. You could copy the code and modify the print function, or if you want some general coding practice you could add a command line option to allow your original program to do both horizontal and vertical edge labels (e.g. '--vertical', though probably not '-v' because that's usually for verbose output).
Your program should output the following:
Answer to 2013 HW4 [in the current format]
Answer to 2012 HW4 [in the current format]