schrodinger.application.jaguar.gui.tabs.optimization_tab module

class schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinateColumns

Constants for table columns.

COORD_NAME = 1
COORD_TYPE = 2
INDICES = 0
NAMES = ('Atom Indices', 'Coordinate', 'Type', 'Target Value')
NUM_COLS = 4
TARGET_VAL = 3
class schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinateData(st, atoms, coordinate_type, target_value=None)

Bases: schrodinger.application.jaguar.gui.tabs.coordinates.CoordinateData

This class stores all data for a single constraint coordinate.

Variables:
  • st (schrodinger.structure.Structure) – ct structure for which coordinates are defined
  • atom_indices (list) – indices of atoms, which define this coordinate
  • coordinate_name (str) – name of this coordinate based on atom indices
  • coordinate_type (int) – coordinate type
  • target_value (float) – target value of this coordinate
class schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinatesDelegate

Bases: PyQt5.QtWidgets.QItemDelegate

This delegate is used to validate values entered in ‘target value’ column.

COLUMN = <schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinateColumns instance>
createEditor(parent, option, index)

This function returns an editor widget (QLineEdit) for ‘target value’ column.

Parameters:
  • parent (QtWidgets.QWidget) – parent widget
  • option (QtWidgets.QStyleOptionViewItem) – not used, but kept for compatibility
  • index (QtCore.QModelIndex) – model index
Returns:

QLineEdit editor widget

Return type:

QtWidgets.QLineEdit

setEditorData(editor, index)

This function read data from model, converts it to text and sets it in the editor widget.

Parameters:
  • editor (QtWidgets.QLineEdit) – editor widget
  • index (QtCore.QModelIndex) – model index
setModelData(editor, model, index)

This function reads text from QLineEdit and writes it to the model

Parameters:
  • editor (QtWidgets.QLineEdit) – editor widget
  • model (QtCore.QAbstractItemModel) – data model
  • index (QtCore.QModelIndex) – model index
class schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinatesModel(parent=None)

Bases: schrodinger.application.jaguar.gui.tabs.coordinates.CoordinatesModel

A model to store scan tab coordinates data.

COLUMN = <schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinateColumns instance>
addCoordinate(st, atoms, coordinate_type, target_value=None)

Add new coordinate row.

Parameters:
  • st (schrodinger.structure.Structure) – structure
  • atoms (list) – atom indices
  • coordinate_type (int) – coordinate type
  • target_value (float) – target coordinate value
appendFromModel(model)

Append the rows in the given model to this model

Type:ConstraintCoordinatesModel
Param:The model to append rows from
data(index, role=0)

Retrieve the requested data

Parameters:
  • index (PyQt5.QtCore.QModelIndex) – The index to retrieve data for
  • role (int) – The role to retrieve data for
Returns:

The requested data

flags(index)

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

Parameters:index (PyQt5.QtCore.QModelIndex) – The index to retrieve flags for.
setData(index, value, role=2)

Modify coordinate values.

Parameters:
  • index (QtCore.QModelIndex) – the index of table cell
  • value (str) – new value
  • role (int) – The role to set data for.
class schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinatesProxyModel(parent)

Bases: PyQt5.QtCore.QSortFilterProxyModel

A proxy model that allows to hide columns.

COLUMN = <schrodinger.application.jaguar.gui.tabs.optimization_tab.ConstraintCoordinateColumns instance>
filterAcceptsColumn(column, index)

Modified from the parent class to define columns that should be visible.

Parameters:
  • column (int) – the column index
  • index (QModelIndex) – Unused, but kept for PyQt compatibility
class schrodinger.application.jaguar.gui.tabs.optimization_tab.OptimizationTab(parent, input_selector=None)

Bases: schrodinger.application.jaguar.gui.tabs.coordinates.CoordinateTab

