hi,

Thanks in advance.I am doing bioinformatics and plz help me

 Consider a sequence

*S='UACUGUUAA'*

I have to split three as *‘UAC’,’UGU’,’UAA’*

and Consider the position within the array element

*0 1 2   0 1 2    0 1  2*

*U A C,  U G U,   U A A*

And finding the frequency of occurrence of U,C,A,G  in their respective
position.so far i have identified the position .but i dont know to calculate
the frequency.



*Desired outpu*t:



Total number of U at  0 th position :3

Total number of U at 1th position:0

Total number of U at 2nd position:1



Total number of A at  0 th position :0

Total number of A at 1sth position:2

Total number of A at 2nd position:1



Total number of C at  0 th position :0

Total number of C at first position:0

Total number of C at second position:1



Total number of G at  0 th position :0

Total number of G at first position:1

Total number of G at second position:0

i have wrotten program upto this.please help.

*program:*

 content='UACUGUUAA'
s=''
for i in range(0,(len(content))):
    s=s+content[i].replace('\n','')
print len(s)
L=[]
for k in range(0,len(s),3):
   two=s[k:k+3]
   if len(two)==3:
      L.append(two)
   #L[k].find('A')
print len(L)
print L
for i in range(len(L)):
    if L[i].find('A')>0:
         b=L[i].index('A')
         print i,'th element of A is in the position of',b


**


**

*output:
*

*9
3
['UAC', 'UGU', 'UAA']
0 th element of A is in the position of 1
2 th element of A is in the position of 1
*

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Python Ireland" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ie/group/pythonireland?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to