Last active
February 1, 2017 04:21
-
-
Save asvnpr/32fa84b0e8d8547273b823dbb9c97384 to your computer and use it in GitHub Desktop.
reverse DNA compliment. no condition checking nor extra variables
This file contains 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
#! /usr/bin/env python3 | |
#from http://rosalind.info/problems/revc/ | |
s = open("Downloads/rosalind_revc.txt", "r").read() | |
#added new line to dic since it's present in downloaded datasets | |
comp = {'A':'T', 'T':'A', 'C':'G', 'G':'C', '\n':''} | |
for c in s[::-1]: | |
print(comp[c], end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment