def test_HydrogenRotatorBondSelector_select_all(self): """ test HydrogenRotator select: all bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.allAtoms bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'all_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds) , 18)
def test_HydrogenRotatorBondSelector_select_none(self): """ test HydrogenRotator select: no bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.allAtoms[2:6] bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'no_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds) , 0)
def test_HydrogenRotatorBondSelector_select_some(self): """ test HydrogenRotator select: some bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.chains.residues[:8].atoms bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'some_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds) , 4)
def test_HydrogenRotatorBondSelector_select_all(self): """ test HydrogenRotator select: all bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.allAtoms bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'all_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds), 18)
def test_HydrogenRotatorBondSelector_select_some(self): """ test HydrogenRotator select: some bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.chains.residues[:8].atoms bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'some_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds), 4)
def test_HydrogenRotatorBondSelector_select_none(self): """ test HydrogenRotator select: no bonds """ HRSel = HydrogenRotatorBondSelector() ats = self.mol.allAtoms[2:6] bnds = ats.bonds[0] resultBnds = HRSel.select(bnds) #print 'no_hydrogenrotators:len(resultBnds)=', len(resultBnds) self.assertEqual(len(resultBnds), 0)
def __init__(self, tolerance=0.01, detectAll=True): self.detect_all_cycles = detectAll self.d = { 'amide': AmideBondSelector(), 'ppbb': PeptideBackBoneBondSelector(), 'leaf': LeafBondSelector(), 'cycle': CycleBondSelector(), 'rotatable': RotatableBondSelector(), 'bondOrder2': BondOrderBondSelector(2), 'hydrogenRotators': HydrogenRotatorBondSelector(), 'guanidinium': GuanidiniumBondSelector(), 'aromatic': AromaticCycleBondSelector2() } BondClassifier.__init__(self, self.d) #used to detect colinear atoms #if dist1+dist2<dist13+0.1 self.tolerance = 0.01
def test_HydrogenRotatorBondSelector_constructor(self): """ test HydrogenRotator constructor """ hrBndSel = HydrogenRotatorBondSelector() self.assertEqual(hrBndSel.__class__, HydrogenRotatorBondSelector)