Write a script which can identify sequences which are complementary palindromes.
Palindromes
Palindromes are letter patterns which read the same forward as backward. Here are a few examples:
noon racecar level radar rotator kayakWe can apply this idea to nucleotide sequences. Here are a few nucleotide sequences which are palindromes:
gctaatcg ccggttggcc atata atta atcta cgtaaatgcOne interesting this to notice about palindromes is that some have an even number of letters (in which case each letter has a match) and some have an odd number of letters (in which case the middle letter does not have a match.
ODD: aga actgagtca atata EVEN: agga actgaagtca ataataEven more interesting than normal palindromes sequences are complementary palindromes like these:
gcatatgc aaatttcccgggaaattt atgcatgcatgcgcatgcatgcatIn these the last half of the sequence is complementary to the first half of the sequence. (The last nucleotide is complementary to the first nucleotide, the second to the last nucleotide is complementary to the second nucleotide, and so forth.)
Recognizing Palindromes
How can you tell if two nucleotides are complementary. Try this little "Complementary Nucleotide Quizzer."
ASSIGNMENT:
Write a script which can recognize complementary palindromes like the examples shown on this page. Write a loop (which is quit by entering 'q') which allows the user to keep entering sequences indefinately. After each entry the script reports whether or not the sequence is 1) a palindrome, 2) a complementary palindrome, 3) not a palindrome.