Package Bio :: Package Sequencing :: Module Ace
[hide private]
[frames] | no frames]

Module Ace

source code

Parser for ACE files output by PHRAP.

Written by Frank Kauff ( and
Cymon J. Cox (


There are two ways of reading an ace file:
1) The function 'read' reads the whole file at once;
2) The function 'parse' reads the file contig after contig.

1) Parse whole ace file at once:

        from Bio.Sequencing import Ace'my_ace_file.ace'))

This gives you:
        acefilerecord.ncontigs (the number of contigs in the ace file)
        acefilerecord.nreads (the number of reads in the ace file)
        acefilerecord.contigs[] (one instance of the Contig class for each contig)

The Contig class holds the info of the CO tag, CT and WA tags, and all the reads used
for this contig in a list of instances of the Read class, e.g.:


CT, WA, RT tags from the end of the file can appear anywhere are automatically
sorted into the right place.

see _RecordConsumer for details.

2) Or you can iterate over the contigs of an ace file one by one in the ususal way:

        from Bio.Sequencing import Ace
        for contig in contigs:

Please note that for memory efficiency, when using the iterator approach, only one
contig is kept in memory at once.  However, there can be a footer to the ACE file
containing WA, CT, RT or WR tags which contain additional meta-data on the contigs.
Because the parser doesn't see this data until the final record, it cannot be added to
the appropriate records.  Instead these tags will be returned with the last contig record.
Thus an ace file does not entirerly suit the concept of iterating. If WA, CT, RT, WR tags
are needed, the 'read' function rather than the 'parse' function might be more appropriate.

Classes [hide private]
RD (reads), store a read with its name, sequence etc.
QA (read quality), including which part if any was used as the consensus.
DS lines, include file name of a read's chromatogram file.
AF lines, define the location of the read within the contig.
BS (base segment), which read was chosen as the consensus at each position.
RT (transient read tags), generated by crossmatch and phrap.
CT (consensus tags).
WA (whole assembly tag), holds the assembly program name, version, etc.
WR lines.
Holds information about a read supporting an ACE contig.
Holds information about a contig from an ACE record.
Holds data of an ACE file.
Functions [hide private]
where handle is a file-like object.
source code
Parses the full ACE file in list of contigs.
source code
Variables [hide private]
  __package__ = 'Bio.Sequencing'
Function Details [hide private]


source code 
where handle is a file-like object.

This function returns an iterator that allows you to iterate
over the ACE file record by record:

    records = parse(handle)
    for record in records:
        # do something with the record

where each record is a Contig object.