本文整理汇总了Python中Biskit.PDBModel.compress方法的典型用法代码示例。如果您正苦于以下问题:Python PDBModel.compress方法的具体用法?Python PDBModel.compress怎么用?Python PDBModel.compress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Biskit.PDBModel
的用法示例。
在下文中一共展示了PDBModel.compress方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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 )
示例2: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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}
示例3: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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
示例4: test_model
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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()
示例5: test_SurfaceRacer
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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 )
示例6: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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.'
示例7: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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 )
示例8: test_Whatif
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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 )
示例9: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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 )
示例10: OldTest
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
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()
示例11: LongTest
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
class LongTest( BT.BiskitTest ):
TAGS = [ BT.EXE, BT.LONG ]
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_conservation(self):
"""PDBDope.addConservation (Hmmer) test"""
if self.local: print "Adding conservation data...",
self.d.addConservation()
if self.local: print 'Done.'
## 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('cons_ent'), 0.0, 100.0) )
pm.show()
def test_delphi(self):
"""PDBDope.addDelphi test"""
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 )
示例12: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
class Test(BT.BiskitTest):
"""Test class"""
TAGS = [ BT.EXE ]
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] )
示例13: Test
# 需要导入模块: from Biskit import PDBModel [as 别名]
# 或者: from Biskit.PDBModel import compress [as 别名]
class Test(BT.BiskitTest):
"""Hmmer test"""
TAGS = [ BT.EXE ]
M = None
def prepare( self ):
from Biskit import PDBModel
import Biskit.tools as T
if not self.M:
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 "Done"
def test_HmmSearch( self ):
"""HmmSearch test"""
self.searcher = HmmerSearch( self.M,
verbose=self.local,
log=self.log )
self.matches, self.hits = self.searcher.run()
def test_HmmProfile( self ):
"""HmmerProfile test"""
profile = HmmerProfile( 'FH2', verbose=self.local, log=self.log)
self.profileDic = profile.run()
def test_HmmerFasta( self ):
"""Hmmer test (search from fasta)"""
h = Hmmer(hmmdb=settings.hmm_db)
h.checkHmmdbIndex()
self.searchMatches, self.searchHits = h.searchHmmdb(
T.testRoot()+'/Mod/project/target.fasta' )
self.assertTrue( len( self.searchHits ) > 3 )
def test_HmmerModel( self):
"""Hmmer test (search from model)"""
## initiate and check database status
self.hmmer = Hmmer( hmmdb=settings.hmm_db, verbose=self.local,
log=self.log )
self.hmmer.checkHmmdbIndex()
## scoring methods to use
method = [ 'emmScore', 'ent', 'maxAll', 'absSum', 'maxAllScale' ]
## search
searchMatches, searchHits = self.hmmer.searchHmmdb( self.M )
hmmNames = self.hmmer.selectMatches( searchMatches, searchHits )
## hmmNames = {'Barstar': [[1, 89]]}
self.cons = []
self.result = None
for name in hmmNames.keys():
## retrieve hmm model
hmmDic = self.hmmer.getHmmProfile( name )
## align sequence with model
fastaSeq, hmmSeq, repete, hmmGap = \
self.hmmer.align( self.M, hmmNames[ name ] )
## cast hmm model
hmmDic_cast = \
self.hmmer.castHmmDic( hmmDic, repete, hmmGap, method[0] )
## Hmmer profile match scores for sequence
self.cons = self.hmmer.matchScore( fastaSeq, hmmSeq,
hmmDic_cast, method[0] )
## 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]