Package Bio :: Package Blast :: Module NCBIXML
[hide private]
[frames] | no frames]

Module NCBIXML

source code

This module provides code to work with the BLAST XML output
following the DTD available on the NCBI FTP
ftp://ftp.ncbi.nlm.nih.gov/blast/documents/xml/NCBI_BlastOutput.dtd

Classes:
BlastParser         Parses XML output from BLAST (direct use discouraged).
                    This (now) returns a list of Blast records.
                    Historically it returned a single Blast record.
                    You are expected to use this via the parse or read functions.

_XMLParser          Generic SAX parser (private).

Functions:
parse               Incremental parser, this is an iterator that returns
                    Blast records.  It uses the BlastParser internally.
read                Returns a single Blast record. Uses the BlastParser internally.

Classes [hide private]
  _XMLparser
Generic SAX Parser
  BlastParser
Parse XML BLAST data into a Record.Blast object
Functions [hide private]
 
read(handle, debug=0)
Returns a single Blast record (assumes just one query).
source code
 
parse(handle, debug=0)
Returns an iterator a Blast record for each query.
source code
Variables [hide private]
  __package__ = 'Bio.Blast'
Function Details [hide private]

read(handle, debug=0)

source code 
Returns a single Blast record (assumes just one query).

This function is for use when there is one and only one BLAST
result in your XML file.

Use the Bio.Blast.NCBIXML.parse() function if you expect more than
one BLAST record (i.e. if you have more than one query sequence).

parse(handle, debug=0)

source code 
Returns an iterator a Blast record for each query.

handle - file handle to and XML file to parse
debug - integer, amount of debug information to print

This is a generator function that returns multiple Blast records
objects - one for each query sequence given to blast.  The file
is read incrementally, returning complete records as they are read
in.

Should cope with new BLAST 2.2.14+ which gives a single XML file
for multiple query records.

Should also cope with XML output from older versions BLAST which
gave multiple XML files concatenated together (giving a single file
which strictly speaking wasn't valid XML).