Beispiel #1
0
 def test_Kollman_calc_addCharges(self):
     """
      KollmanChargeCalculator addCharges to each atom, giving expected total
     """
     atlen = len(self.mol.allAtoms)
     k_calc = KollmanChargeCalculator()
     k_calc.addCharges(self.mol.allAtoms)
     k_ats = self.mol.allAtoms.get(lambda x: x.chargeSet == 'Kollman')
     self.assertEquals(atlen, len(k_ats))
     total_charge = Numeric.add.reduce(self.mol.allAtoms.charge)
     self.assertAlmostEquals(total_charge, -19.554, 4)
 def test_Kollman_calc_addCharges(self):
     """
      KollmanChargeCalculator addCharges to each atom, giving expected total
     """
     atlen = len(self.mol.allAtoms)
     k_calc = KollmanChargeCalculator()
     k_calc.addCharges(self.mol.allAtoms)
     k_ats = self.mol.allAtoms.get(lambda x: x.chargeSet=='Kollman') 
     self.assertEquals(atlen, len(k_ats))
     total_charge = Numeric.add.reduce(self.mol.allAtoms.charge)
     self.assertAlmostEquals(total_charge, -19.554, 4)
Beispiel #3
0
 def test_Kollman_calc_from_bug(self):
     """
      test KollmanChargeCalculator can add charges to 1a30
     """
     mol = Read("Data/1a30.pdb")[0]
     atlen = len(mol.allAtoms)
     k_calc = KollmanChargeCalculator()
     k_calc.addCharges(mol.allAtoms)
     k_ats = mol.allAtoms.get(lambda x: x.chargeSet == 'Kollman')
     self.assertEquals(atlen, len(k_ats))
     total_charge = Numeric.add.reduce(mol.allAtoms.charge)
     self.assertAlmostEquals(total_charge, 5.7060, 4)
 def test_Kollman_calc_from_bug(self):
     """
      test KollmanChargeCalculator can add charges to 1a30
     """
     mol = Read("Data/1a30.pdb")[0]
     atlen = len(mol.allAtoms)
     k_calc = KollmanChargeCalculator()
     k_calc.addCharges(mol.allAtoms)
     k_ats = mol.allAtoms.get(lambda x: x.chargeSet=='Kollman') 
     self.assertEquals(atlen, len(k_ats))
     total_charge = Numeric.add.reduce(mol.allAtoms.charge)
     self.assertAlmostEquals(total_charge, 5.7060, 4)
Beispiel #5
0
 def test_kollman_calc_constructor(self):
     """
     instantiate an KollmanChargeCalculator
     """
     k_calc = KollmanChargeCalculator()
     self.assertEquals(k_calc.__class__, KollmanChargeCalculator)