• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pymol.finish_launching函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

    def __init__(self,debug=0):
        #look for PYMOL_PATH
        import os
        import sys
        if sys.platform == "win32" :
            os.environ['PYMOL_PATH'] = "C:\Python26\lib\site-packages\pymol"
        import pymol
        print("ok launch pymol")
        pymol.pymol_argv[1] = '-qcGi'
        import __main__
#        __main__.pymol = pymol
        print(dir(__main__))
        print(__name__)
        pymol.finish_launching()
        import sys
        print("done")
        self.cmd = pymol.cmd
        self.Mols = {}
        self.pymol = pymol
        self.debug = debug
        self.viewmat = None#numpy.array(self.cmd.get_view(quiet=1))
        self.fragments = {'formamide':(3,1),
                        'acetylene':(2,0),
                        'formamide':(3,1),
                        'cyclobutane':(4,0),
                        'cyclopentane':(5,0),
                        'cyclopentadiene':(5,0),
                        'cyclohexane':(7,0),
                        'cycloheptane':(8,0),
                        'methane':(1,0),
                        'benzene':(6,0),
                        'sulfone':(6,0)
                        }
开发者ID:mvysotskiy,项目名称:ePMV,代码行数:33,代码来源:pymolAdaptor.py


示例2: main

def main():
    parser=argparse.ArgumentParser()
    parser.add_argument('-p', action='store', required=True, dest='pdbfile',
                    help='pathfile is a textfile of name of pdb')
    parser.add_argument('-l', action='store', required=True, dest='loop',
                    help='loop is an int number')
    inputs=parser.parse_args()
    pdbfile=inputs.pdbfile
    loop=int(inputs.loop)
    print "loop is %s "% loop
    dirname=os.getcwd()+'/interface_analyzer/pdbdata/'+pdbfile
    pdbfileselect=pdbfile.split('.')
    savefile=os.getcwd()+'/interface_analyzer/pdbdata/'+pdbfileselect[0]+'_antigen.pdb'
    print "remove antibody of complex,so can caculate the value of antigen sasa "
    pymol.finish_launching()
    if loop!=0:
        pymol.cmd.reinitialize()
    cmd.load(dirname)
    cmd.remove('hetatm')
    cmd.select('target1',pdbfileselect[0])
    cmd.save(dirname,(('target1')))
    cmd.delete('target1')
    cmd.remove('solvent')
    cmd.remove('hydrogens')
    cmd.remove('chain L+H')
    cmd.select('target',pdbfileselect[0])
    cmd.save(savefile,(('target')))
    cmd.delete(all)
    cmd.sync()
    cmd.quit()
    print "remove the antibody of complex have done"
开发者ID:youbingchenyoubing,项目名称:asa,代码行数:31,代码来源:removeantibody.py


示例3: open_gui

    def open_gui(self):
        """Open the PyMOL GUI."""

        # Use the PyMOL python modules.
        if self.exec_mode == 'module':
            # Open the GUI.
            pymol.finish_launching()
            self.open = True

        # Otherwise execute PyMOL on the command line.
        if self.exec_mode == 'external':
            # Test that the PyMOL binary exists.
            test_binary('pymol')

            # Python 2.3 and earlier.
            if Popen == None:
                raise RelaxError("The subprocess module is not available in this version of Python.")

            # Open PyMOL as a pipe.
            self.pymol = Popen(['pymol', '-qpK'], stdin=PIPE).stdin

        # Execute the command history.
        if len(self.command_history) > 0:
            self.exec_cmd(self.command_history, store_command=0)
            return

        # Test if the PDB file has been loaded.
        if hasattr(cdp, 'structure'):
            self.open_pdb()
开发者ID:belisario21,项目名称:relax_trunk,代码行数:29,代码来源:pymol_control.py


示例4: main

