Bio.KEGG.Compound package¶
Module contents¶
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.
- class Bio.KEGG.Compound.Record¶
Bases:
object
Holds info from a KEGG Ligand/Compound record.
- Attributes:
entry The entry identifier.
name A list of the compund names.
formula The chemical formula for the compound
mass The molecular weight for the compound
pathway A list of 3-tuples: (‘PATH’, pathway id, pathway)
enzyme A list of the EC numbers.
structures A list of 2-tuples: (database, list of struct ids)
dblinks A list of 2-tuples: (database, list of link ids)
- __init__(self)¶
Initialize as new record.
- __str__(self)¶
Return a string representation of this Record.
- Bio.KEGG.Compound.parse(handle)¶
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,
>>> with open("KEGG/compound.sample") as handle: ... for record in parse(handle): ... print("%s %s" % (record.entry, record.name[0])) ... C00023 Iron C00017 Protein C00099 beta-Alanine C00294 Inosine C00298 Trypsin C00348 all-trans-Undecaprenyl phosphate C00349 2-Methyl-3-oxopropanoate C01386 NH2Mec