determine longest poly-purine tract
Code Golf! 

This is my Python script, avoiding regex and not at all prettified.

def gettract(strand):
    #if strand is 1 then replace C with T and split on T
    #else replace A with G and split on G

    if strand==1:
        print 'top strand purine tracts:'
        aseq=seq.replace('C','T')
        tracts=aseq.split('T')
    elif strand==2:
        print 'top strand pyrimidine tracts:'
        aseq=seq.replace('A','G')
        tracts=aseq.split('G')      
    sortedtracts=sorted(tracts,key=len,reverse=True)
    for i in range(5):
        print len(sortedtracts[i]), sortedtracts[i]



f=open('ec_dna.txt','r')
l=f.readlines()
print 'Sequence analysed is %s' % l[0][1:] #the header line
f.close()
seq=''.join([i.rstrip() for i in l[1:]])
print 'sequence length is %i' %len(seq)
print
gettract(1)
print
gettract(2)


And here is the output:


  Sequence analysed is E. coli K-12 MG1655 U00096.2 (1 to 4639675 = 4639675 bp)
  
  sequence length is 4639675
  
  top strand purine tracts:
  
  28 AGAGAGAAAAGAAGAAGAGAAAAGAAAA
  
  22 GGGGGAGAAAGGGGGGAAAAGG
  
  20 AAAGAGGAAAGGGGGGGGGG
  
  20 GAAGAGGAAAAGAAAGAAGG
  
  20 AAAAAAGAAGAGAAAAAAGA
  
  top strand pyrimidine tracts:
  
  29 TTTTTCTCTTTCCCTTTTCCCTTCCCTCT
  
  22 CCCTCCTCTTCTCTCCCTCCCC
  
  21 TTCTCCTCCTTCTCTTTTCTT
  
  21 TTTTTCTTCTCTCTTTTCCTC
  
  21 CTCCCCTTTTCCCTTTTCTCC


The longest purine tract is 29 bases long, and is on the bottom strand.

This script doesn't handle the problem that the E. coli genome is a circular molecule, so if the longest tract was split at the origin it would be missed - I leave that and obtaining the coordinates of the longest tract as an exercise.