当前位置: 首页>>代码示例>>Python>>正文


Python Biskit.PDBModel类代码示例

本文整理汇总了Python中Biskit.PDBModel的典型用法代码示例。如果您正苦于以下问题:Python PDBModel类的具体用法?Python PDBModel怎么用?Python PDBModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PDBModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_model

    def test_model(self):
        """PDBDope test final model"""
        from Biskit import PDBModel

        if self.local:
            print '\nData added to info record of model (key -- value):'
            for k in self.d.m.info.keys():
                print '%s -- %s'%(k, self.d.m.info[k])

            print '\nAdded atom profiles:'
            print self.M.atoms

            print '\nAdded residue  profiles:'
            print self.M.residues

            ## check that nothing has changed
            print '\nChecking that models are unchanged by doping ...'

        m_ref = PDBModel( self.f )
        m_ref = m_ref.compress( m_ref.maskProtein() )
        for k in m_ref.atoms.keys():
            #ref = [ m_ref.atoms[i][k] for i in m_ref.atomRange() ]
            #mod = [ self.M.atoms[i][k] for i in self.M.atomRange() ]
            self.assert_( N.all( m_ref[k] == self.M[k]) )

        ## display in Pymol
        if self.local:
            print "Starting PyMol..."
            from Biskit.Pymoler import Pymoler

            pm = Pymoler()
            pm.addPdb( self.M, 'm' )
            pm.colorAtoms( 'm', N.clip(self.M.profile('relAS'), 0.0, 100.0) )
            pm.show()
开发者ID:ostrokach,项目名称:biskit,代码行数:34,代码来源:PDBDope.py

示例2: Test

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'])
开发者ID:ostrokach,项目名称:biskit,代码行数:32,代码来源:delphiBindingEnergy.py

示例3: test_SurfaceRacer

    def test_SurfaceRacer(self):
        """SurfaceRacer test"""

        from Biskit import PDBModel
        import Biskit.mathUtils as MA

        if self.local: print 'Loading PDB...'
        f = T.testRoot()+'/lig/1A19.pdb'
        m = PDBModel(f)
        m = m.compress( m.maskProtein() )

        if self.local: print 'Starting SurfaceRacer'

        self.x = SurfaceRacer( m, 1.4, vdw_set=1, debug=self.DEBUG, verbose=0 )

        if self.local:
            print 'Running ...'

        self.r = self.x.run()

        c= self.r['curvature']
        ms= self.r['MS']

        if self.local:
            print "Curvature: weighted mean %.6f and standard deviation %.3f"\
                  %(MA.wMean(c,ms), MA.wSD(c,ms))

            print 'Relative MS of atoms 10 to 20:',self.r['relMS'][10:20]

            print 'Relative AS of atoms 10 to 20:',self.r['relAS'][10:20]

        self.e = ( N.sum(self.r['relMS'][10:20]), N.sum(self.r['relAS'][10:20]),
              N.sum(self.r['curvature'][10:20]) )

        self.assertAlmostEqual( self.e, self.EXPECT )
开发者ID:ostrokach,项目名称:biskit,代码行数:35,代码来源:SurfaceRacer.py

示例4: Test

class Test(BT.BiskitTest):
    """Test case"""

    def test_molTools(self):
        """molTools test"""
        from Biskit import PDBModel
        
        ## Loading PDB...
        self.m = PDBModel( T.testRoot() + '/lig/1A19.pdb' )
        self.m = self.m.compress( self.m.maskProtein() )

        hb = hbonds( self.m )

        xyz = xyzOfNearestCovalentNeighbour( 40, self.m )
        
        if self.local:
            print '\nThe nearest covalently attached atom to the'
            print '  atom with index 40 has the coordinates:'
            print xyz
    
            print 'Potential h-bonds in model:'
            print '(donor index, acceptor index, distance and angle)'
            for h in hb:
                print h
                
            globals().update( locals() )
                              
        self.r = N0.sum(N0.ravel(hb[3:5])) + N0.sum(xyz)

        self.assertAlmostEqual( self.r, self.EXPECT, 3 )

    EXPECT = 2025.8997840075292 + 152.687011719
开发者ID:graik,项目名称:biskit,代码行数:32,代码来源:molTools.py

示例5: Test

