Commit c3ea4df8 by Kyle Beauchamp

Test number of atoms after mutation.

parent 7ae182db
......@@ -6,6 +6,9 @@ import tempfile
def test_mutate_1():
fixer = pdbfixer.PDBFixer(pdbid='1VII')
fixer.applyMutations(["ALA-57-GLY"], "A")
fixer.findMissingResidues()
fixer.findMissingAtoms()
fixer.addMissingAtoms()
fixer.addMissingHydrogens(7.0)
temp_pdb = tempfile.NamedTemporaryFile()
app.PDBFile.writeFile(fixer.topology, fixer.positions, temp_pdb)
......@@ -15,11 +18,20 @@ def test_mutate_1():
def test_mutate_2():
fixer = pdbfixer.PDBFixer(pdbid='1VII')
fixer.applyMutations(["ALA-57-GLY", "SER-56-ALA"], "A")
fixer.applyMutations(["ALA-57-LEU", "SER-56-ALA"], "A")
fixer.findMissingResidues()
fixer.findMissingAtoms()
fixer.addMissingAtoms()
fixer.addMissingHydrogens(7.0)
temp_pdb = tempfile.NamedTemporaryFile()
assert list(fixer.topology.residues())[16].name == "GLY", "Name of mutated residue did not change correctly!"
assert list(fixer.topology.residues())[15].name == "ALA", "Name of mutated residue did not change correctly!"
new_residue57 = list(fixer.topology.residues())[16]
new_residue56 = list(fixer.topology.residues())[15]
assert new_residue57.name == "LEU", "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_residue57.atoms())) == 19, "Should have 19 atoms in ALA 56"
@raises(ValueError)
def test_mutate_3_fails():
......@@ -36,3 +48,4 @@ def test_mutate_4_fails():
def test_mutate_5_fails():
fixer = pdbfixer.PDBFixer(pdbid='1VII')
fixer.applyMutations(["ALA-1000-GLY", "SER-56-ALA"], "A")
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