schrodinger.application.desmond.gui module

GUI code for the Desmond panels.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.desmond.gui.AdvOptionsFrame(master, key, win, mdc_callback, adv_dialog_class, is_annealing, is_replica_exchange, app, dialog_master=None)

Bases: PyQt5.QtCore.QObject

Frame for the “Advanced Options” button.

MDC_DEFAULT_HEIGHT = 350
MDC_DEFAULT_WIDTH = 480
applySettings()

Called when the “Apply” button of the advanced dialog is pressed. Returns 0 on success, 1 if any of the widgets had invalid values.

cancelPressed()

Called when the “Cancel” button of the advanced dialog is pressed.

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

closeDialog()

Close the advanced options dialog.

helpPressed()
hideDialog()
model_changed_callback(model)
okPressed()

Called when the “OK” button of the advanced dialog is pressed. Closes the dialog only if “Apply” operation was successful.

openAdvancedDialog()
updateDialogKeys()

Update the keys of the dialog from the options.

updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.AtomGroupDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

Class for allowing the data in the AtomGroupModel to be modified.

createEditor(parent, option, index)
setEditorData(editor, index)
setModelData(editor, model, index)
updateEditorGeometry(editor, option, index)
class schrodinger.application.desmond.gui.AtomGroupFrame(master, key, ui)

Bases: object

Frame for the “Atom group” box of the Misc tab of the Advanced Options dialog.

addAtomGroupRow()
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

deleteAtomGroupRow()
getAtomGroups()
resetAtomGroupTable()
resetFromModel(model)

Update the Atom group UI based on the given model CTs.

selectAtomGroupAsl()
updateAtomGroupButtons(ignored1=None, ignored2=None)
updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.AtomGroupModel

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

addOneRow(row)
clear()
columnCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of columns

data(index, role=0)

Given a cell index, returns the data that should be displayed in that cell (text or check button state). Used by the view.

flags(index)

Returns flags for the specified cell. Whether it is a checkbutton or not.

headerData(section, orientation, role)

Returns the string that should be displayed in the specified header cell. Used by the View.

removeOneRow(rownum)
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

setData(index, value, role=2)

Called by the view to modify the model when the user changes the data in the table.

setRows(rows)
warning
class schrodinger.application.desmond.gui.AtomGroupRow(panel)

Bases: schrodinger.application.desmond.gui._BaseAslRow

validate()

Returns None if all values of this row are valid; error message otherwise.

class schrodinger.application.desmond.gui.DesmondBasicConfigDialog(*args, **kwargs)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

This is identical to Appframework.ConfigDialog except adds platform check for localhost jobs

enablePlatformValidation(state)

Enable/disable platform validation of localhost jobs

Parameters:state (bool) – Whether to use platform validation or not
validate()

Performs localhost validate if requested and then calls the parent class validation method

Return type:bool
Returns:Whether the dialog settings validate properly or not
class schrodinger.application.desmond.gui.DesmondGuiConfigDialog(parent, title='', jobname='', checkcommand=None, multi_gpgpu_allowed=True, **kw)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

This Config Dialog supports enumerating GPGPU’s and showing them to the user. GPUs are selected automatically.

addAutoGpuCbToLayout(layout=None, count=None)
addGPGPUGroupToLayout(layout=None, count=None, add_autogpu=True)
addGPGPUTableToLayout(t)

This can be overridden to place the gpgputable somewhere else in the dialog.

applySettings(settings)

See parent class docstring

createGPGPUTable(multi_gpgpu_allowed)
getHostType()
getHosts(ncpus=True, excludeGPGPUs=False)
getSettings(extra_kws=None)

Return dialog state by saving the state of the checkbox and then calling the base class

isCPUHost()
isGPUHost()
onHostMenuChanged(index)
setupGPGPUTable(host=None)

After the regular GPU table setup, customize the state of checkbox and table

setupHostLayout()
validate()
validateNumProcs(silent=False)

See ConfigDialog.validateNumProcs docstring.

class schrodinger.application.desmond.gui.DesmondRestGuiConfigDialog(parent, title='', jobname='', checkcommand=None, **kw)

Bases: schrodinger.application.desmond.gui.DesmondGuiConfigDialog