def main():
    parser=argparse.ArgumentParser()
    
    parser.add_argument('-f', action='store', required=True, dest='pdbfile',
                    help='PDB file of protein-antibody complex')
  
    parser.add_argument('-d', action='store', required=True, dest='distance',
                    help='distance is more than 0')
    parser.add_argument('-c1', action='store', required=True, dest='chain_a',
                    help='distance is more than 0')
    parser.add_argument('-c2', action='store', required=True, dest='chain_b',
                    help='distance is more than 0')
    inputs=parser.parse_args()
    from os import path,access,R_OK
    chain_a='chain '+inputs.chain_a
    chain_b='chain '+inputs.chain_b
    pdbfile=os.getcwd()+'/interface_analyzer/pdbdata/'+inputs.pdbfile
    distance=inputs.distance
    if path.exists(pdbfile) and path.isfile(pdbfile) and access(pdbfile,R_OK):
        pass
    else:
        print "Your PDB file does not exist. Please check the path of your PDB file."
	sys.exit(1)
    print "Extracting out the residues with cut off with 4"
    pymol.finish_launching()
    pymol.cmd.load(pdbfile)
    pymol.cmd.remove('hydrogens')
    pymol.cmd.remove('solvent')
    pairwise_dist(inputs.pdbfile,chain_a,chain_b,float(distance),'P')
    pymol.cmd.delete(all)
    pymol.cmd.quit()
开发者ID:youbingchenyoubing,项目名称:asa_map,代码行数:31,代码来源:pairwisedistances.py


示例5: cartoon

def cartoon( filename, name ):
    pymol.finish_launching()
    pymol.cmd.read_pdbstr( *name_check( filename, name ) )

    pymol.cmd.hide( "everything" )
    pymol.cmd.show( "cartoon" )
    pymol.cmd.spectrum()
开发者ID:nishn,项目名称:pymol-script,代码行数:7,代码来源:pym.py


示例6: calc_rmsd_pymol

def calc_rmsd_pymol(pdb1, pdb2, method):
    """Calculate rmsd using PyMOL. Two methods are available: align and fit

    See:

    -  Align: http://www.pymolwiki.org/index.php/Align
    -  Fit:   http://www.pymolwiki.org/index.php/Fit

    Align can return a list with 7 items:

    RMSD after refinement
    Number of aligned atoms after refinement
    Number of refinement cycles
    RMSD before refinement
    Number of aligned atoms before refinement
    Raw alignment score
    Number of residues aligned

    in this version of function, the function returns `RMSD before refinement`.

    Install on OSX: ``brew install homebrew/science/pymol`` and set ``PYTHONPATH`` to
    your PyMOL packages, .e.g ::

      PYTHONPATH=$PYTHONPATH:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

    If problem::

      Match-Error: unable to open matrix file '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/data/pymol/matrices/BLOSUM62'.

    then define ``PYMOL_PATH`` in your .bashrc, e.g.::

       export PYMOL_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymol/
     """

    try:
        import __main__
        __main__.pymol_argv = ['pymol', '-qc']
        import pymol  # import cmd, finish_launching
        pymol.finish_launching()
    except ImportError:
        print('calc_rmsd_pymol: you need to have installed PyMOL')
        sys.exit(0) # no error

    pymol.cmd.reinitialize()
    pymol.cmd.delete('all')
    pymol.cmd.load(pdb1, 's1')
    pymol.cmd.load(pdb2, 's2')
    if method == 'align':
        # experiments with align <https://pymolwiki.org/index.php/Align>
        # quiet = 0/1: suppress output {default: 0 in command mode, 1 in API}
        return  (pymol.cmd.align('s1', 's2',quiet=1, object='aln')[3],0) #, pymol.cmd.align('s1','s2')[4])
        #raw_aln = pymol.cmd.get_raw_alignment('aln')
        #print raw_aln
        #for idx1, idx2 in raw_aln:
        #    print '%s`%d -> %s`%d' % tuple(idx1 + idx2)
        #pymol.cmd.save('aln.aln', 'aln')

    if method == 'fit':
        return (pymol.cmd.fit('s1', 's2'), 'fit')
开发者ID:mmagnus,项目名称:rna-pdb-tools,代码行数:59,代码来源:rna_calc_rmsd.py


示例7: main

def main(sys_argv=sys.argv):
    #pdbCode = '1XFH'.lower()
    pdbCode = '2NWL'.lower()
    pymol.finish_launching()
    cmd.fetch(pdbCode)
    xml = get_pdbtm_xml(pdbCode)
    chains_dict = get_pdbtm_annotation(pdbCode, xml)
    highlight_molecule(chains_dict, pdbCode.lower())
开发者ID:JonasR,项目名称:pymol-highlight-transmem,代码行数:8,代码来源:hlmem.py


