Package Bio :: Package Blast :: Module NCBIStandalone :: Class BlastErrorParser
[hide private]
[frames] | no frames]

Class BlastErrorParser

source code

                  object --+    
                           |    
ParserSupport.AbstractParser --+
                               |
                              BlastErrorParser

Attempt to catch and diagnose BLAST errors while parsing.

This utilizes the BlastParser module but adds an additional layer of complexity on top of it by attempting to diagnose ValueErrors that may actually indicate problems during BLAST parsing.

Current BLAST problems this detects are: o LowQualityBlastError - When BLASTing really low quality sequences (ie. some GenBank entries which are just short streches of a single nucleotide), BLAST will report an error with the sequence and be unable to search with this. This will lead to a badly formatted BLAST report that the parsers choke on. The parser will convert the ValueError to a LowQualityBlastError and attempt to provide useful information.

Instance Methods [hide private]
 
__init__(self, bad_report_handle=None)
Initialize a parser that tries to catch BlastErrors.
source code
 
parse(self, handle)
Parse a handle, attempting to diagnose errors.
source code
 
_diagnose_error(self, handle, data_record)
Attempt to diagnose an error in the passed handle.
source code

Inherited from ParserSupport.AbstractParser: parse_file, parse_str

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bad_report_handle=None)
(Constructor)

source code 

Initialize a parser that tries to catch BlastErrors.

Arguments: o bad_report_handle - An optional argument specifying a handle where bad reports should be sent. This would allow you to save all of the bad reports to a file, for instance. If no handle is specified, the bad reports will not be saved.

Overrides: object.__init__

parse(self, handle)

source code 
Parse a handle, attempting to diagnose errors.
Overrides: ParserSupport.AbstractParser.parse

_diagnose_error(self, handle, data_record)

source code 

Attempt to diagnose an error in the passed handle.

Arguments: o handle - The handle potentially containing the error o data_record - The data record partially created by the consumer.