addGPGPUGroupToLayout(layout=None, count=None, add_autogpu=True, add_replica=False)
class schrodinger.application.desmond.gui.EnsembleClassFrame(master, key, ens_callback, temp_callback, is_annealing, is_replica_exchange, app)

Bases: object

Frame that includes the Ensemble class pull-down menu and the entry fields correspondint to it.

TOOLTIP_TEXT = {u'NPT': 'Constant number of atoms, constant pressure, constant temperature', u'NVE': 'Constant number of atoms, constant volume, constant energy', u'NVT': 'Constant number of atoms, constant volume, constant temperature', u'NPAT': 'Constant number of atoms, constant area, constant temperature', u'NP\u03b3T': 'Constant number of atoms, constant surface tension, constant temperature'}
changeTemp()
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

ensClassChanged(ens_class, should_callback=True)
updateEnsClassFromKey(key)
updateFromKey(key)
updateKey(key)
updateTempFromKey(key)
class schrodinger.application.desmond.gui.EnsembleTab(master, key, is_annealing, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Ensemble tab of the Advanced Options dialog.

METHOD_NAMEMAP = {'NH': 'Nose-Hoover chain', 'MTK': 'Nose-Hoover chain', 'DPD': 'DPD', 'Langevin': 'Langevin', 'Berendsen': 'Berendsen'}
STYLE_NAMEMAP = {'semi_isotropic': 'Semi-isotropic', 'Constant area': 'constant_area', 'isotropic': 'Isotropic', 'Anisotropic': 'anisotropic', 'anisotropic': 'Anisotropic', 'Isotropic': 'isotropic', 'Semi-isotropic': 'semi_isotropic', 'constant_area': 'Constant area'}
baroMethodChanged(index)
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

getBaroMethod()
getThermoMethod()
numGroupsChanged(ignored=None)
resetEnsClass(ens_class)
resetThermoTemp(t)
setBaroMethod(method)
setBaroStyle(style)
setThermoMethod(method)
thermoMethodChanged(index)
updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.GuiApp(key, validator, tag_func, sim_class, is_replica_exchange=False, **kwargs)

Bases: schrodinger.ui.qt.appframework2.af2.JobApp

Base class of several Desmond panel GUI’s (see its subclasses below).

closeEvent(event)

Hide panel, if in Maestro. Otherwise close it.

enableSimulationGroupBox(state)

Set the simulation group box enabled state

Parameters:state (bool) – True if the groupbox should be enabled, False if not
getConfigDialog()
isKeyConsistentWithPanel(key)
layOut()

See af2.JobApp documentation for method documentation.

model_changed_callback(model)

The GUI is designed to have some intelligence that can adapt its own look based on the imported model system. So if the model system is changed, we need to inform some other parts of the GUI.

The event that the model system is changed will be initially triggered from the `InputGroup’ (see this class above), then it will go to here (i.e., `GuiApp’), and from here the signal will be sent forth to all interested parts of the GUI.

`model’ - A `cms.Cms’ object, containing all information about the model system.

  • If it is none, then the model is a checkpoint file.
readActionSelected()

Called when the “Read” action is selected by the user. It’s the responsibility of individual panels to hook this method to the “Read” menu action. See Ev:109801

readCommand(fname)
reset()
setDefaults()

Resets the parameters to their default values.

setup()
startCommand(really_start=True)

Writes the job input files and assembles the command to execute.

Parameters:really_start (bol) – Whether to start the job after writing the input files.
updateFromKey(key)
  • Updates the look of the GUI with `key’.
verifySettings()
writeCommand()
class schrodinger.application.desmond.gui.HorizontalBar(parent=0)

Bases: PyQt5.QtWidgets.QFrame

class schrodinger.application.desmond.gui.InputGroup(master, model_changed_callback, allow_checkpoint_files=True, check_infinite=False, reset_parent_on_load=True, cg_aware=False)

Bases: object

  • Group Frame for showing the widgets for loading the system model.
  • Used by the `GuiApp’ class for all panels.
browseSystemFile(fname)
isInfiniteModel()

Is the current model marked as an infinitely bonded model?

Return type:bool
Returns:Whether the model is marked as infinitely bonded
reset()

Resets the input frame to defaults

