Parse GenBank files and attempt to catch errors.
This is just a small wrapper class around a passed parser which
catches errors that occur in the parser.
When errors occur, we'll raise a ParserFailureError, which returns
(hopefully helpful) information about where the error occured
Methods
|
|
__init__
parse
|
|
__init__
|
__init__ (
self,
parser,
bad_file_handle=None,
)
Initialize an ErrorFeatureParser.
Arguments:
o parser - The actual parser to use in parsing the records.
o bad_file_handle - A handle to write problem GenBank files to
If None, the files will not be saved.
|
|
parse
|
parse ( self, handle )
Parse the specified handle.
Exceptions
|
|
ParserFailureError( "Could not parse record %s" % self._parser._consumer.data.id )
ParserFailureError("Could not parse location %s in record %s" %( msg, self._parser._consumer.data.id ) )
|
|
|