Back to index

python-biopython  1.60
test_Enzyme.py
Go to the documentation of this file.
00001 # Copyright 1999 by Katharine Lindner.  All rights reserved.
00002 # This code is part of the Biopython distribution and governed by its
00003 # license.  Please see the LICENSE file that should have been included
00004 # as part of this package.
00005 
00006 
00007 import os
00008 import unittest
00009 
00010 from Bio.ExPASy import Enzyme
00011 
00012 
00013 class TestEnzyme(unittest.TestCase):
00014 
00015     def test_lipoprotein(self):
00016         "Parsing ENZYME record for lipoprotein lipase (3.1.1.34)"
00017         filename = os.path.join( 'Enzymes', 'lipoprotein.txt')
00018         handle = open(filename)
00019         record = Enzyme.read(handle)
00020         handle.close()
00021         self.assertEqual(record["ID"], "3.1.1.34")
00022         self.assertEqual(record["DE"], "Lipoprotein lipase.")
00023         self.assertEqual(len(record["AN"]), 3)
00024         self.assertEqual(record["AN"][0], "Clearing factor lipase.")
00025         self.assertEqual(record["AN"][1], "Diacylglycerol lipase.")
00026         self.assertEqual(record["AN"][2], "Diglyceride lipase.")
00027         self.assertEqual(record["CA"], "Triacylglycerol + H(2)O = diacylglycerol + a carboxylate.")
00028         self.assertEqual(record["CC"][0], 'Hydrolyzes triacylglycerols in chylomicrons and very low-density lipoproteins (VLDL).')
00029         self.assertEqual(record["CC"][1], "Also hydrolyzes diacylglycerol.")
00030         self.assertEqual(record['PR'], ["PDOC00110"])
00031         self.assertEqual(record["DR"][0], ["P11151", "LIPL_BOVIN"])
00032         self.assertEqual(record["DR"][1], ["P11153", "LIPL_CAVPO"])
00033         self.assertEqual(record["DR"][2], ["P11602", "LIPL_CHICK"])
00034         self.assertEqual(record["DR"][3], ["P55031", "LIPL_FELCA"])
00035         self.assertEqual(record["DR"][4], ["P06858", "LIPL_HUMAN"])
00036         self.assertEqual(record["DR"][5], ["P11152", "LIPL_MOUSE"])
00037         self.assertEqual(record["DR"][6], ["O46647", "LIPL_MUSVI"])
00038         self.assertEqual(record["DR"][7], ["P49060", "LIPL_PAPAN"])
00039         self.assertEqual(record["DR"][8], ["P49923", "LIPL_PIG"])
00040         self.assertEqual(record["DR"][9], ["Q06000", "LIPL_RAT"])
00041         self.assertEqual(record["DR"][10], ["Q29524", "LIPL_SHEEP"])
00042 
00043     def test_proline(self):
00044         "Parsing ENZYME record for proline racemase (5.1.1.4)"
00045         filename = os.path.join( 'Enzymes', 'proline.txt')
00046         handle = open(filename)
00047         record = Enzyme.read(handle)
00048         handle.close()
00049         self.assertEqual(record["ID"], "5.1.1.4")
00050         self.assertEqual(record["DE"], "Proline racemase.")
00051         self.assertEqual(record["CA"], "L-proline = D-proline.")
00052         self.assertEqual(len(record["DR"]), 9)
00053         self.assertEqual(record["DR"][0], ["Q17ZY4", "PRAC_CLOD6"])
00054         self.assertEqual(record["DR"][1], ["A8DEZ8", "PRAC_CLODI"])
00055         self.assertEqual(record["DR"][2], ["Q4DA80", "PRCMA_TRYCR"])
00056         self.assertEqual(record["DR"][3], ["Q868H8", "PRCMB_TRYCR"])
00057         self.assertEqual(record["DR"][4], ["Q3SX04", "PRCM_BOVIN"])
00058         self.assertEqual(record["DR"][5], ["Q96EM0", "PRCM_HUMAN"])
00059         self.assertEqual(record["DR"][6], ["Q9CXA2", "PRCM_MOUSE"])
00060         self.assertEqual(record["DR"][7], ["Q5RC28", "PRCM_PONAB"])
00061         self.assertEqual(record["DR"][8], ["Q66II5", "PRCM_XENTR"])
00062 
00063     def test_valine(self):
00064         "Parsing ENZYME record for valine decarboxylase (4.1.1.14)"
00065         filename = os.path.join( 'Enzymes', 'valine.txt')
00066         handle = open(filename)
00067         record = Enzyme.read(handle)
00068         handle.close()
00069         self.assertEqual(record["ID"], "4.1.1.14")
00070         self.assertEqual(record["DE"], "Valine decarboxylase.")
00071         self.assertEqual(record["CA"], "L-valine = 2-methylpropanamine + CO(2).")
00072         self.assertEqual(record["CF"], "Pyridoxal 5'-phosphate.")
00073         self.assertEqual(record["CC"], ["Also acts on L-leucine."])
00074         self.assertEqual(len(record["DR"]), 0)
00075 
00076     def test_lactate(self):
00077         "Parsing ENZYME record for lactate racemase (5.1.2.1)"
00078         filename = os.path.join( 'Enzymes', 'lactate.txt')
00079         handle = open(filename)
00080         record = Enzyme.read(handle)
00081         handle.close()
00082         self.assertEqual(record["ID"], "5.1.2.1")
00083         self.assertEqual(record["DE"], "Lactate racemase.")
00084         self.assertEqual(len(record["AN"]), 3)
00085         self.assertEqual(record["AN"][0], "Hydroxyacid racemase.")
00086         self.assertEqual(record["AN"][1], "Lactic acid racemase.")
00087         self.assertEqual(record["AN"][2], "Lacticoracemase.")
00088         self.assertEqual(record["CA"], "(S)-lactate = (R)-lactate.")
00089         self.assertEqual(len(record["DR"]), 0)
00090 
00091 if __name__ == "__main__":
00092     runner = unittest.TextTestRunner(verbosity = 2)
00093     unittest.main(testRunner=runner)