Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_PDB.IterationTests Class Reference

List of all members.

Public Member Functions

def setUp
def test_get_chains
def test_get_residues
def test_get_atoms

Public Attributes

 struc

Detailed Description

Definition at line 785 of file test_PDB.py.


Member Function Documentation

Definition at line 787 of file test_PDB.py.

00787 
00788     def setUp(self):
00789         self.struc = PDBParser(PERMISSIVE=True).get_structure('X', "PDB/a_structure.pdb")

Yields all atoms from the structure, excluding duplicates and ALTLOCs which are not parsed.

Definition at line 800 of file test_PDB.py.

00800 
00801     def test_get_atoms(self):
00802         """Yields all atoms from the structure, excluding duplicates and ALTLOCs which are not parsed."""
00803         atoms = ["%12s"%str((atom.id, atom.altloc)) for atom in self.struc.get_atoms()]
00804         self.assertEqual(len(atoms), 756)
00805 
00806 
00807 #class RenumberTests(unittest.TestCase):
00808 #    """Tests renumbering of structures."""
00809 #    
00810 #    def setUp(self):
00811 #        warnings.simplefilter('ignore', PDBConstructionWarning)
00812 #        pdb_filename = "PDB/1A8O.pdb"
00813 #        self.structure=PDBParser(PERMISSIVE=True).get_structure('X', pdb_filename)
00814 #        warnings.filters.pop()
00815 #        
00816 #    def test_renumber_residues(self):
00817 #        """Residues in a structure are renumbered."""
00818 #        self.structure.renumber_residues()
00819 #        nums = [resi.id[1] for resi in self.structure[0]['A'].child_list]
00820 #        print nums
00821 # 
00822 # -------------------------------------------------------------

Yields chains from different models separately.

Definition at line 790 of file test_PDB.py.

00790 
00791     def test_get_chains(self):
00792         """Yields chains from different models separately."""
00793         chains = [chain.id for chain in self.struc.get_chains()]
00794         self.assertEqual(chains, ['A','A', 'B', ' '])

Yields all residues from all models.

Definition at line 795 of file test_PDB.py.

00795 
00796     def test_get_residues(self):
00797         """Yields all residues from all models."""
00798         residues = [resi.id for resi in self.struc.get_residues()]
00799         self.assertEqual(len(residues), 167)


Member Data Documentation

Definition at line 788 of file test_PDB.py.


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