Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (15 sloc) 545 Bytes
import urllib,re,sys,contextlib
base_url="http://www.uniprot.org/uniprot/"
for protein in sys.stdin:
outstring,sequence="",""
with contextlib.closing(urllib.urlopen(base_url+protein[:6]+".fasta")) as f:
f.readline()
for x in f:
sequence=sequence+x.strip()
m=re.finditer('(?=(N[^P][ST][^P]))',sequence)
for r in m:
start,end=r.span()
outstring+=str(start+1)
outstring+=' '
if len(outstring)>0:
print "%s%s" %(protein,outstring)
You can’t perform that action at this time.