示例8: export_png

    def export_png(self, rel_path, pdb_id, infos):
        """Uses pymol to export a png representing a PDB structure. The image
        displays the chains that contains the domains (cartoon) and the
        interacting residues (surface). THE CHOICE HAS BEEN MADE TO NOT
        HIGHLIGHT THE DOMAINS. """

        # extracts informations for the chain and the residues
        domain_1 = self._extract_info(infos, '1')
        domain_2 = self._extract_info(infos, '2')

        # gets informations
        chain_1 = domain_1['chain']
        chain_2 = domain_2['chain']
        residues_1 = '+'.join(domain_1['ids'])
        residues_2 = '+'.join(domain_2['ids'])

        # build the select command for pymol
        chain_1_obj = 'chain '+chain_1+' and (not resi '+residues_1+')'
        chain_2_obj = 'chain '+chain_2+' and (not resi '+residues_2+')'
        residues_1_obj = 'chain '+chain_1+' and resi '+residues_1
        residues_2_obj = 'chain '+chain_1+' and resi '+residues_2

        # run pymol without its gui
        pymol.pymol_argv = ['pymol','-qc']
        pymol.finish_launching()

        # the file
        pymol.cmd.load(rel_path, pdb_id)

        pymol.cmd.disable('all')
        pymol.cmd.enable(pdb_id)
        # background
        pymol.cmd.bg_color(color='white')
        pymol.cmd.hide('all')
        pymol.cmd.deselect()
        # objects
        pymol.cmd.create('chain_1', chain_1_obj)
        pymol.cmd.create('chain_2', chain_2_obj)
        pymol.cmd.create('res_1', residues_1_obj)
        pymol.cmd.create('res_2', residues_2_obj)
        # colors
        pymol.cmd.color('lightblue', 'chain_1')
        pymol.cmd.color('nitrogen', 'res_1')
        pymol.cmd.color('yelloworange', 'chain_2')
        pymol.cmd.color('red', 'res_2')
        # representation type
        pymol.cmd.show('cartoon', 'chain_1')
        pymol.cmd.show('cartoon', 'chain_2')
        pymol.cmd.show('surface', 'res_1')
        pymol.cmd.show('surface', 'res_2')
        # zoom
        pymol.cmd.create('final', 'chain_1 or chain_2 or res_1 or res_2')
        pymol.cmd.zoom('final')
        # export
        pymol.cmd.png(re.sub('.ent$', '.png', rel_path))

        # quit
        pymol.cmd.quit()
开发者ID:hibarikyouya,项目名称:itpp,代码行数:58,代码来源:representation.py


示例9: loadPymol

def loadPymol():
  sys.path.append('/share/apps/pymol/1.6.0.0/lib/python')
  import __main__
  __main__.pymol_argv = [ 'pymol', '-c'] # Quiet and no GUI
  import pymol
  pymol.finish_launching()
  cmd = pymol.cmd
  util = pymol.util
  return cmd, util
开发者ID:comacke,项目名称:ResearchPackages,代码行数:9,代码来源:PymolUtils.py


示例10: launchPyMol

 def launchPyMol(self, pdbfile):
     """Open pdb in PyMOL"""
     import pymol
     # Call the function below before using any PyMOL modules.
     pymol.finish_launching()
     from pymol import cmd
     cmd.load(pdbfile)
     cmd.show_as('sticks')
     return
开发者ID:shambo001,项目名称:peat,代码行数:9,代码来源:Actions.py


示例11: renamechain

def renamechain(pdbfile,chainbefore,chainafter):
    dirname=os.getcwd()+'/interface_analyzer/'+pdbfile
    pdbfileselect=pdbfile.split('.')
    print "rename the chain name of pdb i order to make antibody'chain is H ro L"
    pymol.finish_launching()
    pymol.cmd.load(dirname)
    pymol.cmd.alter((chainbefore),chain=chainafter)
    pymol.cmd.save(dirname,((pdbfileselect[0]))) 
    pymol.cmd.delete('all')
    pymol.cmd.quit()
    print "rename name of chain has been done"
开发者ID:youbingchenyoubing,项目名称:asa_map,代码行数:11,代码来源:removeantibody.py


示例12: startPyMOL

def startPyMOL(pdb):
    '''starts PyMOL for us.  Only for testing.  PyMOL should already be opened
    by InteractiveROSETTA'''
    import __main__
    __main__.pymol_argv = ["pymol", "-qhxi"]
    import pymol
    pymol.finish_launching()
    pymol.cmd.load(pdb)
    pymol.cmd.show_as('cartoon')
    pymol.cmd.color('purple')
    return pymol
开发者ID:schenc3,项目名称:InteractiveROSETTA,代码行数:11,代码来源:dagview.py


示例13: setup_pymol

def setup_pymol():
    """Sets up PyMOL for making animations."""
    pymol.finish_launching()  # Prevent threading errors
    # Configure global settings
    cmd.set('scene_buttons', 1)
    cmd.set('matrix_mode', 1)
    cmd.set('movie_panel', 1)
    # Configure quality settings
    cmd.mset("1 x500")
    cmd.set('ray_trace_frames', 1)
    cmd.viewport(800, 800)
开发者ID:ssalentin,项目名称:pymol-animations,代码行数:11,代码来源:02-scenes.py


示例14: removesolvent

def removesolvent(pdbfile):
    dirname=os.getcwd()+'/interface_analyzer/pdbdata/'+pdbfile
    pdbfileselect=pdbfile.split('.')
    print "remove solvent for pdb"
    pymol.finish_launching()
    pymol.cmd.load(dirname)
    pymol.cmd.remove('solvent')
    pymol.cmd.select('target',pdbfileselect[0])
    pymol.cmd.save(dirname,(('target')))
    pymol.cmd.delete('all')
    pymol.cmd.quit()
    print "remove solvent done"
开发者ID:youbingchenyoubing,项目名称:asa_map,代码行数:12,代码来源:removesolvent.py


示例15: InitPymol

def InitPymol():
    '''
    setup pymol so that it works right and plays nice with this program
    '''
    import pymol
    pymol.pymol_argv = ['pymol', '-q'] #c=command line (no gui), q=quiet (no messages)
    pymol.finish_launching()
    from pymol import cmd
    for switchon in ['retain_order','pdb_no_end_record','cartoon_cylindrical_helices']: #'pdb_retain_ids',
        cmd.set(switchon, 1)
    for switchoff in ['pdb_use_ter_records']:
        cmd.set(switchoff, 0)
    cmd.show_as('cartoon')
开发者ID:telamonian,项目名称:targeted-molecular-dynamics-prep,代码行数:13,代码来源:dimerize.py


示例16: __init__

    def __init__(self, load_coords_pymol):
#        mp.Process.__init__(self)
#        self.conn = conn
        
#        import pymol
        print "finishing launching pymol"
        pymol.finish_launching() #  must do this before anything else
        print "done launching pymol"
        
        self.load_coords_pymol = load_coords_pymol
        
        self.oname1 = "molecule1" #  name of the object
        self.oname2 = "molecule2" #  name of the object
开发者ID:js850,项目名称:PyGMIN,代码行数:13,代码来源:pymol_viewer.py


示例17: removechainHL

def removechainHL(pdbfile):
    dirname=os.getcwd()+'/interface_analyzer/'+pdbfile
    pdbfileselect=pdbfile.split('.')
    savefile=os.getcwd()+'/interface_analyzer/'+pdbfileselect[0]+'_antigen.pdb'
    print "remove antibody of complex,so can caculate the value of antigen sasa "
    pymol.finish_launching()
    pymol.cmd.load(dirname)
    pymol.cmd.remove('hydrogens')
    pymol.cmd.remove('solvent')
    pymol.cmd.remove('chain L+H')
    pymol.cmd.select('target',pdbfileselect[0])
    pymol.cmd.save(savefile,(('target')))
    pymol.cmd.delete('all')
    pymol.cmd.quit()
    print "remove the antibody of complex have done"
    return savefile
开发者ID:youbingchenyoubing,项目名称:asa_map,代码行数:16,代码来源:removeantibody.py


示例18: auto_pymol

