DNA or deoxyribonucleic acid is a nucleic acid that contains genetic information. It is responsible for propagation of inherited traits. DNA is organized as two complementary strands that Watson and Crick called the Double Helix. Each strand is built out of nucleotides called bases of which there are four - adenine (A), thymine (T), cytosine (C), and guanine (G). The bases of the two complementary strands that make up the DNA pair up in this order: A+T, T+A, C+G, and G+C. Strands have directionality and the sequence order does matter. Genetic information is determined by the sequence of bases along the strand.
DNA has played an important role in research in computer science. For example research in string searching algorithms has been motivated by finding sequences in DNAs. For the present assignment, we are interested in finding the longest common base sequence in two DNA strands. Each strand is represented by the sequence of letters A, T, C, and G. For the two strands ACTG and TGCA the longest common sequence is TG. It is quite possible for two strands not to have any common sequence (a sequence of 1 base does not count). Also there could be two or more common sequences that have the same longest length.
In your program you will open a text file called dna.txt. The first line of data is an integer number n that gives the number of pairs of DNA to follow. You will read one pair of DNA strings at a time. The maximum length of each string is 80 characters. Assume that each string consists only of characters 'A', 'T', 'C' and 'G'. It is acceptable if a string is in lower case or is in mixed upper and lower case. Convert both strings to upper case. Print out the longest common sequence(s) for the two strings. If there is more than one longest common sequence then print each of those sequences on separate lines. The sequences should be left aligned. If there is no common sequence your program should output No Common Sequence Found.
Sample output session would look like:
Longest Common Sequences Pair 1: TCG Pair 2: TGAT GGAC Pair 3: No Common Sequence Found
Your program should have a good, clean logical structure. We will be looking at good documentation, descriptive variable names, and adherence to the coding convention mentioned below. Your file DNA.py will have the following header:
# File: DNA.py # Description: # Student Name: # Student UT EID: # Course Name: CS 303E # Unique Number: # Date Created: # Date Last Modified:
Use the turnin program to submit your DNA.py file. The proctors should receive your work by 11 PM on Friday, 26 October 2012. There will be substantial penalties if you do not adhere to the guidelines. The TA in charge of this assignment is Joseph Perez (firstname.lastname@example.org).