当前位置: 首页>>代码示例>>Python>>正文


Python AtomSet.full_name方法代码示例

本文整理汇总了Python中MolKit.molecule.AtomSet.full_name方法的典型用法代码示例。如果您正苦于以下问题:Python AtomSet.full_name方法的具体用法?Python AtomSet.full_name怎么用?Python AtomSet.full_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MolKit.molecule.AtomSet的用法示例。


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

示例1: buildCloseContactAtoms

# 需要导入模块: from MolKit.molecule import AtomSet [as 别名]
# 或者: from MolKit.molecule.AtomSet import full_name [as 别名]
 def buildCloseContactAtoms(self, percentCutoff, ligand, comment="USER AD> "):
     pairDict = self.distanceSelector.select(ligand.allAtoms,
                     self.macro_atoms, percentCutoff=percentCutoff)
     self.pairDict = pairDict
     #reset here
     lig_close_ats = AtomSet()
     macro_close_ats = AtomSet()
     cdict = {}
     for k,v in pairDict.items():
         if len(v):
             cdict[k] = 1
         for at in v:
             if at not in macro_close_ats:
                 cdict[at] = 1
     closeAtoms = AtomSet(cdict.keys())
     lig_close_ats = closeAtoms.get(lambda x: x.top==ligand).uniq()
     #ligClAtStr = lig_close_ats.full_name()
     ligClAtStr = comment + "lig_close_ats: %d\n" %( len(lig_close_ats))
     if len(lig_close_ats):
         ligClAtStr += comment + "%s\n" %( lig_close_ats.full_name())
     macro_close_ats = closeAtoms.get(lambda x: x in self.macro_atoms).uniq()
     macroClAtStr = comment + "macro_close_ats: %d\n" %( len(macro_close_ats))
     if len(macro_close_ats):
         macroClAtStr += comment + "%s\n" %( macro_close_ats.full_name())
     #macroClAtStr = "macro_close_ats: " + len(macro_close_ats)+"\n" +macro_close_ats.full_name()
     rdict = self.results
     rdict['lig_close_atoms'] = lig_close_ats
     rdict['macro_close_atoms'] = macro_close_ats
     if self.verbose: print "macroClAtStr=", macroClAtStr
     if self.verbose: print "ligClAtStr=", ligClAtStr
     if self.verbose: print "returning "+ macroClAtStr + '==' + ligClAtStr
     return  macroClAtStr , ligClAtStr
开发者ID:8848,项目名称:Pymol-script-repo,代码行数:34,代码来源:InteractionDetector.py

示例2: setupUndoAfter

# 需要导入模块: from MolKit.molecule import AtomSet [as 别名]
# 或者: from MolKit.molecule.AtomSet import full_name [as 别名]
 def setupUndoAfter(self, ats, angle,**kw):
     #no atoms, <4 atoms, 
     aSet = AtomSet(self.atomList)
     self.undoMenuString = self.name
     if len(self.atomList)==0:
         undoCmd = 'self.setTorsionGC.atomList=[]; self.setTorsionGC.update()'
     elif len(self.atomList)<4:
         #need to step back here
         undoCmd = 'self.setTorsionGC.atomList=self.setTorsionGC.atomList[:-1]; self.setTorsionGC.update()'
     elif self.origValue==self.oldValue:
         return
     else:
         restoreAngle = self.origValue
         self.undoNow = 1
         undoCmd = 'self.setTorsionGC(\''+ aSet.full_name()+ '\',' + str(restoreAngle) + ', topCommand=0)'
     self.vf.undo.addEntry((undoCmd), (self.name))
开发者ID:MolecularFlipbook,项目名称:FlipbookApp,代码行数:18,代码来源:setangleCommands.py

示例3: AddBondsGUICommand

