[Tutor] please help

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Mar 21 22:28:43 CET 2014


On 21/03/2014 09:31, Mustafa Musameh wrote:
> 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

Welcome :)

Start here http://docs.python.org/3/tutorial/index.html and then come 
back with specific questions about any problems that you may encounter.


-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




More information about the Tutor mailing list