Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (23 sloc) 644 Bytes
#!/usr/bin/python
import string
import sys
comp={'A':'T','T':'A','G':'C','C':'G'}
value,key,s="","",{}
with open("rosalind_revp.txt","rU") as f:
for x in f:
if x[0]!=">":
value=value+x.strip()
else:
if key!="": s[key]=value
key=x[1:].strip()
s[key]=value
for x in s.values():
for i in range(len(x)):
for j in range(i+3,min(len(x),i+13),2):
k=0
while x[i+k]==comp[x[j-k]]:
if i+k==j:
# print i+1,k+1,x[i:j+1]
print i+1,k+1
break
k+=1
You can’t perform that action at this time.