Commit ac2538b4 by Kyle Beauchamp

Test atom numbers

parent c3ea4df8
...@@ -575,6 +575,7 @@ class PDBFixer(object): ...@@ -575,6 +575,7 @@ class PDBFixer(object):
>>> fixer = PDBFixer(pdbid='1VII') >>> fixer = PDBFixer(pdbid='1VII')
>>> fixer.applyMutations(["ALA-57-GLY"]) >>> fixer.applyMutations(["ALA-57-GLY"])
>>> fixer.findMissingResidues()
>>> fixer.findMissingAtoms() >>> fixer.findMissingAtoms()
>>> fixer.addMissingAtoms() >>> fixer.addMissingAtoms()
>>> fixer.addMissingHydrogens(7.0) >>> fixer.addMissingHydrogens(7.0)
......
...@@ -13,7 +13,10 @@ def test_mutate_1(): ...@@ -13,7 +13,10 @@ def test_mutate_1():
temp_pdb = tempfile.NamedTemporaryFile() temp_pdb = tempfile.NamedTemporaryFile()
app.PDBFile.writeFile(fixer.topology, fixer.positions, temp_pdb) app.PDBFile.writeFile(fixer.topology, fixer.positions, temp_pdb)
pdb = app.PDBFile(temp_pdb.name) pdb = app.PDBFile(temp_pdb.name)
assert list(pdb.topology.residues())[16].name == "GLY", "Name of mutated residue did not change correctly!"
new_residue57 = list(fixer.topology.residues())[16]
assert new_residue57.name == "GLY", "Name of mutated residue did not change correctly!"
assert len(list(new_residue57.atoms())) == 7, "Should have 7 atoms in GLY 56"
def test_mutate_2(): def test_mutate_2():
...@@ -30,7 +33,7 @@ def test_mutate_2(): ...@@ -30,7 +33,7 @@ def test_mutate_2():
assert new_residue56.name == "ALA", "Name of mutated residue did not change correctly!" assert new_residue56.name == "ALA", "Name of mutated residue did not change correctly!"
assert len(list(new_residue56.atoms())) == 10, "Should have 10 atoms in ALA 56" assert len(list(new_residue56.atoms())) == 10, "Should have 10 atoms in ALA 56"
assert len(list(new_residue57.atoms())) == 19, "Should have 19 atoms in ALA 56" assert len(list(new_residue57.atoms())) == 19, "Should have 19 atoms in LEU 57"
@raises(ValueError) @raises(ValueError)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment