def test_classifierVSselectors(self): """ make sure that the classifier returns the same results as its selectors """ bndClassifier = BondClassifier({'amide': AmideBondSelector(), 'cycle': CycleBondSelector(), 'leaf': LeafBondSelector(), 'peptide': PeptideBackBoneBondSelector(), }) #all the bonds in the molecule as a BondSet bnds = self.mol.allAtoms.bonds[0] #get the specified bonds as a BondSet localDict = {} localDict['amide'] = AmideBondSelector().select(bnds) localDict['cycle'] = CycleBondSelector().select(bnds) localDict['leaf'] = LeafBondSelector().select(bnds) localDict['peptide'] = PeptideBackBoneBondSelector().select(bnds) #make the classifier do the same thing resultDict = bndClassifier.classify(bnds) for k in resultDict.keys(): self.compareBondSets(localDict[k], resultDict[k])
def test_classifierVSselectors(self): """ make sure that the classifier returns the same results as its selectors """ bndClassifier = BondClassifier({ 'amide': AmideBondSelector(), 'cycle': CycleBondSelector(), 'leaf': LeafBondSelector(), 'peptide': PeptideBackBoneBondSelector(), }) #all the bonds in the molecule as a BondSet bnds = self.mol.allAtoms.bonds[0] #get the specified bonds as a BondSet localDict = {} localDict['amide'] = AmideBondSelector().select(bnds) localDict['cycle'] = CycleBondSelector().select(bnds) localDict['leaf'] = LeafBondSelector().select(bnds) localDict['peptide'] = PeptideBackBoneBondSelector().select(bnds) #make the classifier do the same thing resultDict = bndClassifier.classify(bnds) for k in resultDict.keys(): self.compareBondSets(localDict[k], resultDict[k])
def test_inputParameters(self): """ test nul input to classify """ bndClassifier = BondClassifier({'amide': AmideBondSelector()}) self.assertRaises(AssertionError, bndClassifier.classify)
def test_constructorOptions(self): """ test possible constructor options options = {key: bondSelector, key2:bondSelector2,....} """ bndClassifier = BondClassifier({'amide': AmideBondSelector()}) self.assertEquals(bndClassifier.__class__, BondClassifier)
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 __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_constructor(self): """ instantiate an BondClassifier """ bndClassifier = BondClassifier() self.assertEquals(bndClassifier.__class__, BondClassifier)