[BioPython] Parsing ACE files

Sebastian Bassi sbassi at gmail.com
Sat Nov 8 20:35:03 UTC 2008


On Fri, Nov 7, 2008 at 3:02 PM, dr goettel <biopythonlist at gmail.com> wrote:
>> Yes.  Depending on what information you want from the ACE files, you
>> might be better off using Bio.Sequencing.Ace directly.
> Any example or tutorial for this solution?

Here is something I wrote some time back I hope it still works:

from Bio.Sequencing import Ace
aceparser = Ace.ACEParser()
fn = '/mnt/hda2/bio/836CLEAN-100.fasta.cap.ace'
acefilerecord = aceparser.parse(open(fn))
# For each contig:
for ctg in acefilerecord.contigs:
    print '=========================================='
    print 'Contig name: %s'%ctg.name
    print 'Bases: %s'%ctg.nbases
    print 'Reads: %s'%ctg.nreads
    print 'Segments: %s'%ctg.nsegments
    print 'Sequence: %s'%ctg.sequence
    print 'Quality: %s'%ctg.quality
    # For each read in contig:
    for read in ctg.reads:
        print 'Read name: %s'%read.rd.name
        print 'Align start: %s'%read.qa.align_clipping_start
        print 'Align end: %s'%read.qa.align_clipping_end
        print 'Read sequence: %s'%read.rd.sequence
        print '=========================================='



More information about the Biopython mailing list