Table of Contents

Module: compound_format Bio/KEGG/Compound/compound_format.py

Martel based parser to read KEGG Ligand/Compound files.

This is a huge regular regular expression for KEGG Ligand/Compound, 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

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).


Table of Contents

This document was automatically generated on Mon Jul 1 12:03:06 2002 by HappyDoc version 2.0.1