class Test(BT.BiskitTest):
    """Fold_X test"""

    TAGS = [ BT.EXE ]

    def test_Fold_X( self):
        """Fold_X test"""
        from Biskit import PDBModel

        ## Loading PDB...
        self.m = PDBModel( T.testRoot() + '/rec/1A2P.pdb' )
        self.m = self.m.compress( self.m.maskProtein() )

        ## Starting fold_X
        self.x = Fold_X( self.m, debug=self.DEBUG,
                         verbose=(self.VERBOSITY>2) )

        ## Running
        self.r = self.x.run()

        if self.local:
            print "Result: ", self.r

        for k, v in self.r.items():
            self.assertAlmostEqual( v, self.EXPECTED[k], 6 )


    EXPECTED = {'el': -13.766400000000001, 'wtbr': -4.8059700000000003, 'ene': -18.475000000000001, 'mc': 160.28800000000001, 'sloop': 0.0, 'dip': 0.00177626, 'sol_p': 167.71100000000001, 'disu': 0.0, 'tcl': 0.72696700000000003, 'cis': 0.0, 'p_cov': 0.0, 'sol_h': -134.613, 'bb_hb': -87.362499999999997, 'sc_hb': -48.350000000000001, 'vw': -116.67100000000001, 'sc': 58.089300000000001, 'el_kon': 0.0, 'mloop': 0.0, 'vwcl': 0.27728599999999998, 'bbcl': 0.37019200000000002}
开发者ID:ostrokach,项目名称:biskit,代码行数:28,代码来源:Fold_X.py

示例6: Test

class Test(BT.BiskitTest):
    """DSSP test"""

    TAGS = [BT.EXE]

    def prepare(self):
        self.f = T.testRoot()+"/com/1BGS.pdb"


    def test_DSSP( self ):
        """DSSP test"""

        from Biskit import PDBModel

        if self.local: print 'Loading PDB...'
        self.m = PDBModel(self.f)
        self.m = self.m.compress( self.m.maskProtein() )

        if self.local:  print 'Starting DSSP'
        self.dssp = Dssp( self.m )

        if self.local: print 'Running DSSP'

        self.result = self.dssp.run()

        if self.local:
            print "Sequence :", self.m.sequence()
            print "Secondary:", self.result            

        self.assertEquals( self.result, self.EXPECTED)


    EXPECTED =  '.....SHHHHHHHHHHHSS..TTEE.HHHHHHHT..GGGT.HHHHSTT.EEEEEEE..TT..S...TT..EEEEE.S..SSS..S.EEEEETT..EEEESSSSSS.EE...EEEEETTT..SHHHHHHHHHHHHT..TT..SSHHHHHHHHHHT..SSEEEEEE.HHHHHHHTTTTHHHHHHHHHHHHHHT..EEEEE.'
开发者ID:ostrokach,项目名称:biskit,代码行数:33,代码来源:DSSP.py

示例7: Test

class Test(BT.BiskitTest):
    """Test case"""

    TAGS = [ BT.OLD, BT.EXE ]  ## msms is superseeded by SurfaceRacer

    def test_msms(self):
        """msms test"""
        from Biskit import PDBModel

        if self.local: print 'Loading PDB...'
        self.m = PDBModel( T.testRoot() + '/lig/1A19.pdb' )
        self.m = self.m.compress( self.m.maskProtein() )

        if self.local: print 'Getting surfaces via the MSMS executable'
        self.ms = MSMS( self.m, debug=self.DEBUG, verbose=self.local )

        if self.local: print 'Running'
        out, sesList, sasList, atmList = self.ms.run()

        if self.local:
            print out
            print '\nResult from MSMS (first 5 lines): '
            print 'SES \tSAS \tAtom name'
            for i in range(5):
                print '%.2f \t%.2f \t%s'%(sesList[i], sasList[i], atmList[i])

            print 'MSMS done'

            globals().update( locals() )


        self.assertAlmostEqual( out['sas'] + out['ses'],
                                5085.1580000000004 + 4208.7389999999996, 8 )
开发者ID:ostrokach,项目名称:biskit,代码行数:33,代码来源:msms.py

示例8: Test

class Test(BT.BiskitTest):
    """Test"""

    TAGS = [ BT.EXE ]

    def test_Prosa2003(self):
        """Prosa2003 test"""
        from Biskit import PDBModel
        
        ## Loading PDB...
        self.ml = PDBModel( T.testRoot()+'/lig/1A19.pdb' )
        self.ml = self.ml.compress( self.ml.maskProtein() )

        self.mr = PDBModel( T.testRoot()+'/rec/1A2P.pdb' )
        self.mr = self.mr.compress( self.mr.maskProtein() )

        ## Starting Prosa2003
        self.prosa = Prosa2003( [self.ml, self.mr], debug=0, verbose=0 )

        ## Running
        self.ene = self.prosa.run()

        self.result = self.prosa.prosaEnergy()

        if self.local:
            print "Result: ", self.result

        self.assert_( N.sum(self.result - [ -94.568,  -64.903, -159.463 ] ) \
                      < 0.0000001 )
