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])
Beispiel #2
0
    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])
Beispiel #3
0
 def test_inputParameters(self):
     """
      test nul input to classify
         
     """
     bndClassifier = BondClassifier({'amide': AmideBondSelector()})
     self.assertRaises(AssertionError, bndClassifier.classify)
Beispiel #4
0
 def test_constructorOptions(self):
     """
      test possible constructor options
         options = {key: bondSelector, key2:bondSelector2,....}
     """
     bndClassifier = BondClassifier({'amide': AmideBondSelector()})
     self.assertEquals(bndClassifier.__class__, BondClassifier)
Beispiel #5
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 __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
Beispiel #7
0
 def test_constructor(self):
     """
     instantiate an BondClassifier
     """
     bndClassifier = BondClassifier()
     self.assertEquals(bndClassifier.__class__, BondClassifier)