## Lab 3 ## Hand in at the end of Lab def main(): ''' Main method. This is where the bulk of the work gets done. (You can denote block comments as lines between triple quotes) ''' ## 1. Consider the following DNA sequence. Create two variables that contain ## the complement of the DNA sequence and the reverse complement of the DNA ## sequence. Do this by hand. dna = 'ATAGCATTGC' compdna = '' revcompdna = '' print('DNA:',dna) print('Comp. DNA:',compdna) print('Rev. Comp. DNA:',revcompdna) ## print the output of the two intermediate functions. print() print('Intermediate Functions:') print('complement():',complement(dna)) print('reverse():',reverse(dna)) ## Compute the reverse complement print() computedSequence = reverseComplement(dna) print('reverseComplement():',computedSequence) ## 5. Use an IF statement to print 'Correct Answer!' if the computed ## sequence and the hand-written sequences match and 'Incorrect Answer' ## otherwise. return ## 2. Write a function to return the complement of a string. def complement(sequence): comp = '' print('<#2 FILL IN HERE>') return comp ## 3. Write a function to return the reverse of a string. def reverse(sequence): rev = '' print('<#3 FILL IN HERE>') return rev ## 4. Write a function to compute the reverse complement ## of a string. Return this string. def reverseComplement(sequence): revcomp = '' print('<#4 FILL IN HERE>') return revcomp ## The lines below will call the main() function if __name__ == '__main__': main()