schrodinger.application.desmond.gui module

GUI code for the Desmond panels.

Copyright Schrodinger, LLC. All rights reserved.

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.warning_dialog(master, msg)

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

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.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.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

class schrodinger.application.desmond.gui.HorizontalBar(parent=0)

Bases: PyQt5.QtWidgets.QFrame

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(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
setEditorData(self, QWidget, QModelIndex)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
class schrodinger.application.desmond.gui.TableModel(row_header)

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

setColumns(columns)
addColumn(column)
removeColumn(self, int, parent: QModelIndex = QModelIndex()) → bool
clear()
update()
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

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

Returns number of columns

flags(index)

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

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.

setData(index, value, role=2)

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

headerData(section, orientation, role)

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

class schrodinger.application.desmond.gui.PosResDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

Class for allowing the data in the PosResModel to be modified

createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
setEditorData(self, QWidget, QModelIndex)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
updateEditorGeometry(self, QWidget, QStyleOptionViewItem, QModelIndex)
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.PosResModel

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

warning
setRows(rows)
clear()
addOneRow(row)
removeOneRow(rownum)
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

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

Returns number of columns

flags(index)

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

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.

setData(index, value, role=2)

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

headerData(section, orientation, role)

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

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

respaBondChanged()
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.

updateKey(key)
updateFromKey(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.

STYLE_NAMEMAP = {'Anisotropic': 'anisotropic', 'Constant area': 'constant_area', 'Isotropic': 'isotropic', 'Semi-isotropic': 'semi_isotropic', 'anisotropic': 'Anisotropic', 'constant_area': 'Constant area', 'isotropic': 'Isotropic', 'semi_isotropic': 'Semi-isotropic'}
METHOD_NAMEMAP = {'Berendsen': 'Berendsen', 'DPD': 'DPD', 'Langevin': 'Langevin', 'MTK': 'Nose-Hoover chain', 'NH': 'Nose-Hoover chain'}
getBaroMethod()
setBaroMethod(method)
getThermoMethod()
setThermoMethod(method)
baroMethodChanged(index)
thermoMethodChanged(index)
setBaroStyle(style)
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.

updateKey(key)
updateFromKey(key)
resetEnsClass(ens_class)
numGroupsChanged(ignored=None)
resetThermoTemp(t)
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', 'Force tapering': 'c2switch', 'Potential tapering': 'c1switch', 'Shift': 'shift', 'c1switch': 'Potential tapering', 'c2switch': 'Force tapering', 'none': 'Cutoff', 'shift': 'Shift'}
nearMethodChanged(index=None)
taperingModified()
resetFromModel(model=None)

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

updateModel(model)
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.

updateKey(key)
updateFromKey(key)
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

updatePosresButtons(ignored1=None, ignored2=None)
selectPosResAsl()
addPosResRow()
deletePosResRow()
resetPosResTable()
getRestrGroup()
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.

resetFromModel(model)

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

updateModel(model)

Updates the given model to the data from the UI

updateKey(key)
updateFromKey(key)

Update the options in the restraints tab to the model.

reset()

Called when the panel is reset.

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.

updateKey(key)
updateFromKey(key)
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.

enableCustomSeed()

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

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.

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

Bases: PyQt5.QtWidgets.QItemDelegate

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

createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget
setEditorData(self, QWidget, QModelIndex)
setModelData(self, QWidget, QAbstractItemModel, QModelIndex)
updateEditorGeometry(editor, option, index)
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.AtomGroupModel

Bases: PyQt5.QtCore.QAbstractTableModel

Class for storing the window table information.

warning
setRows(rows)
clear()
addOneRow(row)
removeOneRow(rownum)
rowCount(parent=<PyQt5.QtCore.QModelIndex object>)

Returns number of rows

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

Returns number of columns

flags(index)

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

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.

setData(index, value, role=2)

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

headerData(section, orientation, role)

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

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.

updateAtomGroupButtons(ignored1=None, ignored2=None)
selectAtomGroupAsl()
addAtomGroupRow()
deleteAtomGroupRow()
resetAtomGroupTable()
getAtomGroups()
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.

resetFromModel(model)

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

updateKey(key)
updateFromKey(key)
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.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.MinimizerFrame(master, key, ui)

Bases: schrodinger.application.desmond.gui._MdcBase

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

resetMaxIter(mi)
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.

updateKey(key)
updateFromKey(key)
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.

updateKey(key)
updateFromKey(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.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.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.
isInfiniteModel()

Is the current model marked as an infinitely bonded model?

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

Resets the input frame to defaults

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
setup()

Sets up the panel with SLineEdit widgets

onTrajIntervalChanged()

Called when trajectory interval changes.

onNumOfFramesChanged(num_frames_str)

Called when the number of frames changes.

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

Called when simulation time changes.

setGuiState(state)
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.

updateKey(key)

Update the key based on the GUI settings

updateFromKey(key)

Updates widgets based on key.

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 = {'NPAT': 'Constant number of atoms, constant area, constant temperature', 'NPT': 'Constant number of atoms, constant pressure, constant temperature', 'NPγT': 'Constant number of atoms, constant surface tension, constant temperature', 'NVE': 'Constant number of atoms, constant volume, constant energy', 'NVT': 'Constant number of atoms, constant volume, constant temperature'}
ensClassChanged(ens_class, should_callback=True)
changeTemp()
updateEnsClassFromKey(key)
updateTempFromKey(key)
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.

updateKey(key)
updateFromKey(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.

model_changed_callback(model)
shouldRelax()
getProtFilename()

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

toggleRelaxModel(ignored=None)
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.

updateKey(key)

Update the key based on the GUI settings

updateFromKey(key)
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
updateDialogKeys()

Update the keys of the dialog from the options.

openAdvancedDialog()
model_changed_callback(model)
closeDialog()

Close the advanced options dialog.

hideDialog()
okPressed()

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

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.

helpPressed()
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.

updateKey(key)
updateFromKey(key)
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.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.GuiApp(key, validator, tag_spec, 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).

setup()
layOut()

See af2.JobApp documentation for method documentation.

getConfigDialog()
enableSimulationGroupBox(state)

Set the simulation group box enabled state

Parameters:state (bool) – True if the groupbox should be enabled, False if not
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.
updateFromKey(key)
  • Updates the look of the GUI with `key’.
verifySettings(**kwargs)
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.
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

writeCommand()
readCommand(fname)
isKeyConsistentWithPanel(key)
reset()
setDefaults()

Resets the parameters to their default values.

closeEvent(event)

Hide panel, if in Maestro. Otherwise close it.

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)
validateNumProcs(silent=False)

See ConfigDialog.validateNumProcs docstring.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

getHosts(ncpus=True, excludeGPGPUs=False)

Returns list of host entries from appropriate schrodinger.hosts file, with parenthetical entry of the number of available processors (if ‘ncpus’ is True). If excludeGPGPUs is True, hosts with GPGPUs will be excluded from the list

getHostType()
isGPUHost()
isCPUHost()
createGPGPUTable(multi_gpgpu_allowed)
addGPGPUTableToLayout(t)

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

onHostMenuChanged(index)
setupGPGPUTable(host=None)

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

getSettings(extra_kws=None)

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

applySettings(settings)

See parent class docstring

setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

addGPGPUGroupToLayout(layout=None, count=None, add_autogpu=True)
class schrodinger.application.desmond.gui.SingleGpuDesmondGuiConfigDialog(*args, **kwargs)

Bases: schrodinger.application.desmond.gui.DesmondGuiConfigDialog

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)