a="AGGGCCCCACCAGTACGTCTGGCCAGGGGACTGTGTTAGTGGTGTCGACAGCCGCCACAGGCATAACGATGGATATATACTCCGATACGCATCTCGTAGATTGCCCTATAGGCAGTGGGCAATTAGTAGCGCCCAGTTTTCAAGAGACCTCACGCTCTAGCGAAGCTACGTTTGCCCCCGGGGTGTAAGGGGGCTAAGGTCTACCCGGATCGCGAGGTGGAAGGCCTAAGTAGATCGAATGGTATAAAGGACATCGCATAATAACGTGGAGTGGATCCATCGCACATTACCATTCTGATTACAGTTTTTAATGAATCAATGTTCGGGTTGACCGGGACAAAAATACATGCAGACGATGATAACGCAACTAAATTAACCCCGTTGCAACCTGGTCGCTAGATGACTCCTTTTGATACGAATGCCATTAGTAACGTCATCCTGCGCCGAAGGAGTATTTAATGCAATCCGATACTGGTGAGGGTCCAGAAATTCAGCTTCCGATAGAGCACCCGGGTGATCGTCCTACGTTTGTGGATTTGTCGTTGCTGCCGCTTTTAATACGCTTTTCGGAGTATTCAAGAGCCATCGAGGTGTAGGTCCCTTCGATGTCATTTCTATGGACCGAGCGTGGAGGACCACGCGACCGCCAATATTTCCTTTTCCTTAGAGGACACAAGTAGGCTTTAGATGCGACCAACAAGAAGACGAGTGGGTGACCTAGTGCCCATGCCACATCGATGGGGCAAGGCTTTATGATTAATGACCAAGGGGACTGTTGGTGTTGCTACATCGATCAATGTCTGTCTCAATAGCATAGTCGGACGGCGTGTCGTAAGCAAGCTTTATCTATATTGAGAGACGGGCACATAACGGAAAGCACGCCCGTCGTCTGGTCCACCTCTCTTTA"
a= a.translate({ord('A'):'T',ord('T'):'A',ord('G'):'C',ord('C'):'G'})
a= a[::-1]
print(a)
In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.
The reverse complement of a DNA string
Given: A DNA string
Return: The reverse complement
'Python > rosaland' 카테고리의 다른 글
Counting Point Mutations (0) | 2018.11.21 |
---|---|
Computing GC Content (0) | 2018.11.21 |
Rabbits and Recurrence Relations (0) | 2018.11.16 |
Transcribing DNA into RNA (0) | 2018.11.14 |
Counting DNA Nucleotides (0) | 2018.11.14 |