On Tue, Apr 28, 2009 at 7:23 AM, sandy smile <[email protected]> wrote:
> 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.
I can offer this:
segment_len = 3
a = "UACUGUUAA"
indexed = [(x % segment_len, y) for x, y in enumerate(a)]
unique = set(indexed)
for pair in unique:
print ("Total number of %s at position %s is %s"
% (pair[1], pair[0], indexed.count(pair)))
Looks more or less like your desired output.
Maciej
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---