class schrodinger.application.desmond.gui.IntegrationTab(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Integration tab of the Mdc Advanced Options dialogs

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

respaBondChanged()
updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.InteractionTab(master, key, ui, command=None)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Interaction frame of the Advanced Options dialog.

NEAR_METHOD_NAMEMAP = {'Cutoff': 'none', 'none': 'Cutoff', 'c1switch': 'Potential tapering', 'c2switch': 'Force tapering', 'shift': 'Shift', 'Potential tapering': 'c1switch', 'Force tapering': 'c2switch', 'Shift': 'shift'}
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

nearMethodChanged(index=None)
resetFromModel(model=None)

Update the interaction tab UI based on the given model CTs.

taperingModified()
updateFromKey(key)
updateKey(key)
updateModel(model)
class schrodinger.application.desmond.gui.MdGroup(master, key, win, is_annealing=False, is_replica_exchange=False, dialog_master=None)

Bases: schrodinger.application.desmond.gui._BaseGroup

Molecular Dynamics group

setEnabledExceptSimulationTime(enable)

Ev:111016 Enable/disable this group. Does NOT disable the simulation time entry field.

class schrodinger.application.desmond.gui.MdcAdvancedDialog(master, key, is_annealing, is_replica_exchange, buttons, title)

Bases: schrodinger.application.desmond.gui._BaseAdvancedDialog

Advanced Options dialog for Mdc Desmond panels

class schrodinger.application.desmond.gui.MdcMiscTab(master, key, ui, include_randvel=True)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Misc tab of Mdc Advanced Options dialogs.

resetFromModel(model)
  • Expands and reset the atom group table if the given ‘model’ is a ‘cms.Cms’ object.
  • Given a ‘model’( which is a ‘cms.Cms’ object), resets the atom group table.
updateModel(model)

Updates the given model to the data from the UI

class schrodinger.application.desmond.gui.MinAdvancedDialog(master, key, is_annealing, is_replica_exchange, buttons, title)

Bases: schrodinger.application.desmond.gui._BaseAdvancedDialog

Advanced Minimization options dialog for Desmond panels

class schrodinger.application.desmond.gui.MinMiscTab(master, key, ui)

Bases: schrodinger.application.desmond.gui.MdcMiscTab

Frame for the Misc Tab of Advanced Options dialog of Minimization GUI.

class schrodinger.application.desmond.gui.MinOutputFrame(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Group box “Output” of the “Minimization” tab of Advanced Options dialog.

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.MinimizationTab(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Minimization tab of the Advanced Options dialog.

resetMaxIter(mi)
class schrodinger.application.desmond.gui.MinimizerFrame(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Group box “Minimizer” of the “Minimization” tab of Advanced Options dialog.

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

resetMaxIter(mi)
updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.OutputTab(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Output tab of the Advanced Options dialog

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.PosResDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

Class for allowing the data in the PosResModel to be modified

createEditor(parent, option, index)
setEditorData(editor, index)
setModelData(editor, model, index)
updateEditorGeometry(editor, option, index)
class schrodinger.application.desmond.gui.PosResModel

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

addOneRow(row)
clear()
columnCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of columns

data(index, role=0)

Given a cell index, returns the data that should be displayed in that cell (text or check button state). Used by the view.

flags(index)

Returns flags for the specified cell. Whether it is a checkbutton or not.

headerData(section, orientation, role)

Returns the string that should be displayed in the specified header cell. Used by the View.

removeOneRow(rownum)
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

setData(index, value, role=2)

Called by the view to modify the model when the user changes the data in the table.

setRows(rows)
warning
class schrodinger.application.desmond.gui.PosResRow(panel)

Bases: schrodinger.application.desmond.gui._BaseAslRow

validate()

Returns None if all values of this row are valid; error message otherwise.

class schrodinger.application.desmond.gui.RandVelFrame(master, key, ui, root_master)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the “Randomize velocities” group of the Misc tab of Advanced dialog.

checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

enableCustomSeed()

Enables or disables custom seed line edit based on the radio buttons.

updateFromKey(key)
updateKey(key)
class schrodinger.application.desmond.gui.RelaxFrame(master, key, app)

Bases: object

Frame that includes the “Relax model…” check box and the relaxation protocol entry field.

changeProtFile(fname)
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

getProtFilename()

Returns the name of the user-specified protocol file or None if user did not specifies any file.

model_changed_callback(model)
shouldRelax()
toggleRelaxModel(ignored=None)
updateFromKey(key)
updateKey(key)

Update the key based on the GUI settings

class schrodinger.application.desmond.gui.RestraintsTab(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

Frame for the Restraints tab of the Advanced Options dialog

addPosResRow()
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

deletePosResRow()
getRestrGroup()
reset()

Called when the panel is reset.

resetFromModel(model)

Update the Restraints tab UI based on the given model CTs.

resetPosResTable()
selectPosResAsl()
updateFromKey(key)

Update the options in the restraints tab to the model.

updateKey(key)
updateModel(model)

Updates the given model to the data from the UI

updatePosresButtons(ignored1=None, ignored2=None)
class schrodinger.application.desmond.gui.SimOptionsFrame(master, key, app)

Bases: object

Responsible for drawing the simulation options widgets, including simulation time, recording intervals and the number of frames.

LE_WIDTH = 80
checkValidity()

Checks if all widgets have valid values. If a widget with invalid value was encountered, then returns string that describes the problem. Returns None if there are no issues.

onNumOfFramesChanged(num_frames_str)

Called when the number of frames changes.

Parameters:num_frames_str (str) – Value of the number of frames field.
onSimTimeChanged()

Called when simulation time changes.

onTrajIntervalChanged()

Called when trajectory interval changes.

setEnabledExceptSimulationTime(enable)
setGuiState(state)
setup()

Sets up the panel with SLineEdit widgets

updateFromKey(key)

Updates widgets based on key.

updateKey(key)

Update the key based on the GUI settings

class schrodinger.application.desmond.gui.SingleGpuDesmondGuiConfigDialog(*args, **kwargs)

Bases: schrodinger.application.desmond.gui.DesmondGuiConfigDialog

class schrodinger.application.desmond.gui.TableModel(row_header)

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

addColumn(column)
clear()
columnCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of columns

data(index, role=0)

Given a cell index, returns the data that should be displayed in that cell (text or check button state). Used by the view.

flags(index)

Returns flags for the specified cell. Whether it is a checkbutton or not.

headerData(section, orientation, role)

Returns the string that should be displayed in the specified header cell. Used by the View.

removeColumn(col_idx)
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

setColumns(columns)
setData(index, value, role=2)

Called by the view to modify the model when the user changes the data in the table.

update()
class schrodinger.application.desmond.gui.TempItemDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

Class for allowing the data in the TableModel to be modified. Only allows float-values to be entered into the table.

createEditor(parent, option, index)
setEditorData(editor, index)
setModelData(editor, model, index)
updateEditorGeometry(editor, option, index)
schrodinger.application.desmond.gui.count_traj_frames(trj_dir)

Count the number of frames in the given trajectory directory. Returns 0 if the trajectory was not readable. :param trj_dir: Trajectory path :type: trj_dir: str :return: Number of frames :rtype: int

schrodinger.application.desmond.gui.error_dialog(master, msg)

Pops out a dialog showing the error message (`msg’). This function just provides a uniform way for doing the job.

schrodinger.application.desmond.gui.get_in_cms_from_cpt(cpt_path, cfg=None)

Return the -in.cms file associated with a cpt file.

Parameters:
  • cpt_path (str) – Full path to the cpt file
  • cfg (sea.Map or None) – Optional config to check. If not specified, the config will be extracted from the cpt.
Returns:

Path to related -in.cms file

Return type:

str

schrodinger.application.desmond.gui.get_model_from_pt_row(row)

Check that a specified PT row contains a valid Desmond system and if so return the system loaded from the row’s cms_file attribute.

Parameters:row (schrodinger.project.ProjectRow) – Row of the Project Table to process
Returns:The cms.Cms loaded from the PT’s cms_file attribute if possible, None otherwise.
Return type:cms.Cms or None
schrodinger.application.desmond.gui.process_loaded_model(model)

Utility function for processing models getting loaded for various jobs.

Sets full system ID for each atom in the component CTs.

Parameters:model (cms.Cms) – Model to be processed
schrodinger.application.desmond.gui.warning_dialog(master, msg)

Pops out a dialog showing the warning message (`msg’). This function just provides a uniform way for doing the job.