# 需要导入模块: from MolKit.molecule import AtomSet [as 别名]
# 或者: from MolKit.molecule.AtomSet import full_name [as 别名]
class AddBondsGUICommand(MVCommand, MVAtomICOM):
    """
    The AddBondGUICommand provides an interactive way of creating bonds between two given atoms by picking on them. To use this command you need first to load it into PMV. Then you can find the entry 'addBonds' under the Edit menu. To add bonds  you just need to pick on the 2 atoms you want to bind. If you drag select  a bunch of atoms, the command will buildBondsByDistance between them.This command is undoable.
   \nPackage : Pmv
   \nModule  : bondsCommands
   \nClass   : AddBondsGUICommand
   \nCommand : addBondsGC
   \nSynopsis:\n
        None<-addBondsGC(atoms)\n
    \nRequired Arguments:\n    
        atoms  : atom(s)\n
    """
    
    def __init__(self, func=None):
        MVCommand.__init__(self, func)
        MVAtomICOM.__init__(self)
        self.atomList = AtomSet([])
        self.undoAtList = AtomSet([])
        self.labelStrs = []


    def onRemoveObjectFromViewer(self, obj):
        removeAts = AtomSet([])
        for at in self.atomList:
            if at in obj.allAtoms:
                removeAts.append(at)
        self.atomList = self.atomList - removeAts
        removeAts = AtomSet([])
        for at in self.undoAtList:
            if at in obj.allAtoms:
                removeAts.append(at)
        self.undoAtList = self.undoAtList - removeAts
        self.update()

       
    def onAddCmdToViewer(self):
        if not self.vf.commands.has_key('setICOM'):
            self.vf.loadCommand('interactiveCommands', 'setICOM', 'Pmv',
                                topCommand=0) 
        if not self.vf.commands.has_key('addBonds'):
            self.vf.loadCommand('bondsCommands', 'addBonds', 'Pmv',
                                topCommand=0) 
        if not self.vf.commands.has_key('removeBondsGC'):
            self.vf.loadCommand('bondsCommands', 'removeBondsGC', 'Pmv',
                                topCommand=0) 
        self.masterGeom = Geom('addBondsGeom',shape=(0,0), 
                               pickable=0, protected=True)
        self.masterGeom.isScalable = 0
        self.spheres = Spheres(name='addBondsSpheres', shape=(0,3),
                               inheritMaterial=0,
                               radii=0.2, quality=15,
                               materials = ((1.,1.,0.),), protected=True) 
        if not self.vf.commands.has_key('labelByExpression'):
            self.vf.loadCommand('labelCommands', 
                                ['labelByExpression',], 'Pmv', topCommand=0)
        if self.vf.hasGui:
            miscGeom = self.vf.GUI.miscGeom
            self.vf.GUI.VIEWER.AddObject(self.masterGeom, parent=miscGeom)
            self.vf.GUI.VIEWER.AddObject(self.spheres, parent=self.masterGeom)


    def __call__(self, atoms, **kw):
        """None<-addBondsGC(atoms)
           \natoms  : atom(s)"""
        if type(atoms) is StringType:
            self.nodeLogString = "'"+atoms+"'"
        ats = self.vf.expandNodes(atoms)
        if not len(ats): return 'ERROR'
        return apply(self.doitWrapper, (ats,), kw)


    def doit(self, ats):
        if len(ats)>2:
            if len(self.atomList):
                atSet = ats + self.atomList
            else: atSet = ats
            parent = atSet[0].parent
            parent.buildBondsByDistanceOnAtoms(atSet)
            self.atomList = AtomSet([])
            self.update(True)
        else:
            lenAts = len(self.atomList)
            last = None
            if lenAts:
                last = self.atomList[-1]
                top = self.atomList[0].top
            for at in ats:
                #check for repeats of same atom
                if lenAts and at==last:
                    continue
                #lenAts = len(self.atomList)
                #if lenAts and at==self.atomList[-1]:
                #    continue
                if lenAts and at.top!=self.atomList[-1].top:
                    msg = "intermolecular bond to %s disallowed"%(at.full_name())
                    self.warningMsg(msg)
                self.atomList.append(at)
                self.undoAtList.append(at)
                lenAts = len(self.atomList)
            self.update(True)
#.........这里部分代码省略.........
开发者ID:MolecularFlipbook,项目名称:FlipbookApp,代码行数:103,代码来源:bondsCommands.py


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