self.r = self.dG.run() ## self.assertAlmostEqual( self.r['dG_kt'], 21., 0 ) self.assert_(abs(self.r['dG_kt'] - 24.6) < 4) if self.local: self.log.add('\nFinal result: dG = %3.2f kcal/mol' % self.r['dG_kcal']) def test_errorcase1(self): """bindinEnergyDelphi test (error case 01)""" self.m = PDBModel(T.testRoot() + '/delphi/case01.pdb') rec = self.m.takeChains([0, 1]) lig = self.m.takeChains([2]) self.com = Complex(rec, lig) self.dG = DelphiBindingEnergy(self.com, log=self.log, scale=0.5, verbose=self.local) self.r = self.dG.run() if self.local: self.log.add('\nFinal result: dG = %3.2f kcal/mol' % self.r['dG_kcal']) if __name__ == '__main__': BT.localTest(debug=False)
## If there are more than one profile in the model, merge to one. ## Note: this can be problematic as scores depend on family size if self.result: self.result = self.hmmer.mergeProfiles(self.result, self.cons) else: self.result = self.cons self.hmmer.cleanup() self.assertEqual(self.result, self.EXPECTED) #: Hmmer emission scores EXPECTED = [ 2581.0, 3583.0, 1804.0, 2596.0, 3474.0, 2699.0, 3650.0, 2087.0, 2729.0, 2450.0, 2412.0, 2041.0, 3474.0, 1861.0, 2342.0, 2976.0, 5124.0, 2729.0, 2202.0, 2976.0, 3583.0, 2202.0, 2103.0, 2976.0, 1922.0, 2132.0, 4122.0, 2403.0, 4561.0, 4561.0, 3650.0, 2087.0, 4001.0, 2976.0, 3860.0, 3260.0, 2976.0, 6081.0, 3860.0, 5611.0, 2976.0, 3609.0, 3650.0, 6081.0, 3343.0, 2403.0, 3288.0, 4122.0, 2976.0, 2322.0, 2976.0, 1995.0, 4378.0, 2706.0, 2665.0, 4186.0, 3539.0, 2692.0, 3270.0, 2302.0, 2604.0, 2132.0, 2118.0, 2380.0, 2614.0, 2170.0, 3260.0, 2403.0, 1964.0, 3343.0, 2976.0, 2643.0, 3343.0, 2714.0, 2591.0, 3539.0, 3260.0, 2410.0, 1809.0, 3539.0, 2111.0, -774.0, 3860.0, 2450.0, 2063.0, 3474.0, 3474.0, 2057.0, 1861.0 ] if __name__ == '__main__': BT.localTest()
def cleanUp(self): T.tryRemove( self.fout ) def test_AmberCrdParser(self): """AmberCrdParser test""" self.p = AmberCrdParser( self.finp, self.fref, box=True, rnAmber=True, log=self.log, verbose=self.local ) self.t = self.p.crd2traj() self.t.removeAtoms(lambda a: a['residue_name'] in ['WAT','Na+','Cl-'] ) self.t.removeAtoms(lambda a: a['element'] == 'H' ) if self.local: print "Dumping result to ", self.fout T.dump( self.t, T.absfile(self.fout) ) if self.local: print "Dumped Trajectory with %i frames and %i atoms." % \ (len(self.t), self.t.lenAtoms() ) self.assertEqual( len(self.t), 10 ) self.assertEqual( self.t.lenAtoms(), 440 ) if __name__ == '__main__': BT.localTest()
self.outfolder + '/templates/nr' ) def cleanUp(self): T.tryRemove( self.outfolder, tree=1 ) def test_TemplateCleaner(self): """Mod.TemplateCleaner test""" import glob self.c = TemplateCleaner( self.outfolder, log=self.l) inp_dic = modUtils.parse_tabbed_file( T.absfile( self.outfolder + '/templates/nr/chain_index.txt' ) ) self.c.process_all( inp_dic ) if self.local: print 'TemplateCleaner log file written to: %s'% self.f_out globals().update( locals() ) ## check that cleaned pdbs have been written f_cleaned = glob.glob(self.outfolder+ '/templates/nr_cleaned/*pdb') self.assert_( len(f_cleaned) > 0 ) if __name__ == '__main__': BT.localTest(debug=0)
self.com = T.load( T.testRoot() + '/com/ref.complex' ) self.dG = DelphiBindingEnergy( self.com, log=self.log, scale=1.2, verbose=self.local ) self.r = self.dG.run() self.assertAlmostEqual( self.r['dG_kt'], 21., 0 ) if self.local: self.log.add( '\nFinal result: dG = %3.2f kcal/mol'%self.r['dG_kcal']) def test_errorcase1( self ): """bindinEnergyDelphi test (error case 01)""" self.m = PDBModel( T.testRoot() + '/delphi/case01.pdb' ) rec = self.m.takeChains( [0,1] ) lig = self.m.takeChains( [2] ) self.com = Complex( rec, lig ) self.dG = DelphiBindingEnergy( self.com, log = self.log, scale=0.5, verbose=self.local ) self.r = self.dG.run() if self.local: self.log.add( '\nFinal result: dG = %3.2f kcal/mol'%self.r['dG_kcal']) if __name__ == '__main__': BT.localTest(debug=False)
self.log.add( '' ) self.d.addDelphi( scale=1.2 ) self.assertAlmostEqual( self.M['delphi']['scharge'], 0.95, 1 ) class OldTest( BT.BiskitTest ): TAGS = [ BT.EXE, BT.OLD ] def prepare(self): from Biskit import PDBModel self.f = T.testRoot() + '/com/1BGS.pdb' self.M = PDBModel( self.f ) self.M = self.M.compress( self.M.maskProtein() ) self.d = PDBDope( self.M ) def _test_addAsa(self): """PDBDope.addAsa (Whatif, obsolete) test""" self.d.addASA() if __name__ == '__main__': BT.localTest() ## pushes test PDBDope instance as 'd' into namespace
if self.local: self.log.add('Calculating Delphi electrostatic potential') self.log.add('') self.d.addDelphi(scale=1.2) self.assertAlmostEqual(self.M['delphi']['scharge'], 0.95, 1) class OldTest(BT.BiskitTest): TAGS = [BT.EXE, BT.OLD] def prepare(self): from Biskit import PDBModel self.f = T.testRoot() + '/com/1BGS.pdb' self.M = PDBModel(self.f) self.M = self.M.compress(self.M.maskProtein()) self.d = PDBDope(self.M) def _test_addAsa(self): """PDBDope.addAsa (Whatif, obsolete) test""" self.d.addASA() if __name__ == '__main__': BT.localTest() ## pushes test PDBDope instance as 'd' into namespace