Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (17 sloc) 480 Bytes
import string
mers=set()
edges=set()
nodes=set()
RC=string.maketrans('CAGT','GTCA')
with open("rosalind_dbru.txt","rU") as f:
for line in f:
mers.add(line.strip())
mers.add(line.strip().translate(RC)[::-1])
n=len(line.strip())
for x in mers:
nodes.add(x[0:n-1])
nodes.add(x[1:n])
edges.add((x[0:n-1],x[1:n]))
with open("dbru.out","w") as f:
for x in edges:
f.write('('+x[0]+', '+x[1]+')\n')
You can’t perform that action at this time.