Back to index

python-biopython  1.60
Public Member Functions
test_KeyWList.KeyWListTest Class Reference

List of all members.

Public Member Functions

def test_parse
def test_parse2

Detailed Description

Definition at line 10 of file test_KeyWList.py.


Member Function Documentation

Definition at line 12 of file test_KeyWList.py.

00012 
00013     def test_parse(self):
00014         "Parsing keywlist.txt"
00015 
00016         filename = os.path.join("SwissProt", "keywlist.txt")
00017         handle = open(filename)
00018         records = KeyWList.parse(handle)
00019 
00020         # Testing the first record
00021         record = records.next()
00022         self.assertEqual(record["ID"], "2Fe-2S.")
00023         self.assertEqual(record["AC"], "KW-0001")
00024         self.assertEqual(record["DE"], "Protein which contains at least one 2Fe-2S iron-sulfur cluster: 2 iron atoms complexed to 2 inorganic sulfides and 4 sulfur atoms of cysteines from the protein.")
00025         self.assertEqual(record["SY"], "Fe2S2; [2Fe-2S] cluster; [Fe2S2] cluster; Fe2/S2 (inorganic) cluster; Di-mu-sulfido-diiron; 2 iron, 2 sulfur cluster binding.")
00026         self.assertEqual(len(record["GO"]), 1)
00027         self.assertEqual(record["GO"], ["GO:0051537; 2 iron, 2 sulfur cluster binding"])
00028         self.assertEqual(len(record["HI"]), 2)
00029         self.assertEqual(record["HI"][0], "Ligand: Iron; Iron-sulfur; 2Fe-2S.")
00030         self.assertEqual(record["HI"][1], "Ligand: Metal-binding; 2Fe-2S.")
00031         self.assertEqual(record["CA"], "Ligand.")
00032 
00033         # Testing the second record
00034         record = records.next()
00035         self.assertEqual(record["IC"], "Molecular function.")
00036         self.assertEqual(record["AC"], "KW-9992")
00037         self.assertEqual(record["DE"], "Keywords assigned to proteins due to their particular molecular function.")
00038 
00039         # Testing the third record
00040         record = records.next()
00041         self.assertEqual(record["ID"], "Zymogen.")
00042         self.assertEqual(record["AC"], "KW-0865")
00043         self.assertEqual(record["DE"], "The enzymatically inactive precursor of mostly proteolytic enzymes.")
00044         self.assertEqual(record["SY"], "Proenzyme.")
00045         self.assertEqual(len(record["HI"]), 1)
00046         self.assertEqual(record["HI"][0], "PTM: Zymogen.")
00047         self.assertEqual(record["CA"], "PTM.")
00048 
00049         handle.close()

Here is the call graph for this function:

Definition at line 50 of file test_KeyWList.py.

00050 
00051     def test_parse2(self):
00052         "Parsing keywlist2.txt (without header and footer)"
00053 
00054         filename = os.path.join("SwissProt", "keywlist2.txt")
00055         handle = open(filename)
00056         records = KeyWList.parse(handle)
00057 
00058         # Testing the first record
00059         record = records.next()
00060         self.assertEqual(record["ID"], "2Fe-2S.")
00061         self.assertEqual(record["AC"], "KW-0001")
00062         self.assertEqual(record["DE"], "Protein which contains at least one 2Fe-2S iron-sulfur cluster: 2 iron atoms complexed to 2 inorganic sulfides and 4 sulfur atoms of cysteines from the protein.")
00063         self.assertEqual(record["SY"], "Fe2S2; [2Fe-2S] cluster; [Fe2S2] cluster; Fe2/S2 (inorganic) cluster; Di-mu-sulfido-diiron; 2 iron, 2 sulfur cluster binding.")
00064         self.assertEqual(len(record["GO"]), 1)
00065         self.assertEqual(record["GO"], ["GO:0051537; 2 iron, 2 sulfur cluster binding"])
00066         self.assertEqual(len(record["HI"]), 2)
00067         self.assertEqual(record["HI"][0], "Ligand: Iron; Iron-sulfur; 2Fe-2S.")
00068         self.assertEqual(record["HI"][1], "Ligand: Metal-binding; 2Fe-2S.")
00069         self.assertEqual(record["CA"], "Ligand.")
00070 
00071         # Testing the second record
00072         record = records.next()
00073         self.assertEqual(record["ID"], "3D-structure.")
00074         self.assertEqual(record["AC"], "KW-0002")
00075         self.assertEqual(record["DE"], "Protein, or part of a protein, whose three-dimensional structure has been resolved experimentally (for example by X-ray crystallography or NMR spectroscopy) and whose coordinates are available in the PDB database. Can also be used for theoretical models.")
00076         self.assertEqual(len(record["HI"]), 1)
00077         self.assertEqual(record["HI"][0], "Technical term: 3D-structure.")
00078         self.assertEqual(record["CA"], "Technical term.")
00079 
00080         # Testing the third record
00081         record = records.next()
00082         self.assertEqual(record["ID"], "3Fe-4S.")
00083         self.assertEqual(record["AC"], "KW-0003")
00084         self.assertEqual(record["DE"], "Protein which contains at least one 3Fe-4S iron-sulfur cluster: 3 iron atoms complexed to 4 inorganic sulfides and 3 sulfur atoms of cysteines from the protein. In a number of iron-sulfur proteins, the 4Fe-4S cluster can be reversibly converted by oxidation and loss of one iron ion to a 3Fe-4S cluster.")
00085         self.assertEqual(record["SY"], "")
00086         self.assertEqual(len(record["GO"]), 1)
00087         self.assertEqual(record["GO"], ['GO:0051538; 3 iron, 4 sulfur cluster binding'])
00088         self.assertEqual(len(record["HI"]), 2)
00089         self.assertEqual(record["HI"][0], "Ligand: Iron; Iron-sulfur; 3Fe-4S.")
00090         self.assertEqual(record["HI"][1], "Ligand: Metal-binding; 3Fe-4S.")
00091         self.assertEqual(record["CA"], "Ligand.")
00092 
00093         handle.close()

Here is the call graph for this function:


The documentation for this class was generated from the following file: