schrodinger.application.jaguar.gui.tabs.coordinates module

class schrodinger.application.jaguar.gui.tabs.coordinates.CoordinateTab(parent, input_selector=None)

Bases: schrodinger.application.jaguar.gui.tabs.base_tab.BaseTab

A parent class for the Scan and Optimization tabs

Variables
  • coordinateAdded (PyQt5.QtCore.pyqtSignal) –

    A signal emitted when user adds new coordinate. The signal is emitted with:

    • a list of atom numbers

    • coordinate type

  • coordinateDeleted (PyQt5.QtCore.pyqtSignal) – A signal emitted when user deletes a coordinate. Emitted with a list of atom numbers.

  • allCoordinatesDeleted (PyQt5.QtCore.pyqtSignal) – A signal emitted when all coordinates are deleted. Emitted with no arguments.

  • coordinateSelected (PyQt5.QtCore.pyqtSignal) – A signal emitted when user selects a coordinate in the table. Emitted with a list of atom numbers for the selected coordinate.

  • coordinateDeselected (PyQt5.QtCore.pyqtSignal) – A signal emitted when user deselects a coordinate in the table. Emitted with a list of atom numbers for the deselected coordinate.

  • refreshMarkers – A signal emitted when the workspace markers should be refreshed, i.e., when we should make sure that only markers for the currently selected tab are displayed.

coordinateAdded

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

coordinateDeleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

allCoordinatesDeleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

coordinateSelected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

coordinateDeselected

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

refreshMarkers

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setup()

Perform tab specific initialization. This function should be defined in subclasses if initialization is needed.

getSelectedRowAtoms()

The function returns selected row atoms.

Returns

A list of atom indices

Return type

list

setAcceptableContraintEids(eids, picking_err)

Set the constraint picking restrictions

Parameters
  • eids (set) – The entry ids for which coordinate picking is acceptable.

  • picking_err (str or NoneType) – If picking should not be allowed at all, this is the text of the error that will displayed to the user. If picking is allowed, should be None.

stopPicking()

Stop constraint picking

getMarkerAtoms()

Return a list of atoms that should be marked in the maestro workspace. Returns a list of unique atoms because marker can not be created more than one time on same atom.

Return type

list

removeCoordinate(atoms, coordinate_type)

Remove atoms from model class.

Parameters
  • atoms (list) – atom indices

  • coordinate_type (int) – coordinate type

class schrodinger.application.jaguar.gui.tabs.coordinates.CoordinatePicker(coordinate_types, pick_cb, coord_type_combo, pick_combo, parent=None)

Bases: PyQt6.QtCore.QObject

This class is responsible for atom and bond picking. Depending on the type of coordinate it will fill up the list of picked atoms up to a max size for the current coordinate type before emitting a signal.

Variables
  • pickCompleted (PyQt5.QtCore.pyqtSignal) – A signal emitted when the user picks required number of atoms for current coordinate type. This signal is emitted with a list of picked atoms as an argument.

  • PICK_MAX_ATOMS (dict) – A dictionary that maps mmjag coordinate type to max number of atoms needed to define this coordinate. It should include all coordinate types used in Jaguar Scan and Optimization tabs, where picker is used.

pickCompleted

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

PINK = (1.0, 0.8, 0.8)
PICK_MAX_ATOMS = {0: 1, 1: 1, 2: 1, 3: 1, 4: 2, 5: 3, 6: 4}
__init__(coordinate_types, pick_cb, coord_type_combo, pick_combo, parent=None)

Picker class initializer.

Parameters
  • coordinate_types (collections.OrderedDict) – ordered dictionary that contains coordinate types that should be made available in the picker.

  • pick_cb (QtWidgets.QCheckBox) – check box used to pick atoms or bonds

  • coord_type_combo (QtWidgets.QComboBox) – combo box that allows to select coordinate type such as distance, angle etc.

  • pick_combo (QtWidgets.QComboBox) – combo box that allows to select pick type: atom or bond.

populateTypeCombo()

This function is used to initialize coordinate type combox box.

populatePickCombo()

This function repopulates pick combo box depending on the current selection of coordinate type. It also attempts to preserve current pick type selection if possible.

coordinateTypeChanged()

This slot is called when coordinate type is changed.

class schrodinger.application.jaguar.gui.tabs.coordinates.CoordinateData(st, atoms, coordinate_type)

Bases: object

This class is a base class for constraint and scan coordinate classes. It should not(!) be initialized by itself.

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

  • COLUMN (object) – class that contains information about columns in which coordinates data is displayed. It should contain NAMES variable for column names and indices of columns. This object needs to be initialize in derived classes.

__init__(st, atoms, coordinate_type)

Initialize coordinates data given a structure, set of atom indices and coordinate type. We apply the jaguar naming scheme to the structure.

Parameters
validate()

This function checks that atom indices contain correct number of elements for a given coordinate type. If thats not the case ValueError exception is raised.

class schrodinger.application.jaguar.gui.tabs.coordinates.CoordinatesModel(parent=None)

Bases: PyQt6.QtCore.QAbstractTableModel

A base class for cordinates models used for constraint and scan coordinates in Scan and Optimization tabs. This class should not(!) be initialized on its own. This model is used with Qt view.

Variables

COLUMN (object) – class that contains information about columns in which coordinates data is displayed. It should contain NAMES variable for column names and indices of columns. This object needs to be initialize in derived classes.

COLUMN = None
__init__(parent=None)
headerData(section, orientation, role)

Retrieve the requested header data. This data is used to show Qt view column/row headers.

Parameters
  • section (int) – The row/column number to retrieve header data for

  • orientation (int) – The orientation of the header (Qt.Horizontal or Qt.Vertical) to retrieve data for

  • role (int) – The role to retrieve header data for

rowCount(parent=None)

Return the number of rows in the model

Parameters

parent – Unused, but preset for PyQt compatibility

Returns

The number of rows in the model.

Return type

int

columnCount(parent=None)

Return the number of columns in the model

Parameters

parent – Unused, but preset for PyQt compatibility

Returns

The number of columns in the model.

Return type

int

checkNewCoordinate(atoms, coordinate_type)

This function check whether this coordinate is already present in this model.

Parameters
  • atoms (list) – atom indices

  • coordinate_type (int) – coordinate type

Returns

True if this coordinate has not been found and False otherwise.

Return type

bool

reset()

Remove any existing data

removeRow(row, parent=<PyQt6.QtCore.QModelIndex object>)

Removes the given row from the child items of the parent specified. Returns true if the row is removed; otherwise returns false.

Parameters
  • row (int) – row index

  • index (QtCore.QModelIndex) – parent index

Returns

True or False

Return type

bool

removeCoordinate(atoms, coordinate_type)

This function searches for a given coordinate. If match is found coordinate is removed.

Parameters
  • atoms (list) – atom indices

  • coordinate_type (int) – coordinate type

Returns

True if this coordinate was found and removed, False otherwise.

Return type

bool

findCoordinate(atoms, coordinate_type)

This function searches for coordinate defined by atoms list and coordinate type. If match is found this function returns row index and None otherwise.

Parameters
  • atoms (list) – atom indices

  • coordinate_type (int) – coordinate type

Returns

row index if this coordinate has been found and None otherwise.

Return type

int or None