apply( self.doitWrapper,(pack, page,),{}) CmdName1 =() if len(CmdName2) != 0: if CmdName2[0] == 'Login Page': page = "Login Page" pack = "Vision" apply( self.doitWrapper,(pack, page,),{}) if CmdName2[0] == 'Archive Page': page = "Archive Page" pack = "Vision" apply( self.doitWrapper,(pack, page,),{}) CmdName2 =() mailingListsCommandGUI = CommandGUI() mailingListsCommandGUI.addMenuCommand('menuRoot', 'Help', 'Mailing List') class orderModelsCommand(Command): """Opens 'http://models.scripps.edu/?source=Pmv' with webbrowser \nPackage : Pmv \nModule : helpCommands \nClass : orderModelsCommand \nCommand : orderModelsCommand \nSynopsis:\n None <--- orderModelsCommand() """ def guiCallback(self, evt=None): webbrowser.open_new('http://models.scripps.edu/?source=Pmv')
file to edit from a file browser. """ from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autogpfCommands import GpfSetGpo,\ GpfMacroInit, GpfLoadDefaults, GpfEditor, GpfInitLigand, GpfWriter,\ SelectCenter, SetUpCovalentMap4, SetBoxParameters, SetOtherOptions,\ Gpf4ParameterFileSelector, Gpf4ParameterFileEditor, GpfMergeNonPolarHs,\ Gpf4SetMapTypes, Gpf4SetAtomTypes, Gpf4MacroInit, Gpf4MacroReader,\ Gpf4MacroChooser, Gpf4InitLigand, Gpf4LigandChooser, Gpf4LigReader,\ Gpf4FlexResChooser, Gpf4FlexResReader, Gpf4Writer, menuText, gridOpts,\ messages, checkHasGpo, box, cenSph, cenCross GpfLoadDefaultsGUI = CommandGUI() GpfLoadDefaultsGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\ menuText['ReadGpfMB']) GpfEditorGUI = CommandGUI() GpfEditorGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'],\ menuText['EditGpfMB']) GpfWriterGUI = CommandGUI() GpfWriterGUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'], \ menuText['WriteGpfMB'], cascadeName=menuText['WriteMB']) SetUpCovalentMap4GUI = CommandGUI() SetUpCovalentMap4GUI.addMenuCommand('AutoTools4Bar', menuText['AutoGpfMB'], \ menuText['SetUpCovalentMap4'], cascadeName = menuText['SetMapTypesMB'])
self, event=None, ): name = self.vf.__class__.__name__ file = self.vf.askFileOpen(types=[('%s scripts' % name, '*.py'), ('Resource file', '*.rc'), ('All Files', '*.*')], title="read %s script file:" % name) if file: self.doitWrapper(file, redraw=0) if hasattr(self.vf, 'recentFiles'): self.vf.recentFiles.add(file, self.name) # Source Command GUI SourceGUI = CommandGUI() SourceGUI.addMenuCommand('menuRoot', 'File', 'Python Scripts', cascadeName='Import', cascadeIndex=1) ## SaveSessionCommand Command GUI #SaveSessionCommandGUI = CommandGUI() #SaveSessionCommandGUI.addMenuCommand('menuRoot', 'File', #'Current Session', cascadeName='Save', index=1) # SetUserPreference Command GUI SetUserPreferenceGUI = CommandGUI() SetUserPreferenceGUI.addMenuCommand('menuRoot', 'File',
#print 'acceptorList=', acceptorList return self.doitWrapper(node, paramDict, reset=self.resetVar.get(), topCommand=0) BuildStrutsBondsGUICommandGuiDescr = { 'widgetType': 'Menu', 'menuBarName': 'menuRoot', 'menuButtonName': 'Struts Bonds', 'menuEntryLabel': 'Set Params + Build', } # 'menuCascadeName':'Build'} BuildStrutsBondsGUICommandGUI = CommandGUI() BuildStrutsBondsGUICommandGUI.addMenuCommand( 'menuRoot', 'Struts Bonds', 'Set Parms + Build', ) # cascadeName = 'Build') class BuildStrutsBonds(MVCommand): """This command finds hydrogen donor atoms within 2.4*percentCutoff angstrom distance of hydrogen acceptor atoms. It builds and returns a dictionary atDict whose keys are hydrogen atoms (or hydrogenbond donor atoms if there are no hydrogens) and whose values are potential h-bond acceptors and distances to these atoms, respectively \nPackage : Pmv \nModule : StrutsCommands \nClass : BuildStrutsBonds \nCommand : buildStruts \nSynopsis:\n atDict <- buildStruts(group, paramDict, **kw)
import Tkinter from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autotorsCommands import rootSph, markSph,\ menuText, AtorsMoleculeChooser, MAXTORS, AdtSetMode,\ AtorsReader, Ators4MoleculeChooser, Ators4Reader, AtorsRefWriter, \ RigidMolecule, RigidMolecule4, AUTOTORSWriter, AUTOTORS4Writer, AUTOTORS4RandomWriter,\ MarkRoot, SelectRoot, SetTorsionNumberGUICommand, SetTorsionNumber, \ AutoRoot, SetRotatableBonds, DefiningRotatableBonds, SetBondRotatableFlag,\ CheckAromatic, StopCheckAromatic, SetCarbonNames, ChangeAromaticCutOff, \ TogglerootSphere, AutoAutoTors, StopAutoTors, AtorsInit, AtorsInitMol, \ ProcessCharges, ProcessBonds, rootSph, markSph, check_autotors_geoms,\ MAXTORS, menuText, warningText, checkMolCharges,\ autoMergeNPHS, set_autoMergeNPHS Ators41MoleculeChooserGUI = CommandGUI() Ators41MoleculeChooserGUI.addMenuCommand( 'AutoTools41Bar', menuText['AutoTorsMB'], menuText['Choose Molecule4'], cascadeName=menuText['Input Molecule']) Ators41ReaderGUI = CommandGUI() Ators41ReaderGUI.addMenuCommand('AutoTools41Bar', menuText['AutoTorsMB'], menuText['Read Molecule4'], cascadeName=menuText['Input Molecule']) AtorsRefWriterGUI = CommandGUI() AtorsRefWriterGUI.addMenuCommand('AutoTools41Bar', menuText['AutoTorsMB'],
req._username = username req._passwd = passwd resp = gamaLoginService.loginUserMyProxy(req) f = open(self.proxy_gama, "w") f.write(resp._loginUserMyProxyReturn) f.close() if self.RememberLogin_var.get(): file = open(self.rc_ad,'w') user = self.cmdForms['default'].descr.entryByName\ ['UserName_Entry']['widget'].get() passwd = self.cmdForms['default'].descr.entryByName\ ['Password_Entry']['widget'].get() file.write("User:%s\nPassword:%s\n"%(user,passwd)) self.login = True WebServicesGUI=CommandGUI() WebServicesGUI.addMenuCommand('AutoToolsBar', menuText['StartMB'], "Web Services...") commandList = [{'name':'ADweb_services','cmd':WebServices(),'gui':WebServicesGUI}] WebServices4GUI=CommandGUI() WebServices4GUI.addMenuCommand('AutoTools4Bar', menuText['StartMB'], "Web Services...") def initModule(viewer): if not hasattr(viewer, 'ADweb_services') and hasattr(viewer, 'GUI')\ and hasattr(viewer.GUI, 'currentADTBar'): viewer.addCommand(WebServices(),'ADweb_services',WebServices4GUI) #else: # for _dict in commandList: # viewer.addCommand(_dict['cmd'],_dict['name'],_dict['gui'])
at0, at1, at2, at3 = self.atomList angle = self.extslider.get() if self.torsionType.get() == '1': self.vf.setTorsion(at0, at1, at2, at3, angle) else: self.vf.setRelativeTorsion(at1, at2, angle) setTorsionGuiDescr = { 'widgetType': 'Menu', 'menuBarName': 'menuRoot', 'menuButtonName': 'Set Torsion Angle', 'menuEntryLabel': 'Show Set Torsion Panel', 'index': 0 } SetTorsionGUI = CommandGUI() SetTorsionGUI.addMenuCommand('menuRoot', 'Edit', 'Set Torsion', cascadeName='Torsion Angles') class TorsionAngle: def __init__(self, atom1, atom2, atom3, atom4): self.molecule = atom1.top self.name_string = atom1.name + "-" + atom2.name + "-" + atom3.name + "-" + atom4.name self.atom1 = atom1 self.atom2 = atom2 self.atom3 = atom3 self.atom4 = atom4 self.mov_atoms = self.molecule.subTree(atom2, atom3,
def setLevel_cb(self, level): col = self.vf.ICmdCaller.levelColors c = (col[level][0]/1.5,col[level][1]/1.5,col[level][2]/1.5) self.LevelOption._menubutton.configure( background = TkColor(c), activebackground = TkColor(col[level])) if level=='Atom': self.vf.setIcomLevel(Atom) elif level=='Residue': self.vf.setIcomLevel(Residue) elif level=='Chain': self.vf.setIcomLevel(Chain) elif level=='Molecule': self.vf.setIcomLevel(Molecule) PCOMGUI = CommandGUI() from moleculeViewer import ICONPATH PCOMGUI.addToolBar('PCOM', icon1 = 'mouse.gif', icon_dir=ICONPATH, balloonhelp = 'Picking COMmands', index = 0) class MVBindCmdToKey(MVCommand): def __init__(self, func=None): MVCommand.__init__(self, func=None) otherKeys = ['Escape', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'Tab', 'space', 'Return', 'Insert', 'Delete', 'Home', 'End', 'Prior', 'Next', 'Up', 'Down', 'Left', 'Right', 'Caps_Lock', 'Num_Lock', 'BackSpace'] self.bindings = {}
#tagModified=False) self.lines.Set(vertices=self.lineVertices, type=GL.GL_LINE_STRIP, faces=self.faces, freshape=1) #tagModified=False) elif len(self.lineVertices) == 1 and len(self.labelCenters) == 1: #this fixes case of stepping back over 1st label self.labels.Set(vertices=[]) #self.labels.Set(vertices=[], tagModified=False) self.lines.Set(vertices=[]) #self.lines.Set(vertices=[], tagModified=False) MeasureDistanceGUICommandGUI = CommandGUI() MeasureDistanceGUICommandGUI.addMenuCommand('menuRoot', 'Display', 'Distance (Shift Pick)', cascadeName='Measure') class MeasureAngleGUICommand(MeasureGUICommand): """Accumulates picked atoms.Draws fans, lines and labels labelling the angle between trios of selected atoms (color-coded orange).Userpref 'measureAngleSL' sets the 'snakeLength' which is how many angle measureDisplays can be seen at the same time.When more than that number are measured, the first angle measured is no longer labeled. \nPackage : Pmv \nModule : measureCommands \nClass : MeasureAngleGUICommand \nCommand : measureAngleGC \nSynopsis:\n angle/None<---measureAngleGC(atoms) \nRequired Argument:\n
} Specs.define_field(specEntry) else: return None if not (Specs.DefFieldsDict.has_key('x') and Specs.DefFieldsDict.has_key('y') and Specs.DefFieldsDict.has_key('z')): msg = "specs for atom coordinates (x,y,z) are missing" self.warningMsg(msg) return None return Specs genPDBReaderGuiDescr = {'widgetType':'menuRoot', 'menuBarName':'File', 'menuButtonName':'Read PDB with Gen Parser ...', 'index':0} GenPDBReaderGUI = CommandGUI() GenPDBReaderGUI.addMenuCommand('menuRoot', 'File', 'Read PDB with Gen Parser ...',index=0) FieldNames = ('serial', 'name', 'altLoc', 'resName', 'chainID', 'resSeq', 'iCode', 'x', 'y', 'z', 'occupancy', 'tempFactor', 'segID', 'element', 'charge', 'other') variableTypes = ('int', 'character', 'float', 'alphabetic', 'string') specEntries = ('field_name', 'var_type', 'from', 'to', 'index') class DefinePdbSpecifications(MVCommand): """ class to define some pdb specifications in a dictionary and save them in a file """
## sys.stdout = sys.__stdout__ ## # Save the pyShell stdin and redirect it to the main Python ## # interpreter only works if the main interpreter has been ## # started in a interactive mode. ## self.vf.pyShellstdin = sys.stdin ## sys.stdin = sys.__stdin__ ## # Save the pyShell stderr and redirect it to the main Python ## # interpreter only works if the main interpreter has been ## # started in a interactive mode. ## self.vf.pyShellstderr = sys.stderr ## sys.stderr = sys.__stderr__ # HideGUI command GUI. HideGUI = CommandGUI() HideGUI.addMenuCommand('menuRoot', 'File', 'Hide VF GUI...', cascadeName='Preferences') class ShowGUICommand(Command): """Allow to show the ViewerFrameworkGUI at any time \nPackage : Pmv \nModule : customizeVFGUICommands \nClass : ShowGUICommand \nCommand : ShowGUI \nSynopsis:\n None <- ShowGUI(**kw) """
file to edit from a file browser. """ from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autogpfCommands import GpfSetGpo,\ GpfLoadDefaults, GpfMacroInit, CheckMacroAtomTypes,\ GpfMacroReader, GpfMacroChooser, GpfAddSol, GpfInitLigand,\ GpfLigandChooser, GpfLigReader, GpfEditor, GpfWriter,\ SelectCenter, SetMapTypes, SetUpCovalentMap,\ DefineNewAtomParms, SetBoxParameters, SetOtherOptions,\ GpfMergeNonPolarHs, menuText, gridOpts,\ messages, checkHasGpo, box, cenSph, cenCross, autodockElementDict,\ setAutoDockElements, getSideLengths, checkFile GpfLoadDefaultsGUI = CommandGUI() GpfLoadDefaultsGUI.addMenuCommand('AutoTools3Bar', menuText['AutoGpfMB'],\ menuText['ReadGpfMB']) GpfMacroReaderGUI = CommandGUI() GpfMacroReaderGUI.addMenuCommand('AutoTools3Bar', menuText['AutoGpfMB'],\ menuText['ReadMacro'], cascadeName = menuText['MacromoleculeMB']) GpfMacroChooserGUI = CommandGUI() GpfMacroChooserGUI.addMenuCommand('AutoTools3Bar', menuText['AutoGpfMB'], menuText['ChooseMacro'], cascadeName=menuText['MacromoleculeMB']) GpfAddSolGUI = CommandGUI() GpfAddSolGUI.addMenuCommand('AutoTools3Bar',
executable = sys.executable if os.name == 'nt': executable = executable.replace("\\", """\\\\""") cmd = executable cmd += ' -c "import time,os;time.sleep(1);os.system(\'' script = self.vf.help_about.path_data.split( 'script : ')[1].split('\n')[0] if os.name == 'nt': script = script.replace("\\", """\\\\""") script = r'\"' + script + r'\"' cmd += executable + " " + script + "')\"" if os.name == 'nt': #cmd = cmd.replace("\\","""\\\\""") cmd = 'start ' + cmd.encode() else: cmd += ' &' subprocess.Popen(cmd, shell=True) os._exit(0) UpdateGUI = CommandGUI() UpdateGUI.addMenuCommand('menuRoot', 'Help', 'Update', separatorAbove=1) commandList = [{'name': 'update', 'cmd': Update(), 'gui': UpdateGUI}] def initModule(viewer): for _dict in commandList: viewer.addCommand(_dict['cmd'], _dict['name'], _dict['gui'])
'variable': self.levelVar, 'value': level, 'justify': 'left', 'activebackground': self.levelColors[level], 'selectcolor': self.levelColors[level], 'command': self.setLevel_cb }, 'gridcfg': { 'sticky': 'we' } }) ifd.append({ 'name': 'dismiss', 'widgetType': Tkinter.Button, 'defaultValue': 1, 'wcfg': { 'text': 'Dismiss', 'command': self.Close_cb }, 'gridcfg': { 'sticky': 'we' } }) self.form = self.vf.getUserInput(self.ifd, modal=0, blocking=0) self.form.root.protocol('WM_DELETE_WINDOW', self.Close_cb) MVSetSelectionLevelGUI = CommandGUI() MVSetSelectionLevelGUI.addMenuCommand('menuRoot', 'Select', 'Set Selection Level')
command=self.destroy) b.pack(side='left') notebook.setnaturalsize() else: self.master.deiconify() self.master.lift() def destroy(self): self.master.destroy() self.master = None def openurl(self, evt=None): import webbrowser webbrowser.open('http://mgltools.scripps.edu') def register(self): self.master.withdraw() from mglutil.splashregister.register import Register_User Register_User(self.vf.help_about.version) AboutGUI = CommandGUI() AboutGUI.addMenuCommand('menuRoot', 'Help', 'About', separatorAbove=1) commandList = [{'name': 'about', 'cmd': About(), 'gui': AboutGUI}] def initModule(viewer): for _dict in commandList: viewer.addCommand(_dict['cmd'], _dict['name'], _dict['gui'])
# $Header: /opt/cvs/python/packages/share1.5/Pmv/bondsCommandsGUI.py,v 1.3 2009/08/13 20:21:23 sargis Exp $ from ViewerFramework.VFCommand import CommandGUI, CommandProxy class BuildBondsByDistanceProxy(CommandProxy): def __init__(self, vf, gui): CommandProxy.__init__(self, vf, gui) from Pmv.bondsCommands import BuildBondsByDistance command = BuildBondsByDistance() self.vf.addCommand(command, 'buildBondsByDistance', self.gui) BuildBondsByDistanceGUI = CommandGUI() BuildBondsByDistanceGUI.addMenuCommand('menuRoot', 'Edit', 'Build By Distance', cascadeName='Bonds') class AddBondsGUICommandProxy(CommandProxy): def guiCallback(self, **kw): if self.command: self.command.guiCallback(**kw) else: from Pmv.bondsCommands import AddBondsGUICommand command = AddBondsGUICommand() loaded = self.vf.addCommand(command, 'addBondsGC', self.gui) if loaded: command = loaded self.command = command self.command.guiCallback(**kw)
""" from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autostartCommands import ADKill, ADProcessManager,\ AutoStarter, AutoGridStarter, AutoDockStarter, AddAutoDockHost, removePCs,\ entropiaPresent, menuText from AutoDockTools.autostartCommands import VinaStarter if entropiaPresent: from Entropia.EntropiaDef import entropia_job_dir from Entropia.EntropiaUI import EntropiaUI from Entropia.EntropiaEx import EntropiaError import ftplib ADProcessManagerGUI = CommandGUI() ADProcessManagerGUI.addMenuCommand('AutoTools41Bar', menuText['StartMB'], menuText['processManagerMB']) AutoGridStarterGUI = CommandGUI() AutoGridStarterGUI.addMenuCommand('AutoTools41Bar', menuText['StartMB'], menuText['startGridMB']) AutoDockStarterGUI = CommandGUI() AutoDockStarterGUI.addMenuCommand('AutoTools41Bar', menuText['StartMB'], menuText['startDockMB']) VinaStarterGUI = CommandGUI() VinaStarterGUI.addMenuCommand('AutoTools41Bar', menuText['StartMB'], menuText['startVinaMB'])
* The results of the previous steps are written to a file. The user selects a filename via a filebrowser. By convention, the file should have a .dpf extension. If no macromolecule has been selected, it is not possible to write a grid parameter file and the user gets a warning message to that effect. Likewise, the types of the maps to be calculated must be set before the grid parameter file is written and a warning message to this effect appears if the types have not been set. (A checkbutton, "DONE", allows the user to withdraw the autoTools menuBar) """ from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autodpfCommands import DpfSetDpo, DpfLoadDefaults,\ DpfMacroSelector, DpfMacroChooser, DpfInitLigand, DpfLigandChooser,\ DpfLigPDBQReader, DpfEditor, DpfSAWriter, DpfGAWriter, DpfLSWriter, DpfGALSWriter, \ DpfClusterWriter, SimAnneal, GA, LS, SetDockingRunParms, StopAutoDpf,\ menuText, checkHasDpo, sortKeyList, setDpoFields DpfLoadDefaultsGUI = CommandGUI() DpfLoadDefaultsGUI.addMenuCommand('AutoTools3Bar', menuText['AutoDpfMB'], menuText['ReadDpfMB']) DpfMacroSelectorGUI = CommandGUI() DpfMacroSelectorGUI.addMenuCommand('AutoTools3Bar', menuText['AutoDpfMB'],\ menuText['ReadMacro'], cascadeName = menuText['MacromoleculeMB']) DpfMacroChooserGUI = CommandGUI() DpfMacroChooserGUI.addMenuCommand('AutoTools3Bar', menuText['AutoDpfMB'],\ menuText['ChooseMacro'], cascadeName = menuText['MacromoleculeMB']) DpfInitLigandGUI = CommandGUI() DpfInitLigandGUI.addMenuCommand('AutoTools3Bar', menuText['AutoDpfMB'], menuText['AdjustLigand'],
os.remove(os.path.join(self.vf.rcFolder,"colorByAtom_map.py")) except: pass from Pmv.pmvPalettes import AtomElements self.vf.colorByAtomType.palette = ColorPalette('Atom Elements', colorDict=AtomElements, lookupMember='element') geoms = self.vf.colorByAtomType.getAvailableGeoms(self.vf.Mols) self.cleanup() self.vf.colorByAtomType(self.vf.Mols, geoms) def doit(self): self.vf.colorByAtomType.palette.configure(ramp=self.paletteGUI.ramp, labels=self.paletteGUI.labels) self.vf.colorByAtomType.palette.configureCmap() self.vf.colorByAtomType.palette.write(os.path.join(self.vf.rcFolder,"colorByAtom_map.py")) EditColorPaletteByAtomTypeGUI = CommandGUI() EditColorPaletteByAtomTypeGUI.addMenuCommand('menuRoot', 'Edit', 'Edit Color by Atom Type', cascadeName='Color Palettes') class EditColorPaletteByResidueType(MVCommand): def onAddCmdToViewer(self): if not self.vf.commands.has_key('colorByResidueType'): self.vf.loadCommand('colorCommands', 'colorByResidueType', 'Pmv', topCommand = 0) self.vf.colorByResidueType.palette.read(os.path.join(self.vf.rcFolder,"colorByResidueType_map.py")) def guiCallback(self): self.paletteGUI = PaletteChooser(apply_cb=self.apply, makeDefault_cb=self.doit,
'name': 'smobNodes', 'wcfg': { 'molSet': self.vf.Mols, 'vf': self.vf, 'all': 1, 'crColor': (0., 0., 1.), 'forceEmpty': 1, }, 'gridcfg': { 'row': -1, 'sticky': 'we' } }) return idf SuperimposeAtomsCommandGUI = CommandGUI() ## SuperimposeAtomsGUICommandGUI.addMenuCommand('menuRoot', 'Compute', ## 'superimpose Atom Pairs', ## cascadeName = "Superimpose") SuperimposeAtomsCommandGUI.addMenuCommand('menuRoot', 'Compute', 'Superimpose Atom Pairs') commandList = [ { 'name': 'superimposeAtoms', 'cmd': SuperimposeAtomsCommand(), 'gui': None }, ## {'name':'superimposeAtomsGC2', 'cmd':SuperimposeAtomsGUICommand(), ## 'gui':SuperimposeAtomsCommandGUI}, {
packW = ebn['packList']['widget'] packs = packW.getcurselection() # Nothing selected if len(packs) == 0: return packName = packs[0] if not self.citations.has_key(packName): return citation = self.citations[packName] citWidget = ebn['citation']['widget'] citWidget.setvalue(citation) def guiCallback(self): form = self.showForm('chooseCitation', modal=0, blocking=0) citationCommandGUI = CommandGUI() citationCommandGUI.addMenuCommand('menuRoot', 'Help', 'Citation Information') class CiteThisSceneCommand(Command): """Command that helps to cite references used in a given scene \nPackage : Pmv \nModule : helpCommands \nClass : CiteThisSceneCommand """ def buildFormDescr(self, formName): if formName == 'citationHelp': idf = InputFormDescr(title="Choose Package") citeKeys = self.vf.showCitation.citations.keys() txt = """
* The results of the previous steps are written to a file. The user selects a filename via a filebrowser. By convention, the file should have a .dpf extension. If no macromolecule has been selected, it is not possible to write a grid parameter file and the user gets a warning message to that effect. Likewise, the types of the maps to be calculated must be set before the grid parameter file is written and a warning message to this effect appears if the types have not been set. (A checkbutton, "DONE", allows the user to withdraw the autoTools menuBar) """ from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autodpfCommands import DpfSetDpo, DpfLoadDefaults,\ Dpf4MacroSelector, Dpf4FlexResSelector, Dpf4MacroChooser,\ Dpf4InitLigand, Dpf4LigandChooser, Dpf4LigPDBQReader,\ DpfEditor, Dpf41SAWriter, Dpf41GAWriter, Dpf41LSWriter,\ Dpf41GALSWriter, Dpf4ClusterWriter, SimAnneal, GA,\ LS, SetDockingRunParms, SetAutoDock4Parameters, SetAutoDock41Parameters,\ StopAutoDpf, menuText, checkHasDpo, sortKeyList, setDpoFields DpfLoadDefaultsGUI = CommandGUI() DpfLoadDefaultsGUI.addMenuCommand('AutoTools41Bar', menuText['AutoDpfMB'], menuText['ReadDpfMB']) Dpf4MacroSelectorGUI = CommandGUI() Dpf4MacroSelectorGUI.addMenuCommand('AutoTools41Bar', menuText['AutoDpfMB'],\ menuText['ReadMacro4'], cascadeName = menuText['MacromoleculeMB']) Dpf4FlexResSelectorGUI = CommandGUI() Dpf4FlexResSelectorGUI.addMenuCommand('AutoTools41Bar', menuText['AutoDpfMB'],\ menuText['ReadFlexRes4'], cascadeName = menuText['MacromoleculeMB']) Dpf4MacroChooserGUI = CommandGUI() Dpf4MacroChooserGUI.addMenuCommand('AutoTools41Bar', menuText['AutoDpfMB'],\ menuText['ChooseMacro4'], cascadeName = menuText['MacromoleculeMB'])
def __call__(self, *args, **kw): """None <--- buildDNA(name,seq,**kw) \nnodes---TreeNodeSet holding the current selection \ncolors---list of rgb tuple. \ngeomsToColor---list of the name of geometries to color,default is 'all' """ status = self.doitWrapper( *args, **kw) #apply( self.doitWrapper, (name, seq), kw) return status def guiCallback(self): status = self.doitWrapper() autoPACKGUI = CommandGUI() autoPACKGUI.addMenuCommand('menuRoot', 'Compute', 'autoPack') commandList = [ { 'name': 'autoPACK', 'cmd': AutoPACKCommand(), 'gui': autoPACKGUI }, ] def initModule(viewer): for dict in commandList: viewer.addCommand(dict['cmd'], dict['name'], dict['gui'])
self.ifd.entryByName['gridPointsXEnd']['widget'].set( atom.coords[0]) self.ifd.entryByName['gridPointsYEnd']['widget'].set( atom.coords[1]) self.ifd.entryByName['gridPointsZEnd']['widget'].set( atom.coords[2]) self.endCross.Set(vertices=((atom.coords[0], atom.coords[1], atom.coords[2]), )) self.vf.GUI.VIEWER.Redraw() def openPklData(self): self.vf.AutoLigandMovieCommand(self.fileBaseName + '_flood.pkl') AutoLigandCommandGUI = CommandGUI() AutoLigandCommandGUI.addMenuCommand('menuRoot', 'Compute', 'Run AutoLigand...', cascadeName="AutoLigand") class OpenMovieCommand(MVCommand): "GUI that opens saved movie of fill file." def __init__(self, func=None): MVCommand.__init__(self, func) self.floodFile = None def guiCallback(self): file = self.vf.askFileOpen(types=[('Saved Flood File', '*.pkl'),
""" from ViewerFramework.VFCommand import CommandGUI from AutoDockTools.autoflexCommands import AF_MacroReader,\ AF_MacroChooser, AF_SelectResidues, AF_ProcessResidues,\ AF_ProcessHingeResidues, AF_EditHinge, AF_SetHinge,\ AF_SetBondRotatableFlag, AF_StepBack, AF_FlexFileWriter,\ AF_RigidFileWriter, AF_LigandDirectoryWriter, menuText AF_MacroReaderGUI=CommandGUI() AF_MacroReaderGUI.addMenuCommand('AutoTools4Bar', menuText['AutoFlexMB'], \ menuText['Read Macro'], cascadeName = menuText['InputMB']) AF_MacroChooserGUI=CommandGUI() AF_MacroChooserGUI.addMenuCommand('AutoTools4Bar', menuText['AutoFlexMB'], menuText['Choose Macro'], cascadeName = menuText['InputMB']) AF_SelectResiduesGUI = CommandGUI() AF_SelectResiduesGUI.addMenuCommand('AutoTools4Bar', menuText['AutoFlexMB'],menuText['Set Residues']) AF_ProcessResiduesGUI = CommandGUI() AF_ProcessHingeResiduesGUI = CommandGUI() AF_EditHingeGUI = CommandGUI() AF_EditHingeGUI.addMenuCommand('AutoTools4Bar', menuText['AutoFlexMB'],\
from AutoDockTools.autoanalyzeCommands import menuText,\ checkHasInitializedDockings, hideShowHide, toggleShowHide,\ checkNameStr, ADChooseMacro, ADReadMacro, ADEPDBMol,\ ADSeeSpots, ADShowBindingSite, ADMakeAllGrids, ADGetOutput,\ ADGetAGrid, ADSelectDLG, ADDeleteDLG, ADGetDirDLGs, ADGetDLG,\ ClusterDockingChooser, ModelDockingChooser, ADDrawHistogram,\ ADMacroLigandChart, ADDockingChooser, ReadAutoDockStates,\ StatesPlayerWidget, ShowAutoDockStatesBaseCmd, ShowAutoDockStates,\ ShowAutoDockStatesByEnergy, ShowAutoDockPopulation,\ ShowAutoDockStatesHISTOGRAM, ShowAutoDockClusteringStates,\ ReadAutoDockClusteringStates, WriteAutoDockStates,\ WriteAutoDockClustering, MakeAutoDockCLUSTERING,\ MakeAutoDockSubsetCLUSTERING ADChooseMacroGUI=CommandGUI() ADChooseMacroGUI.addMenuCommand('AutoTools3Bar', menuText['AnalyzeMB'], menuText['chooseMacro'], cascadeName = menuText['MoleculesMB']) ADReadMacroGUI=CommandGUI() ADReadMacroGUI.addMenuCommand('AutoTools3Bar', menuText['AnalyzeMB'], menuText['readMacro'], cascadeName = menuText['MoleculesMB']) ADEPDBMolGUI=CommandGUI() ADEPDBMolGUI.addMenuCommand('AutoTools3Bar', menuText['AnalyzeMB'], menuText['epdbMol'], cascadeName = menuText['GridsMB']) ADSeeSpotsGUI=CommandGUI()
class ColorCommandProxy(CommandProxy): def guiCallback(self, **kw): if self.command: self.command.guiCallback(**kw) else: from Pmv.colorCommands import ColorCommand command = ColorCommand() loaded = self.vf.addCommand(command, 'color', self.gui) if loaded: command = loaded self.command = command self.command.guiCallback(**kw) ColorGUI = CommandGUI() ColorGUI.addMenuCommand('menuRoot', 'Color', 'Choose Color') class ColorByAtomTypeProxy(CommandProxy): def guiCallback(self, **kw): if self.command: self.command.guiCallback(**kw) else: from Pmv.colorCommands import ColorByAtomType command = ColorByAtomType() loaded = self.vf.addCommand(command, 'colorByAtomType', self.gui) if loaded: command = loaded self.command = command self.command.guiCallback(**kw)
def deleteViews(self): """ Remove all existing views. """ for b in self.viewsContainer.interior().grid_slaves(): b.destroy() self.views = {} self.allViews = 0 for d in self.viewsDirectors.values(): if d.gui: d.gui.root.destroy() d.gui = None d = None self.viewsDirectors = {} self.representations = {} ViewsCommandGUI = CommandGUI() ViewsCommandGUI.addMenuCommand('menuRoot', '3D Graphics', 'Show Views Panel', index=10) from mglutil.gui.BasicWidgets.Tk.customizedWidgets import SaveButton, LoadButton class SaveViewsToFile(MVCommand): """This command allows the user to save created views to two files: *_views.py ( orientation) and *_repr.db(representation). These files are used to restore the saved views (ReadViews Command). The saved orientations and representations could also be loaded (separately) whith the DejaVu Viewer GUI.""" def buildFormDescr(self, formName): if formName == 'saveViewsToFile':
box = Box('Unit Cell', vertices=coords) self.vf.GUI.VIEWER.AddObject(box, parent=geom) molecule.geomContainer.geoms['Unit Cell'] = box def showUnitCell(self, molecule): visible = not molecule.geomContainer.geoms['Unit Cell'].visible molecule.geomContainer.geoms['Unit Cell'].Set(visible=visible) def showPacking(self, molecule): geom = molecule.geomContainer.geoms['master'] if len(geom.instanceMatricesFortran) >= 2: geom.Set(instanceMatrices=[numpy.eye(4, 4)]) else: matrices = instanceMatricesFromGroup(molecule) geom.Set(instanceMatrices=matrices) CrystalCommandGUI = CommandGUI() CrystalCommandGUI.addMenuCommand('menuRoot', 'Display', 'Crystal') commandList = [{ 'name': 'crystalCommand', 'cmd': CrystalCommand(), 'gui': CrystalCommandGUI }] def initModule(viewer): for _dict in commandList: viewer.addCommand(_dict['cmd'], _dict['name'], _dict['gui'])
def alignment_cb(self, event=None): if not hasattr(self.vf,'alignment'): self.vf.alignment = Alignment() if not hasattr(self.vf,'alnEditor'): self.vf.alnEditor = PmvAlignmentEditor(vf=self.vf) self.vf.alnEditor.alignment = self.vf.alignment else: self.vf.alnEditor.redraw() self.vf.alnEditor.master.deiconify() for mol in self.vf.Mols: if mol.name not in self.vf.alignment.seqNames: self.vf.alnEditor.getSequence(mol) SuperImposeAtomsGUICommandGUI = CommandGUI() SuperImposeAtomsGUICommandGUI.addMenuCommand('menuRoot', 'Compute', 'superimposeAtoms', cascadeName = "Superimpose") class SuperimposeCoordsCommand(MVCommand): def onAddCmdToViewer(self): if not self.vf.commands.has_key('superimposeAtoms'): self.vf.loadCommand('superImposeCommands', 'superimposeAtoms', 'Pmv', topCommand = 0)