Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 52 lines (36 sloc) 672 Bytes
#!/usr/bin/python
import sys
try:
f=open(sys.argv[1],'rU')
except:
f=sys.stdin
value,key,s="","",{}
for x in f:
if x[0]!=">":
value=value+x.strip()
else:
if key!="": s[key]=value
value=''
key=x[1:].strip()
s[key]=value
m=[]
for x in s:
i=0
for y in s[x]:
if len(m)<=i:
m.append({})
m[i][y]=m[i].get(y,0)+1
i+=1
for x in m:
z,savey=0,''
for y in x:
if x[y]>z:
savey=y
z=x[y]
sys.stdout.write(savey)
print
for x in ['A','C','G','T']:
print(x+":"),
for y in m:
print y.get(x,0),
print
You can’t perform that action at this time.