Martel based parser to read KEGG Ligand/Enzyme files.
This is a huge regular expression for KEGG Ligand/Enzyme,
built using the
regular expressions on steroids capabilities of
A description of the format can be found in the
from the Ligand distribution, available from:
(Note that as of KEGG release 19.0, the
enzyme file that comes
as part of the Ligand distribution does not conform 100% to this
description. In particular, some entries contain data items that
are not ordered as they should be according the description. This
Biopython format description has been weakened to accomodate parsing
of these irregular entries.)
from Martel import *, RecordReader|
Define a Martel grouping that can parse a block of groups.
Many of the KEGG entries are formatted as:
TAG blah blah blah blah blah blah blah blah
blah blah... and
zzzz... are identically formatted
items that can wrap over multiple lines. This function defines
a consistent grouping for these blocks.
o block_tag - A string of length <= INDENT giving the block tag
TAG in the example above).
o block_group - A callbakc tag for the entire block.
o item - A Martel group/expression for a single instance of the
data item in this block. (Must NOT include the final