class Test(BT.BiskitTest): """Test class""" TAGS = [ BT.EXE, BT.LONG ] def test_bindingE( self ): """bindingEnergyDelphi test (Barnase:Barstar)""" 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'])
class Test(BT.BiskitTest): """Test class""" TAGS = [BT.EXE, BT.LONG] def test_bindingE(self): """bindingEnergyDelphi test (Barnase:Barstar)""" 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 ) 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'])
def inputComplex(options): if 'c' in options: return T.load(T.absfile(options['c'])) m = PDBModel(T.absfile(options['i'])) ## extract rec and lig chains rec_chains = T.toIntList(options['r']) lig_chains = T.toIntList(options['l']) rec = m.takeChains(rec_chains) lig = m.takeChains(lig_chains) ## create Protein complex com = Complex(rec, lig) return com
def inputComplex( options ): if 'c' in options: return T.load( T.absfile( options['c'] ) ) m = PDBModel( T.absfile( options['i'] ) ) ## extract rec and lig chains rec_chains = T.toIntList( options['r'] ) lig_chains = T.toIntList( options['l'] ) rec = m.takeChains( rec_chains ) lig = m.takeChains( lig_chains ) ## create Protein complex com = Complex( rec, lig ) return com
_use() options = cmdDict({}) f1 = absfile(options['i1']) f2 = absfile(options['i2']) o1 = absfile(options['o1']) o2 = absfile(options['o2']) errWriteln("loading pdbs...") m1 = PDBModel(f1) m2 = PDBModel(f2) if options.has_key('c1'): m1 = m1.takeChains(toIntList(options['c1'])) if options.has_key('c2'): m2 = m2.takeChains(toIntList(options['c2'])) m1.removeRes('TIP3') m2.removeRes('TIP3') m1.sort() m2.sort() errWriteln("compare atoms of pdbs...") mask1, mask2 = m1.equalAtoms(m2) errWriteln("removing %i atoms from %s" % (sum(logical_not(mask1)), f1)) m1.remove(logical_not(mask1))
############ options = T.cmdDict( {'o':'ref.complex', 'lo':'lig.model', 'ro':'rec.model' } ) if len (sys.argv) < 3: _use( options ) ## create a reference complex print "Loading..." ref_com = PDBModel( options['c'] ) print "Removing water..." ref_com.remove( lambda a: a['residue_name'] in ['TIP3','HOH','WAT'] ) ## extract rec and lig chains rec_chains = T.toIntList( options['r'] ) lig_chains = T.toIntList( options['l'] ) print "Extracting rec and lig..." ref_rec = ref_com.takeChains( rec_chains ) ref_lig = ref_com.takeChains( lig_chains ) ## create Protein complex com = ProteinComplex( ref_rec, ref_lig ) print "Saving..." ref_lig.saveAs( T.absfile( options['lo'] ) ) ref_rec.saveAs( T.absfile( options['ro'] ) ) T.dump( com, T.absfile( options['o']) )
_use() options = cmdDict( {} ) f1 = absfile( options['i1'] ) f2 = absfile( options['i2'] ) o1 = absfile( options['o1'] ) o2 = absfile( options['o2'] ) errWriteln("loading pdbs...") m1 = PDBModel( f1 ) m2 = PDBModel( f2 ) if options.has_key('c1'): m1 = m1.takeChains( toIntList( options['c1'] ) ) if options.has_key('c2'): m2 = m2.takeChains( toIntList( options['c2'] ) ) m1.removeRes( 'TIP3' ) m2.removeRes( 'TIP3' ) m1.sort() m2.sort() errWriteln("compare atoms of pdbs...") mask1, mask2 = m1.equalAtoms( m2 ) errWriteln("removing %i atoms from %s" % (sum( logical_not( mask1 ) ), f1)) m1.remove( logical_not( mask1 ) )