Displaying the Length of Individual Sequences in File
<p>I have a file that contains two sequences. I have a program that could read all sequences, combine them together, and display the length of both sequences together. Now I want to display the length individually.  The two sequences are separated by the symbol <code>&gt;</code>.</p>

<p>Example:</p>

<pre><code>SEQ1 &gt;ATGGGACTAGCAGT

SEQ2  &gt;AGGATGATGAGTGA
</code></pre>

<p>Program:</p>

<pre><code>#!usr/bin/python
import re
fh=open('clostp1.fa','r')
count=0
content=fh.readlines()
fh.close()
seq=''
patt=re.compile('&gt;(.*?)')
for item in content:
    m=patt.match(item)
    if not m:
        s=item.replace('\n','')
        seq=seq+s
seq=seq.replace('\s','')       
print seq
print 'The length of the coding sequence of the bacillus' 
print len(seq)
</code></pre>
