本文整理汇总了Python中Biskit.Executor类的典型用法代码示例。如果您正苦于以下问题:Python Executor类的具体用法?Python Executor怎么用?Python Executor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Executor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish
def finish( self ):
"""
Overrides Executor method
"""
Executor.finish( self )
self.result = self.parse_result()
## if probe radius other than 1.4 A the relative surface exposure
## cannot be calculated, but allow this check to be a little flexible
## if we ate forced to slightly increase the radii to excape round off
## SurfaceRacer errors
try:
if round(self.probe, 1) == 1.4 and self.vdw_set == 1:
self.__relExposure('MS')
self.__relExposure('AS')
else:
EHandler.warning("No relative accessabilities calculated "+\
"when using a prob radius other than 1.4 A"+\
" or not using the Richards vdw radii set.")
except KeyError, what:
EHandler.warning("Missing standard accessibilities for some "+\
"atoms. No relative accesibilities calculated.")
if 'relMS' in self.result: del self.result['relMS']
if 'relAS' in self.result: del self.result['relAS']
示例2: __init__
def __init__(self, model, **kw ):
"""
@param model: reference PDBModel
@type model: PDBModel
@param kw: additional key=value parameters for Executor:
@type kw: key=value pairs
::
debug - 0|1, keep all temporary files (default: 0)
verbose - 0|1, print progress messages to log (log != STDOUT)
node - str, host for calculation (None->local) NOT TESTED
(default: None)
nice - int, nice level (default: 0)
log - Biskit.LogFile, program log (None->STOUT) (default: None)
"""
self.temp_pdb = tempfile.mktemp('_foldx_.pdb')
self.temp_command = tempfile.mktemp('_foldx_.command')
self.temp_option = tempfile.mktemp('_foldx_.option')
self.temp_result = tempfile.mktemp('_foldx_.result')
self.temp_runlog = tempfile.mktemp('_foldx_.log')
self.temp_errlog = tempfile.mktemp('_foldx_.err')
Executor.__init__( self, 'fold_X', args='-manual %s %s %s'\
%(self.temp_pdb, self.temp_option,
self.temp_command), **kw )
self.model = model.clone()
## fold-X-allowed atoms for each res in standard order
self.aminoAcidDict = molUtils.aaAtoms
for k in self.aminoAcidDict:
if 'HN' not in self.aminoAcidDict[ k ]:
self.aminoAcidDict[ k ] += ['HN']
示例3: __init__
def __init__( self, model, **kw ):
"""
@param model: model analyze
@type model: PDBModel
@param kw: additional key=value parameters for Executor:
@type kw: key=value pairs
::
debug - 0|1, keep all temporary files (default: 0)
verbose - 0|1, print progress messages to log (log != STDOUT)
node - str, host for calculation (None->local) NOT TESTED
(default: None)
nice - int, nice level (default: 0)
log - Biskit.LogFile, program log (None->STOUT) (default: None)
"""
self.model = model
# self.model = model.clone( deepcopy=1 )
## temporary pdb-file
self.f_pdb = tempfile.mktemp( '_dssp.pdb')
self.f_out = tempfile.mktemp( '_dssp.out')
Executor.__init__( self, 'dsspcmbi',
args='-na %s'%self.f_pdb,
catch_err=1, **kw )
示例4: __init__
def __init__(self, full=0, mode='w', verbose=1, **kw ):
"""
@param mode: open file with this mode, w=override, a=append
@type mode: str
@param full: dispaly pymol structures in fill screen mode::
0 - normal mode
1 - full screen mode
2 - full screen and no menues
@type full: 0|1|2
"""
self.verbose = verbose
# name of .pml file
self.foutName = tempfile.mktemp() + '.pml'
# open for <appending|writing|reading>
self.fgenerate = open(self.foutName, mode)
# will contain PymolModels or lists of PymolModels
self.dic = {}
## add startup commands
self.initPymol()
## set arguments for display options (normal, full, all)
arg = '-q %s'%self.foutName
if full == 1:
arg = '-qe %s'%self.foutName
if full == 2:
arg = '-qei %s'%self.foutName
Executor.__init__( self, 'pymol', args=arg,
catch_err=1, catch_out=1, **kw )
示例5: prepare
def prepare( self ):
"""
Overrides Executor method.
"""
Executor.prepare( self )
self.__prepareFolder()
## if setGrid hasn't been called yet, create automatic grid
if not self.gsize:
self.setGrid()
if self.protonate:
reducer = Reduce( self.model, verbose=self.verbose,
autocap=self.autocap,
tempdir=self.tempdir, cwd=self.cwd,
log=self.log, debug=self.debug )
if self.verbose:
self.log.add('adding hydrogen atoms to input structure\n')
self.delphimodel = reducer.run()
else:
self.delphimodel = self.model.clone()
self.delphimodel.xplor2amber()
if not os.path.exists( self.f_charges ):
self.__prepareCharges( self.f_charges )
self.delphimodel.writePdb( self.f_pdb )
示例6: __init__
def __init__( self, model, **kw ):
"""
@param model: PDBModel
@type model:
@param kw: additional key=value parameters for Executor:
@type kw: key=value pairs
::
debug - 0|1, keep all temporary files (default: 0)
verbose - 0|1, print progress messages to log (log != STDOUT)
node - str, host for calculation (None->local) NOT TESTED
(default: None)
nice - int, nice level (default: 0)
log - Biskit.LogFile, program log (None->STOUT) (default: None)
"""
self.f_xyzrn = tempfile.mktemp('_msms.xyzrn')
## output file from MSMS, will add .area exiension to file
self.f_surf = tempfile.mktemp( )
arg =' -surface ases -if %s -af %s'%( self.f_xyzrn, self.f_surf )
Executor.__init__( self, 'msms', args=arg, **kw )
self.model = model.clone()
示例7: parm2pdb
def parm2pdb( self, f_parm, f_crd, f_out, aatm=0 ):
"""
Use ambpdb to build PDB from parm and crd.
@param f_parm: existing parm file
@type f_parm: str
@param f_crd: existing crd file
@type f_crd: str
@param f_out: target file name for PDB
@type f_out: str
@return: f_out, target file name for PDB
@rtype: str
@raise AmberError: if ambpdb fail
"""
## cmd = '%s -p %s -aatm < %s > %s' % \
args = '-p %s %s' % (f_parm, '-aatm'*aatm )
x = Executor('ambpdb', args, f_in=f_crd, f_out=f_out,
log=self.log, verbose=1, catch_err=1)
output,error,status = x.run()
if not os.path.exists( f_out ):
raise AmberError, 'ambpdb failed.'
return f_out
示例8: __init__
def __init__( self, model, refmodel, **kw ):
"""
@param model: structure to be aligned to reference
@type model: PDBModel
@param refmodel: reference structure
@type refmodel: PDBModel
@param kw: additional key=value parameters for Executor:
@type kw: key=value pairs
::
debug - 0|1, keep all temporary files (default: 0)
verbose - 0|1, print progress messages to log (log != STDOUT)
node - str, host for calculation (None->local) NOT TESTED
(default: None)
nice - int, nice level (default: 0)
log - Biskit.LogFile, program log (None->STOUT) (default: None)
"""
self.f_pdbin = tempfile.mktemp( '_tmalign_in.pdb' )
self.f_pdbref= tempfile.mktemp( '_tmalign_ref.pdb' )
self.f_matrix= tempfile.mktemp( '_tmalign_matrix.out' )
Executor.__init__( self, 'tmalign',
args= '%s %s -m %s' % (self.f_pdbin, self.f_pdbref, self.f_matrix),
**kw )
self.refmodel = refmodel
self.model = model
示例9: cleanup
def cleanup( self ):
Executor.cleanup( self )
if not self.debug:
T.tryRemove( self.prosaPdbFile )
T.tryRemove( self.f_in)
T.tryRemove( self.prosaOutput + '.ana' )
示例10: __init__
def __init__( self, ref_model, models, **kw ):
"""
@param ref_model: reference
@type ref_model: PDBModel
@param models: structures to be compared with reference
@type models: [PDBModel]
@param kw: additional key=value parameters for Executor:
@type kw: key=value pairs
::
debug - 0|1, keep all temporary files (default: 0)
verbose - 0|1, print progress messages to log (log != STDOUT)
node - str, host for calculation (None->local) NOT TESTED
(default: None)
nice - int, nice level (default: 0)
log - Biskit.LogFile, program log (None->STOUT) (default: None)
"""
Executor.__init__( self, 'icmbrowser', template=self.inp_head, **kw )
self.f_ref = tempfile.mktemp('_icmcad_ref.pdb')
self.f_pdb = tempfile.mktemp('_icmcad_%i.pdb')
self.ref_model = ref_model
self.models = models
if not isinstance( self.models, list ):
self.models = [ self.models ]
示例11: cleanup
def cleanup( self ):
"""
Tidy up the mess you created.
"""
Executor.cleanup( self )
if not self.debug:
T.tryRemove( self.f_pdb )
示例12: cleanup
def cleanup( self ):
"""
Remove temp files.
"""
Executor.cleanup( self )
if not self.debug:
T.tryRemove( self.f_xyzrn )
T.tryRemove( self.f_surf + '.area' )
示例13: cleanup
def cleanup(self):
"""
remove temporary files
"""
Executor.cleanup( self )
if not self.debug:
T.tryRemove( self.inp1 )
T.tryRemove( self.inp2 )
示例14: cleanup
def cleanup( self ):
"""
Tidy up the mess you created.
Does nothing. No temporary files are created.
"""
Executor.cleanup( self )
if not self.debug:
T.tryRemove( self.f_pdbin )
T.tryRemove( self.f_out)
示例15: cleanup
def cleanup( self ):
"""
Tidy up the mess we created. Called after program execution.
"""
Executor.cleanup( self )
if not self.debug:
## remove all files created by intervor
for f in glob.glob( self.f_prefix + '*' ):
T.tryRemove( f )