Suggest a programming situation in which it would make sense to have several scalar references to one scalar variable that contains a peptide fragment.
When might you want to use a reference to an (anonymous) scalar constant?
Is $$arr the same as $arr->? Why or why not?
Write a subroutine that returns a reference to a hash. Declare a reference to this subroutine and call it using the reference, then print out the hash whose reference is returned from the subroutine.
Write a subroutine that returns a new anonymous subroutine based on its arguments, which are passed to it as references. Call the subroutine and then call the new subroutine that is returned.
Write a subroutine to multiply two matrices.
Develop a data structure that is a hash at the top level and can be used to record the data from microarray runs.
Write a min subroutine that returns the minimum of two integers. Rewrite min3 using it.
Make a subroutine that prints the distance matrix. Make it handle the display of longer numbers appropriately.
Make the subroutine from Exercise 2.9 also display the pattern and string aligned with the output of the edit distance matrix.
Make a subroutine that returns the edit distance array, the best score, and the locations of the best matches.
Any difference in Exercise 2.11 if you calculate row by row instead of column by column?
In Exercise 2.11, save space by keeping only two rows in memory.
In Exercise 2.11, report on types of edits of matches.
In Exercise 2.14, show the strings aligned, extra spaces for insertions or deletions, and flag mismatches.
In Exercise 2.11, can you speed the program up by skipping computations when it becomes clear that the best score you've already found can't be matched or bettered in that column? Why or why not?
Run the approximate string matching program on large text, such as entire chromosomes. How is the performance?
Make a version of the approximate string matching program that searches for the pattern in libraries of text, and then reports on, say, the top 25 hits. (For example, search for a DNA pattern in all the records of a GenBank library.)
How can you alter the approximate string matching algorithm to give different weights to the three edit possibilities, or to different types of mismatches (e.g., by giving a fairly low weight to mismatches between hydrophobic amino acids or the codons that encode them)?
Write an array that handles eleven dimensions.
Answer the questions at the end of Section 2.3.3: Why do you need two exists tests? Is $array a hash or a reference to an anonymous hash? Can you implement it the other way?