[BioPython] Checked in Parsers for Phred and Ace files

Brad Chapman chapmanb at uga.edu
Sun Jan 25 19:22:07 EST 2004


Hello all;
Thanks to Frank Kauff's generous contributions, I've just checked
parsers for Phred and Ace files (from the whole Phred/Phrap/Consed
distribution).

They are checked in as:

Bio/Sequencing/Ace.py
Bio/Sequencing/Phred.py

They work in the same way as standard Biopython parsers so you could
get a Phred iterator and parser with:

from Bio.Sequencing import Phred

parser = Phred.RecordParser()
iterator = Phred.Iterator(open("your_phred_file.phd"), parser)

while 1:
    rec = iterator.next()
    if not rec:
        break
    # do something with the record

The one caveat is that the Ace parser does not support RT, CT and WA 
tags. But, it does do lots of other useful things and if you need
these tags (or know more about them) feel free to provide patches
adding them.

I'd appreciate it if people who are using Phred and Ace files could
test drive the code and make sure it works with their code. I'll try
to get some phred and ace files from our own lab and add at least a
quick test suite for them later this week.

Thanks to Frank for the contribution!
Brad


More information about the BioPython mailing list