Last active
August 29, 2015 13:58
-
-
Save mdshw5/10392986 to your computer and use it in GitHub Desktop.
biostars 97452
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
from json import dumps | |
fh = open("restriction_enzymes.txt", "r") | |
enzyme_sites = dict() | |
for line in fh: | |
seq, name = line.rstrip().split() | |
enzyme_sites[seq] = name | |
# here is a nice way to print our dictionary | |
print(dumps(enzyme_sites, indent=4)) | |
DNA = random_DNA(6) | |
print(DNA) | |
print(enzyme_sites[DNA]) | |
print(enzyme_sites['AACGTT']) | |
fh.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment