本文整理汇总了Python中Map.map_sigma_avg方法的典型用法代码示例。如果您正苦于以下问题:Python Map.map_sigma_avg方法的具体用法?Python Map.map_sigma_avg怎么用?Python Map.map_sigma_avg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.map_sigma_avg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_mod
# 需要导入模块: import Map [as 别名]
# 或者: from Map import map_sigma_avg [as 别名]
def add_mod(gfx,modlist,nameentry,nfv,cpltnfv,varrepsv,isov):
modname=nameentry.get()
varrep=varrepsv.get() #stringvar
if cpltnfv.get() == u'':
MB.showwarning('Info','Select a file')
return
if modname == '' :
MB.showwarning('Info','Name entry empty, fill in the blank')
return
for model in gfx.mod:
if model.un == modname :
MB.showwarning('Info','Name already defined, chose another one')
return
if varrep=='':
MB.showwarning('Info','Select a model type')
return
gfx.itf.root.configure(cursor='watch')
gfx.itf.status.set('Model loading ... please wait')
modo=Mod()
modo.id=set_mod_id(gfx)
modo.ofn = fn = cpltnfv.get()
if varrep == 'Backbone' or varrep =='All Atoms' or varrep =='C alpha':#PDB CASE
rfn =gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_R.pdb'
bfn =gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_B.pdb'
cafn =gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_CA.pdb'
if path.exists(rfn):
i=1
while path.exists(gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_R_%d.pdb'%i):
i+=1
rfn = gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_R_%d.pdb'%i
if path.exists(bfn):
i=1
while path.exists(gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_B_%d.pdb'%i):
i+=1
bfn = gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_B_%d.pdb'%i
if path.exists(cafn):
i=1
while path.exists(gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_CA_%d.pdb'%i):
i+=1
cafn = gfx.tmpdir + '/' + extract_file_from_path(fn)[:-4] + '_CA_%d.pdb'%i
chdir(gfx.tmpdir)
system(gfx.vedabin + '/refer.exe <<ENDOF\n %s %s \nENDOF'%(fn,rfn))
if isca(modo.ofn) and (varrep == 'Backbone' or varrep =='All Atoms'):
varrep='C alpha'
varrepsv.set('C alpha')
MB.showwarning('Warning','Your model contains only C-alpha')
if varrep=='C alpha':
if not is_type_consistent(gfx,'CA'):
gfx.itf.status.clear()
gfx.itf.root.configure(cursor='arrow')
return
modo.dfn=cafn
modo.dspmodtype = 'CA'
system("grep ' CA ' %s | grep '^ATOM' > %s"%(rfn,modo.dfn))
elif varrep=='Backbone':
if not is_type_consistent(gfx,'B'):
gfx.itf.status.clear()
gfx.itf.root.configure(cursor='arrow')
return
modo.dfn=bfn
modo.dspmodtype = 'B'
extract_backbone(rfn,modo.dfn)
else :
if not is_type_consistent(gfx,'AA'):
gfx.itf.status.clear()
gfx.itf.root.configure(cursor='arrow')
return
modo.dspmodtype = 'AA'
modo.dfn=rfn
chdir(gfx.workdir)
modo.rottra = get_rottra(gfx,rfn)
modo.fn = modo.rfn = rfn
modo.type='mol'
elif varrep == 'Surface': #MAP CASE
if fn.endswith('.ezd'):
chdir(gfx.tmpdir)
mapfileout = extract_file_from_path(fn)[:-4]+'_R.vtk'
if path.exists(gfx.tmpdir + '/' + mapfileout):
i=1
while path.exists(gfx.tmpdir + '/' + mapfileout[:-6] + '_R_%d.vtk'%i):
i+=1
mapfileout = mapfileout[:-6] + '_R_%d.vtk'%i
e2v_out='info_map_%s'%modname
system(gfx.vedabin+'/e2v.exe >> %s <<ENDOF\n%s \n%f \n%s \nENDOF'%(e2v_out,fn,1,mapfileout)) #1=scale
modo.dfn = modo.rfn = gfx.tmpdir + '/' + mapfileout
modo.sigavg = Map.map_sigma_avg(e2v_out)
(ox,oy,oz)= import_origin(e2v_out)
system("sed -i -e /^ORIGIN/s/.*/'ORIGIN %f %f %f'/ %s"%(ox,oy,oz,modo.dfn))
modo.isov = float(isov)
chdir(gfx.workdir)
modo.fn=fn
modo.type='map'
nfv.set(extract_file_from_path(modo.rfn)) #Reference file name
modo.rep=varrep
modo.un=modname
gfx.mod+=[modo]
refresh_modlist(gfx,modlist)
if gfx.itf.molwizopen:
refresh_modlist(gfx,gfx.itf.modlist2)
if gfx.itf.nmwizopen:
#.........这里部分代码省略.........