Thanks for all the help,I wouldnt have come this far without the help of all u ppl.
there is a new problem
this is the code.as I already posted i want to find something like
A[01]*T[02]*A[03]
But the problem I am facing is that the datadict has keys like "01","02" but the in the loop of seq i have 1,2,3,4. and i cant start from zero whatsoever. how can i make the looping of my seq to 01,02 etc..if i say
for i in range('01',len( seq)):
its taking it as a string!
waiting for ur reply,
cheers!!
there is a new problem
Code:
f=open("deeps1.txt","r") line=f.next() while not line.startswith('PO'): line=f.next() headerlist=line.strip().split()[1:] linelist=[] line=f.next().strip() while not line.startswith('/'): if line != '': linelist.append(line.strip().split()) line=f.next().strip() keys=[i[0] for i in linelist] values=[[float(s) for s in item] for item in [j[1:] for j in linelist]] array={} linedict=dict(zip(keys,values)) keys = linedict.keys() keys.sort() for key in keys: array=[key,linedict[key]] datadict={} datadict1={} for i,item in enumerate(headerlist): datadict[item]={} for key_ in linedict: datadict[item][key_]=linedict[key_][i] for keymain in datadict: for keysub in datadict[keymain]: datadict[keymain][keysub]+=1.0 #print datadict['T']['16'] seq="ATA" res=1 for i in range(1,len(seq)): key=seq[i] for keymain in datadict: if keymain==key: print key,i #print datadict[key] #print res
A[01]*T[02]*A[03]
But the problem I am facing is that the datadict has keys like "01","02" but the in the loop of seq i have 1,2,3,4. and i cant start from zero whatsoever. how can i make the looping of my seq to 01,02 etc..if i say
for i in range('01',len( seq)):
its taking it as a string!
waiting for ur reply,
cheers!!
Comment