-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreverse_complementary.py
10 lines (8 loc) · 1.11 KB
/
reverse_complementary.py
1
2
3
4
5
6
7
8
9
10
def ReverseComplement(pattern):
comp_pairs = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
comp_strand = ''
for i in pattern:
comp_strand += comp_pairs[i]
rev_comp_strand = comp_strand[::-1]
return rev_comp_strand
print(ReverseComplement('AAAGGACATCTACGAATCCATAGGCTAAAGGTTATAGACACCTATTTTTTTTGAAAGCTTCGGGATGCTGATTAACCTGTTATCTTGTAACATTTGGGGGAAGCAACCGACCCACTTCCATCGGAGTATCTCACGAGCGTCATGTGGGTGTACCTAGGCGTCCTGTATTGCAATTAAGGATCTTGAATCGTAGACACCGTTATACCCAGAGGTTATTTTGATAAGGCAGTGTTACTTCGATCTGTTTGTGTAGATGTCCTCGAAATGAAATGTGTTCACACGTAACGAATGTAAAAGAGAGTAATGGAGTCAGAATGAAGTGACGTGAGCAAAGGACTCACGCGACGCACCTTCTTCAAGGGATCTGTCCTGTAACAAGCCCCCCGTTGCTATCGCGTTGCCTGAGTTTCATCGCCAATCACCCGCGGACTACACCGCGATGTGTAAGCCCTGATAGGTGGGTTGTTAACGGGTGCTCAGCTGGACAGCCAGTTGAGTCATACCGCCAGCAGTTGCTGCGACAGATTTGCTCGTTGATGGGCAATTTGCGTGAGCTCGAGCCCTTTAGGGACGACATGCCATGAAAGATAAAACCGACTCCCCTCAAGAACAGCTGTAGTCTTCATTATTACGAGCCAAATTACTCGGCCCTCTACCAAATGAGCGATTTTGCAACACAAGTGCCGTTGCAAATCGGCGGAACTAACGACTCCTTTTAAACCGAGGTGACTGGGACATAAGTATACTCAAGTTCGGTCTCAGATGTTCGGTCCGCGATTCACTATGATTGTCCAGATCGAATTGGTTAAGCTCGTCCTCGACTTCCCGGAATCCCGCATACTTGAAAGCCTCCCTTGTTGAAGTGCGCGTGAG'))