-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRosalind Problem 3 REVC.py
executable file
·17 lines (16 loc) · 1.44 KB
/
Rosalind Problem 3 REVC.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def reverse_complement(string):
reverse = string[::-1]
index = 0
new_word = ''
while index < len(reverse):
if reverse[index] == 'A':
new_word = new_word + 'T'
elif reverse[index] == 'T':
new_word = new_word + 'A'
elif reverse[index] == 'C':
new_word = new_word + 'G'
elif reverse[index] == 'G':
new_word = new_word + 'C'
index = index + 1
print new_word
reverse_complement('AGTCGAGATGGGTGTAGTACCTTAGCGCATACGGCGGCTAGCAGTCCGACCCCACGACATCAACATTTGAATGTCAGAGTCGGCCAACTGAGTCATCAGGCAACGGGGATTTTTCCTCAGGTATCAACTGACGTCGAAGCTGCGGTCTAAATTGCGTGCCCGAGTGGAATCTGTGAATCTTAAAGCTGTAACGACAGTCCGACATAAATATTTGAGCCTGTGTGGCCCAATTAGATGTACGAGTCGTCCATAATGGTGTCGTGAACATGCATGAACCCTTTCGCCCACCCCGTCCTTGAACACGCTAGTGCCTTTGGACATAAACTATGGCTTAATCCAGTCGTATCAGAAGTTCCCTTCCATTGAATTCGCATAGCTTCGGGCTGTCCGAATATCATTACTAACACCGGAGTACAGACCGACAACTGGAAGCCGGGAGCAATGCTCCTACTTTCTATCTTTGCCCAGTTCTGTAGAAACAAGGTTCATGGTAGATTTCCTCCGAATTCTCTCGCTTTACTCCTTTGCCTCAGGTCGTGAGGGGGCTTGGCCAATATTGGACGCCATCAGATTTCTCGCTGAATATTCGGCCGAATCTAGAGGGCTTGCAGTCCACAAGCTCCATAGACATAGATCGGTTCAGCAGGCAAGGACGTCTATATTAACGATGAGTCTATTATAAGTCGGTTAGGGCTCCGAGTAGATACTGACGTCAATAAACATCGAACACGAATGAATATAAGAGTTTATAATACAGAGAGCGCGGACGTATCTGCTCGGATGCTCGTGCTCGTTTGGCAGGCTTACCCGGCGCTCCGAAACTATTACTCCTACAAATACGTGTCGAAAATTTAAGCTAGCCCCGAAATAATCTTGACCAGGTCTCAACGTACTCAATAAGGGGAGATTTGAAAGGTCTGACAGCTAGGGTGATTTCATCGTGCGAAGTACGCGGTCCGGCCAACTCCCGTCCAGTAACTTATATTAGC')