Package Bio :: Package KEGG :: Package Compound
[hide private]
[frames] | no frames]

Package Compound

source code

This module provides code to work with the KEGG Ligand/Compound database.

Functions: parse - Returns an iterator giving Record objects.

Classes: Record - A representation of a KEGG Ligand/Compound.

Classes [hide private]
  Record
Holds info from a KEGG Ligand/Compound record.
Functions [hide private]
 
id_wrap(indent) source code
 
struct_wrap(indent) source code
 
parse(handle)
Parse a KEGG Ligan/Compound file, returning Record objects.
source code
 
_test()
Run the Bio.KEGG.Compound module's doctests.
source code
Variables [hide private]
  name_wrap = [0, '', (' ', '$', 1, 1), ('-', '$', 1, 1)]
  __package__ = 'Bio.KEGG.Compound'
Function Details [hide private]

parse(handle)

source code 

Parse a KEGG Ligan/Compound file, returning Record objects.

This is an iterator function, typically used in a for loop. For example, using one of the example KEGG files in the Biopython test suite,

>>> handle = open("KEGG/compound.sample")
>>> for record in parse(handle):
...     print record.entry, record.name[0]
...
C00023 Iron
C00017 Protein
C00099 beta-Alanine
C00294 Inosine
C00298 Trypsin
C00348 Undecaprenyl phosphate
C00349 2-Methyl-3-oxopropanoate
C01386 NH2Mec

_test()

source code 

Run the Bio.KEGG.Compound module's doctests.

This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work.