CMSC 423: RNA Folding Examples Here are several example dynamic programming matrices computed with the RNA folding algorithm given in class. The OPT matrix is computed according to the recurrence. The arrow matrix stores the subproblems used to compute the solution to each cell. A value of -1 in an Arrow cell means that we chose to not match "j" with anything. Another value gives the "t" to which we matched "j" ("t" and "j" are as defined in the lecture slides.) >>> OPT, Arrow = rnafold.rnafold("ATT") OPT Matrix = A T T A 0 0 0 T 0 0 0 T 0 0 0 Arrow Matrix = A T T A 0 0 0 T 0 0 0 T 0 0 0 >>> rnafold.rna_backtrace(Arrow) Matched Pairs = =================================================================== >>> OPT, Arrow = rnafold.rnafold("ACCAAAGG") OPT Matrix = A C C A A A G G A 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 G 1 1 0 0 0 0 0 0 G 1 1 1 0 0 0 0 0 Arrow Matrix = A C C A A A G G A 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 A -1 0 0 0 0 0 0 0 G 1 1 0 0 0 0 0 0 G 2 2 2 0 0 0 0 0 >>> rnafold.rna_backtrace(Arrow) Matched Pairs = (2,7) =================================================================== >>> OPT, Arrow = rnafold.rnafold("ACCAAAAGG") OPT Matrix = A C C A A A A G G A 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 G 1 1 1 0 0 0 0 0 0 G 2 2 1 0 0 0 0 0 0 Arrow Matrix = A C C A A A A G G A 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 A -1 0 0 0 0 0 0 0 0 A -1 -1 0 0 0 0 0 0 0 G 2 2 2 0 0 0 0 0 0 G 1 1 2 -1 0 0 0 0 0 >>> rnafold.rna_backtrace(Arrow) Matched Pairs = (1,8), (2,7) =================================================================== >>> OPT, Arrow = rnafold.rnafold("CATCATATGATG") OPT Matrix = C A T C A T A T G A T G C 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 T 1 1 0 0 0 0 0 0 0 0 0 0 G 2 1 1 1 0 0 0 0 0 0 0 0 A 2 2 2 1 0 0 0 0 0 0 0 0 T 3 3 2 1 1 0 0 0 0 0 0 0 G 4 3 2 2 1 0 0 0 0 0 0 0 Arrow Matrix = C A T C A T A T G A T G C 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 T -1 0 0 0 0 0 0 0 0 0 0 0 A -1 -1 0 0 0 0 0 0 0 0 0 0 T 1 1 -1 0 0 0 0 0 0 0 0 0 G 0 3 3 3 0 0 0 0 0 0 0 0 A 2 2 2 -1 -1 0 0 0 0 0 0 0 T 1 1 -1 4 4 -1 0 0 0 0 0 0 G 0 -1 3 3 -1 -1 -1 0 0 0 0 0 >>> rnafold.rna_backtrace(Arrow) Matched Pairs = (0,11), (1,10), (2,9), (3,8) =================================================================== >>> OPT, Arrow = rnafold.rnafold("CCCGGGATAATATTAT") OPT Matrix = C C C G G G A T A A T A T T A T C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0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0 0 0 0 T 6 6 6 6 6 6 6 -1 9 9 -1 0 0 0 0 0 >>> rnafold.rna_backtrace(Arrow) Matched Pairs = (6,15), (7,14), (8,13), (0,5) =================================================================== >>> OPT, Arrow = rnafold.rnafold("CATCATCATTACTACTAC") OPT Matrix = C A T C A T C A T T A C T A C T A C C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 A 2 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 C 2 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 T 3 3 2 2 2 1 1 1 0 0 0 0 0 0 0 0 0 0 A 3 3 3 2 2 2 1 1 1 0 0 0 0 0 0 0 0 0 C 3 3 3 2 2 2 1 1 1 0 0 0 0 0 0 0 0 0 T 4 4 3 3 3 2 2 2 1 1 1 0 0 0 0 0 0 0 A 4 4 4 3 3 3 2 2 2 2 1 0 0 0 0 0 0 0 C 4 4 4 3 3 3 2 2 2 2 1 0 0 0 0 0 0 0 Arrow Matrix = C A T C A T C A T T A C T A C T A C C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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