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
Martel.
A description of the format can be found in the ligand.doc file
from the Ligand distribution, available from: http://www.genome.ad.jp/kegg
(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.)
Imported modules
|
|
from Martel import *, RecordReader
|
Functions
|
|
_define_block_seq
|
|
_define_block_seq
|
_define_block_seq (
block_tag,
block_group,
item,
)
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
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Where blah blah... and zzzz... are identically formatted
items that can wrap over multiple lines. This function defines
a consistent grouping for these blocks.
Arguments:
o block_tag - A string of length <= INDENT giving the block tag
(i.e. 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
newline character).
|
|