[Tutor] please help

Mustafa Musameh jmmy71 at yahoo.com
Fri Mar 21 10:31:07 CET 2014


Please help. I have been search the internet to understand how to write a simple program/script with python, and I did not do anything.
I have a file that look like this
>ID 1
agtcgtacgt…
>ID 2
attttaaaaggggcccttcc
.
.
.
in other words, it contains several IDs each one has a sequence of 'acgt' letters
I need to write a script in python where the output will be, for example, like this 
> ID 1
a = 10%, c = 40%,  g=40%, t = 10%
>ID 2
a = 15%, c = 35%,  g=35%, t = 15%
.
.
.
(i mean the first line is the ID and the second line is the frequency of each letter )
How I can tell python to print the first line as it is and count characters starting from the second line till the beginning of the next '>' and so on

Please help


More information about the Tutor mailing list