Beispiel #1
0
    def test_Whatif(self):
        """Whatif test"""

        from Biskit import PDBModel

        ## Loading PDB...

        f = T.testRoot()+"/com/1BGS.pdb"
        m = PDBModel(f)

        m = m.compress( m.maskProtein() )
        m = m.compress( m.maskHeavy() )

        ## Starting WhatIf
        x = WhatIf( m, debug=0, verbose=0 )

        ## Running
        atomAcc, resAcc, resMask = x.run()

        if self.local:
            ## check that model hasn't changed
            m_ref = PDBModel(f)
            m_ref = m.compress( m.maskProtein() )
            for k in m_ref.atoms.keys():
                if not N0.all(m_ref[k] == m[k]):
                    print 'Not equal ', k
                else:
                    print 'Equal ', k

            ## display exposed residues in PyMol
            from Pymoler import Pymoler
            pm = Pymoler()
            model = pm.addPdb( m, '1' )
            pm.colorRes( '1', resAcc[:,0] )
            pm.show()

            print "\nResult for first 10 atoms/residues: "
            print '\nAccessability (A^2):\n', atomAcc[:10]
            print '\nResidue accessability (A^2)'
            print '[total, backbone, sidechain]:\n', resAcc[:10]
            print '\nExposed residue mask:\n',resMask[:10]
            print '\nTotal atom    accessability (A^2): %.2f'%sum(atomAcc) 
            print '      residue accessability (A^2): %.2f'%sum(resAcc)[0]

        self.assertAlmostEqual( N0.sum(resAcc[:,0]), 2814.6903, 7 ) 
Beispiel #2
0
    def test_Whatif(self):
        """Whatif test"""

        from Biskit import PDBModel

        ## Loading PDB...

        f = T.testRoot() + "/com/1BGS.pdb"
        m = PDBModel(f)

        m = m.compress(m.maskProtein())
        m = m.compress(m.maskHeavy())

        ## Starting WhatIf
        x = WhatIf(m, debug=0, verbose=0)

        ## Running
        atomAcc, resAcc, resMask = x.run()

        if self.local:
            ## check that model hasn't changed
            m_ref = PDBModel(f)
            m_ref = m.compress(m.maskProtein())
            for k in m_ref.atoms.keys():
                if not N0.all(m_ref[k] == m[k]):
                    print 'Not equal ', k
                else:
                    print 'Equal ', k

            ## display exposed residues in PyMol
            from Pymoler import Pymoler
            pm = Pymoler()
            model = pm.addPdb(m, '1')
            pm.colorRes('1', resAcc[:, 0])
            pm.show()

            print "\nResult for first 10 atoms/residues: "
            print '\nAccessability (A^2):\n', atomAcc[:10]
            print '\nResidue accessability (A^2)'
            print '[total, backbone, sidechain]:\n', resAcc[:10]
            print '\nExposed residue mask:\n', resMask[:10]
            print '\nTotal atom    accessability (A^2): %.2f' % sum(atomAcc)
            print '      residue accessability (A^2): %.2f' % sum(resAcc)[0]

        self.assertAlmostEqual(N0.sum(resAcc[:, 0]), 2814.6903, 7)
Beispiel #3
0
class Test(BT.BiskitTest):
    """Test case"""
    def test_surfaceRacerTools(self):
        """surfaceRacerTools test"""
        from Biskit import PDBModel
        import Biskit.tools as T

        ## load a structure
        self.m = PDBModel(T.testRoot() + '/lig/1A19.pdb')
        self.m = self.m.compress(self.m.maskProtein())
        self.m = self.m.compress(self.m.maskHeavy())

        ## some fake surface data
        surf = N0.ones(self.m.lenAtoms()) * 10.0

        relExp = relExposure(self.m, surf)

        ##         if self.local:
        ##             globals().update( locals() )

        self.assertAlmostEqual(N0.sum(relExp), 44276.86085222386, 8)
Beispiel #4
0
class Test(BT.BiskitTest):
    """Test case"""

    def test_surfaceRacerTools(self):
        """surfaceRacerTools test"""
        from Biskit import PDBModel
        import Biskit.tools as T
        
        ## load a structure
        self.m = PDBModel( T.testRoot()+'/lig/1A19.pdb' )
        self.m = self.m.compress( self.m.maskProtein() )
        self.m = self.m.compress( self.m.maskHeavy() )
        
        ## some fake surface data
        surf = Numeric.ones( self.m.lenAtoms()) * 10.0

        relExp = relExposure( self.m, surf )
        
##         if self.local:
##             globals().update( locals() )
            
        self.assertEqual( Numeric.sum(relExp), 44276.860852223857 )