开发者ID:ostrokach,项目名称:biskit,代码行数:29,代码来源:Prosa2003.py

示例9: parseReference

    def parseReference(self, fpdb, dry_out=None ):
        flushPrint("parsing "+fpdb+"...")
        m = PDBModel( fpdb )
        
        solute_res = m.atom2resMask( logical_not( m.maskSolvent() )  )
        self.lenres = self.lenres or sum( solute_res )
        self.lenatoms = len( m ) - sum( m.maskH2O() )

        if dry_out:
            m.remove( m.maskH2O() )
            m.writePdb( dry_out )
        flushPrint('done.\n')
开发者ID:ostrokach,项目名称:biskit,代码行数:12,代码来源:amber_ensembleMD.py

示例10: Test

class Test(BT.BiskitTest):
    """Test class"""

    def test_reduce( self ):
        """AtomCharger test"""
        if self.local: self.log.add('\nLoading PDB...')

        self.m1 = PDBModel( T.testRoot( 'lig/1A19_dry.model' ) )
        self.m2 = T.load( T.testRoot( 'com/ref.complex' ) )
        self.m2 = self.m2.model()

        if self.local: self.log.add('\nRunning Reduce...')
        self.x = Reduce( self.m1, debug=self.DEBUG, verbose=self.local,
                         log=self.log,
                         autocap=True )
        self.m1 = self.x.run()

        if self.local:
            self.log.add('\nReduce protein complex')
        self.x = Reduce( self.m2, debug=self.DEBUG, verbose=self.local,
                         log=self.log,
                         autocap=True )
        self.m2 = self.x.run()
        
        if self.local:
            self.log.add('\nSetup Residue Library\n')
        
        ac = AtomCharger(log=self.log, verbose=self.local)
        
        if self.local:
            self.log.add('match residues to Amber topology')
        
        ac.charge( self.m1 )
        ac.charge( self.m2 )

        self.assertAlmostEqual( N.sum(self.m1['partial_charge']), -6, 2 )
        self.assertAlmostEqual( N.sum(self.m2['partial_charge']), -4, 2 )
        self.assert_(N.all(self.m1['partial_charge'] != 0),'unmatched atoms 1')
        self.assert_(N.all(self.m2['partial_charge'] != 0),'unmatched atoms 2')

        if self.local:
            self.log.add('\nNow test handling of atom miss-matches:\n')
        
        self.m3 = PDBModel(self.m1.clone())
        self.m3.remove( [0,3,100,101,102,200] )
        ac.charge( self.m3 )
        
        self.assertAlmostEqual( N.sum(self.m3['partial_charge']),-8.21, 2)
开发者ID:ostrokach,项目名称:biskit,代码行数:48,代码来源:atomCharger.py

示例11: OldTest

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()
开发者ID:ostrokach,项目名称:biskit,代码行数:16,代码来源:PDBDope.py

示例12: inputComplex

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
开发者ID:graik,项目名称:biskit,代码行数:16,代码来源:delphiBinding.py

示例13: test_hexTools

    def test_hexTools(self):
        """Dock.hexTools test"""
        from Biskit import PDBModel
        self.m = PDBModel( t.testRoot() + '/com/1BGS.pdb' )
        dist = centerSurfDist( self.m , self.m.maskCA() )

        self.assertAlmostEqual( dist[0], 26.880979538, 7)
开发者ID:ostrokach,项目名称:biskit,代码行数:7,代码来源:hexTools.py

示例14: test_IcmCad

    def test_IcmCad( self ):
        """IcmCad test"""
        from Biskit import PDBModel

        if self.local: print 'Loading PDB...'

        self.f = T.testRoot() + '/lig/1A19.pdb'
        self.m1 = PDBModel(self.f)
        self.m1 = self.m1.compress( self.m1.maskProtein() )

        self.ms = []

        self.lig_traj = T.load( T.testRoot() + '/lig_pcr_00/traj.dat' )
        for m in self.lig_traj[:3]:
            m = m.compress( m.maskProtein() )
            self.ms.append(m)

        if self.local: print 'Starting ICM'
        self.x = IcmCad( self.m1, self.ms, debug=self.DEBUG,
                         verbose=self.local )

        if self.local:
            print 'Running'

        self.r = self.x.run()

        if self.local:
            print "Result: ", self.r

        self.assertEqual( self.r, [8.8603529999999999, 9.0315890000000003,
                                   8.5055429999999994] )
开发者ID:graik,项目名称:biskit,代码行数:31,代码来源:IcmCad.py

示例15: prepare

    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 )
开发者ID:ostrokach,项目名称:biskit,代码行数:8,代码来源:PDBDope.py


注:本文中的Biskit.PDBModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。