Last active
November 7, 2015 01:34
-
-
Save acomjean/4f8f02fbd352eac789ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Python Problem 1 | |
| #reverseComplement.py | |
| #Introduction to Bioinformatics Assignment 2 | |
| #Purpose: reverse compliment | |
| #Your Name: Aram Comjean | |
| #Date: 10/11/2105 | |
| #s1 is the string you should use to generate a reverse complement sequence | |
| #Note that your result needs to be presented in the 5' to 3' direction | |
| s1 = "AAAAACCCCCTCGGCTAATCGACTACTACTACTACTACTTCATCATCATCAGGGGGGGGCTCTCTCTAAAAACCCCTTTTGGGGG" | |
| find_replace_dictionary = {'A':'T', 'T':'A','G':'C','C':'G'}; | |
| compliment =''; | |
| for key in s1: | |
| #Skip values if not in dictionary | |
| if key in find_replace_dictionary: | |
| #add to compliment string | |
| compliment+= find_replace_dictionary[key] | |
| #reverse the string | |
| reverse_compliment = compliment[::-1] | |
| print reverse_compliment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment