[Tutor] Character counting again, was Re: Tutor Digest, Vol 121, Issue 56

2014-03-24 Thread Peter Otten
Jumana yousef wrote: [Please don't reply to the digest. At the very least change the subject to its original text. Thank you.] > just a reminder of my data: > it cossets of multiple sequences of DNA that I need to count the bases(characters) and calculate the percentage of C+G and calculate the

Re: [Tutor] character counting

2014-03-23 Thread Cameron Simpson
On 23Mar2014 17:28, Mustafa Musameh wrote: > Hi; > I have a file that looks like this: > >title 1 > AAATTTGGGCCCATA... > TTAACAAGTTAAAT > >title 2 > AAATTTAAACCC > ATATATATA > > > I wrote the following to count the As, Cs, Gs anTs for each title I wrote the > following > > import sys > > f

Re: [Tutor] character counting

2014-03-23 Thread Alan Gauld
On 23/03/14 06:28, Mustafa Musameh wrote: Hi; I have a file that looks like this: >title 1 AAATTTGGGCCCATA... TTAACAAGTTAAAT… >title 2 AAATTTAAACCC… ATATATATA… … I want to get the following out put: >title 234 >title 1 3453 …. Your example data and example output don't match - at

Re: [Tutor] character counting

2014-03-23 Thread spir
On 03/23/2014 07:28 AM, Mustafa Musameh wrote: Hi; I have a file that looks like this: title 1 AAATTTGGGCCCATA... TTAACAAGTTAAAT… title 2 AAATTTAAACCC… ATATATATA… … I wrote the following to count the As, Cs, Gs anTs for each title I wrote the following import sys file = open('file.fna'

[Tutor] character counting

2014-03-23 Thread Mustafa Musameh
Hi; I have a file that looks like this: >title 1 AAATTTGGGCCCATA... TTAACAAGTTAAAT… >title 2 AAATTTAAACCC… ATATATATA… … I wrote the following to count the As, Cs, Gs anTs for each title I wrote the following import sys file = open('file.fna') data=file.readlines() for line in data: li