ALL_CONSTRAINTS_BUTTON = {0: (True, 'Add Selected Atoms'), 1: (True, 'Add Selected Atoms'), 2: (True, 'Add Selected Atoms'), 3: (True, 'Add Selected Atoms'), 4: (True, 'Add All Atom Pairs'), 5: (True, 'Add All Bond Angles'), 6: (True, 'Add All Torsions')}
CONVERGENCE_CRITERIA = OrderedDict([('Default', 2), ('Loose', 3), ('Tight', 5), ('Custom', 6)])
COORDINATE_OPTS = OrderedDict([('Redundant internal', 1), ('Cartesian', 0), ('Z-matrix', 2)])
HELP_TOPIC = 'JAGUAR_TOPIC_OPTIMIZATION_FOLDER'
INITIAL_HESSIAN = OrderedDict([('Schlegel guess', 0), ('Fischer-Almlof guess', -1), ('Unit Hessian', 1), ('Quantum-mechanical', 4)])
NAME = 'Optimization'
UI_MODULES = (<module 'schrodinger.application.jaguar.gui.ui.optimization_tab_ui' from '/scr/buildbot/savedbuilds/2017-4/NB/build-152/internal/lib/python2.7/site-packages/schrodinger/application/jaguar/gui/ui/optimization_tab_ui.pyc'>,)
addConsButtonPressed()

This function is called when ‘add all constraints/add selected atoms’ button is clicked. It determines current coordinate type and calls appropriate function to add all/selected constraints.

addCoordinate(st, atoms, coordinate_type, target_value=None)

Add new coordinate row.

Parameters:
  • st (schrodinger.structure.Structure) – structure
  • atoms (list) – atom indices
  • coordinate_type (int) – coordinate type
  • target_value (float) – target coordinate value
convergenceTypeChanged(index)

This function is called when convergence type is changed. If ‘Custom’ is selected extra options frame is shown. Otherwise, it is hidden.

Parameters:index (int) – convergence type combo box index
deleteAllRows()

This function is called to delete all rows from the coordinates table.

deleteCurrentRow()

This function is called to delete row which is currently selected from the coordinates table.

getAllAngles(st)

This function returns list that contains lists of atoms for each bond angle in a given structure.

Parameters:st (schrodinger.structure.Structure) – structure
Returns:list that contains lists of atom indices for each bond angle
Return type:list
getAllAtomPairs(st)

This function returns a list of all possible atom pairs in a given structure.

Parameters:st (schrodinger.structure.Structure) – structure
Returns:list that contains pairs of atom indices
Return type:list
getAllTorsions(st)

This function returns list that contains lists of atoms for each torsion angle in a given structure.

Parameters:st (schrodinger.structure.Structure) – structure
Returns:list that contains lists of atom indices for each torsion
Return type:list
getConvergenceKeywords()

Get keywords from convergence criteria widgets.

Returns:A dictionary of keywords
Return type:dict
getMmJagKeywords()

This function returns dictionary of mmjag keywords for this tab. Since this tab does not set any keywords it returns an empty dictionary.

Returns:mmjag keywords dictionary
Return type:dict
loadConstraintCoordinates(jag_input)

Load constraint coordinates from Jaguar handle.

Parameters:jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar handle where tab settings are saved.
loadConvergenceKeywords(jag_input)

Load the convergence criteria settings.

Parameters:jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar settings to load.
loadSettings(jag_input)

Restore scan coordinates settings from Jaguar handle.

Parameters:jag_input (schrodinger.application.jaguar.input.JaguarInput) – The Jaguar settings to base the tab settings on
pickCompleted(atoms)

This slot is called when required number of atoms for the current coordinate type has been picked.

Parameters:atoms (list) – list of atom indices
saveSettings(jag_input, eid=None)

Save constraint coordinate settings in jaguar handle.

See parent class for argument documentation

setup()
updateAllConstraintsPB()

This function is called when coordinate type is changed to update text and visibility of the button that adds all constraints.