def auto_pymol(pdb_list):
  import time
  import pymol
  import sys
  
  pymol_argv = ['pymol', '-qc']
  
  OutDir = "./png/"
  
  num_lines = len(pdb_list)
  print "No. of pdbs: ",num_lines
  
  for i in xrange(num_lines):
    pdb_name = pdb_list[i].split("/")[-1].split(".")[0]
    print "pdb name which will be oriented: ", pdb_name
  
  ## opening pymol 
    pymol.finish_launching()
    pymol.cmd.load(pdb_list[i])
    pymol.cmd.enable(pdb_list[i])
    
    ##Arrange conformation 
    pymol.cmd.hide('lines', pdb_name)      # lines
    pymol.cmd.show('cartoon', pdb_name)    # cartoon
    #pymol.cmd.hide('lines', pdb_name[0])      # lines
    #pymol.cmd.show('cartoon', pdb_name[0])    # cartoon
    
    pymol.cmd.util.chainbow(pdb_name)       # rainbow
    #pymol.cmd.util.cbac(pdb[0])           
    #pymol.cmd.util.cbc('all')           # each chain coloerd
    
    pymol.cmd.orient(pdb_name)
    #pymol.cmd.orient(pdb_name[0])
    #pymol.cmd.set("ray_opaque_background","off")
    #pymol.cmd.bg_color(color="white")
    #pymol.cmd.do("run ")
    
    #pymol.cmd.ray(0,0)
    
    ##Make png fig
    #time.sleep(1)
    #out_png = OutDir+pdb_name+".png"
    #pymol.cmd.png(out_png)
    #pymol.cmd.do('png ' + out_png)
    
    ## End pymol
    pymol.cmd.refresh()
开发者ID:physicshinzui,项目名称:Python_PCA,代码行数:47,代码来源:04_pick_conf.py


示例19: main

def main(argv=sys.argv):
    logging.getLogger().setLevel(logging.INFO)
    
    args = _arguments()
    score_file_path = os.path.abspath(args.score_file)
    model_dir = os.path.dirname(score_file_path)
    target_dir, base_dir_name = os.path.split(os.path.abspath(os.path.join(model_dir, '..')))
    target_dir_name = os.path.basename(target_dir)

    field_dict_list = _read_scorefile(score_file_path)
    
    # plot gdt vs. energy
    field_dict_list.sort(key=lambda d: float(d["score"])) # smaller score better
    energy_gdt_list = [(float(d["score"]), float(d["gdtmm_full"])) for d in field_dict_list]
    energy_list, gdt_list = zip(*energy_gdt_list)
    plt.plot(gdt_list[:5], energy_list[:5], 'ro') # 5 best in red
    plt.plot(gdt_list[5:], energy_list[5:], 'ko') # else in black
    #plt.title("title")
    plt.xlabel("GDT_mm")
    plt.ylabel("energy")
    plt.axis(xmin=0, xmax=1)         
    
    fname = os.path.join(os.getcwd(), target_dir_name+'_'+base_dir_name+'_energy_gdt.png')
    plt.savefig(fname)
    #plt.show()
    
    # args for PymolLauncher
    gdts, scores, pdbs = gdt_list, energy_list, [d["description"] for d in field_dict_list]

    """ Code that links the data to the PymolLauncher Object
        Uncomment this if you have edited this file and are ready 
        to link the PymolLauncher to the scatter plot"""
    pl1 = PymolLauncher(gdts, scores, pdbs)
    pl1.set_native(args.native_pdb)
    pdb_dir = model_dir
    print('pdb_dir: '+pdb_dir)    
    pl1.set_pdb_dir(pdb_dir)
    connect('button_press_event', pl1)
    gca().set_autoscale_on(False)
    
    import pymol
    pymol.finish_launching()
    #from pymol import cmd
    pl1.select_best()
    show()

    print("DONE!")
开发者ID:abika,项目名称:compbio-protein-prediction,代码行数:47,代码来源:create_figures.py


示例20: create_pymol_movie

def create_pymol_movie():
  """create pymol movie
  """
  from glob import glob
  import pymol
  file_list = glob("refinement*.pdb")
  pymol.finish_launching()
  pymol.cmd.bg_color('white')
  for i,fn in enumerate(file_list):
    # pymol.cmd.load(fn,"mov",state=i)
    # pymol.cmd.load('full_asu.pdb',"mov",state=i)
    pymol.cmd.load(fn)
    pymol.cmd.load('full_asu.pdb')
    pymol.cmd.frame(1)
    pymol.cmd.mview('store')
  #
  pymol.cmd.mset("1 -%d"%len(file_list))
开发者ID:youdar,项目名称:work,代码行数:17,代码来源:run_03.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmd.align函数代码示例发布时间:2022-05-25
下一篇:
Python pymogile.Client类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap