schrodinger.ui.qt.ligand_list module¶
Present a list of all ligands that have been included in the Workspace or selected in the project, and allow the user to select their desired ligand or ligands.
LigandListWidget
is the standard widget for including this list in a panel.
- class schrodinger.ui.qt.ligand_list.LigSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
- included = 1¶
- selected = 2¶
- class schrodinger.ui.qt.ligand_list.Ligand(found_lig, proj_row)¶
Bases:
object
An object representing one ligand in the list. Contains a reference to the analyze.Ligand object.
- __init__(found_lig, proj_row)¶
- Parameters
found_lig (
schrodinger.structutils.analyze.Ligand
) – The ligand object found usingschrodinger. structutils.analyze.AslLigandSearcher
proj_row (
schrodinger.project.ProjectRow
) – The Project Table row
- property struc¶
- getName(only_one_entry)¶
Get the name to use for this ligand in the ligand list. If the ligand is the entire entry, the structure title will be used. Otherwise, the entry title followed by the residue name and number will be used (or a multiple residue names and numbers for ligands that span multiple residues).
- Parameters
only_one_entry (bool) – Whether only one entry is included in the workspace (all ligands in the list came from it). In this case, the entry title will be excluded from the row name. Note that this setting will be ignored when the ligand is the entire entry.
- Returns
The properly formatted name
- Return type
str
- class schrodinger.ui.qt.ligand_list.LigandListView(parent=None)¶
Bases:
schrodinger.ui.qt.appframework2.markers.MarkerMixin
,PyQt6.QtWidgets.QListView
A list view for ligands. Note that multiple ligand selection can be enabled via
ligand_list_view.setSelectionMode(QtWidgets.QListView.ExtendedSelection)
.- Variables
ligandSelectionChanged (
QtCore.pyqtSignal
) – A signal emitted when the selected ligands have changed.
- ligandSelectionChanged¶
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.
- __init__(parent=None)¶
- setAutoInclude(auto_include)¶
Specify whether ligands should be included in the Workspace when they are selected in the list. Only relevant when selecting ligands that are selected the Project Table.
- Parameters
auto_include (bool) – True if ligands should be included. False otherwise.
- setAutoFit(auto_fit)¶
Specify whether ligands should be zoomed in on in the Workspace when they are selected in the list. Requires auto-include.
- Parameters
auto_fit (bool) – True if ligands should be zoomed in on. False otherwise.
- setMarkSelectedLigands(use_markers)¶
Specify whether ligands that are selected in the ligand list should be marked in the workspace. See
setMarkerColor
to control the marker color.- Parameters
use_markers (bool) – True if workspace markers should be used. False otherwise.
- setMarkerColor(color)¶
Specify the color of the workspace markers used to mark selected ligands. Only has an effect if
setMarkSelectedLigands
has been set to True.- Parameters
color (tuple) – A tuple of RGB float values for the marker color.
- selectLigandsFromAtoms(atoms)¶
Select all ligands containing the specified atom(s).
- Parameters
atoms (list or
schrodinger.structure._StructureAtom
) – A list of atoms (schrodinger.structure._StructureAtom
) or a singleschrodinger.structure._StructureAtom
. This atom must be from a Workspace or Project Table structure.- Raises
ValueError – If
atoms
doesn’t specify any ligands. ValueError will also be raised ifatoms
specified more than one ligand and the view is in SingleSelection selection mode.
- selectLigandsFromWorkspaceAtomNums(atom_nums)¶
Select all ligands containing the specified atom(s).
- Parameters
atoms (list or int) – A list of Workspace atom numbers (ints) or a single Workspace atom number.
- Raises
ValueError – If
atom_nums
doesn’t specify any ligands. ValueError will also be raised ifatom_nums
specified more than one ligand and the view is in SingleSelection selection mode.
- selectionChanged(self, selected: QItemSelection, deselected: QItemSelection)¶
- selectIfNoSelection()¶
When called this function will select the first ligand in the list if no other ligand in the list is currently selected.
- setModel(self, model: QAbstractItemModel)¶
- class schrodinger.ui.qt.ligand_list.LigandListWidget(parent=None)¶
Bases:
schrodinger.ui.qt.appframework2.maestro_callback.MaestroCallbackWidgetMixin
,schrodinger.ui.qt.ligand_list.LigandListView
A list view for ligands that contains its own model. The model will be automatically updated whenever the project changes. As with
LigandListView
, multiple ligand selection can be enabled vialigand_list_widget.setSelectionMode(QtWidgets.QListView.ExtendedSelection)
.- __init__(parent=None)¶
- setLigandSource(source)¶
Specify whether ligands should be taken from selected or included Project Table entries.
- Parameters
source (
LigSource
) – The desired ligand source.
- ligandSource()¶
Return whether ligands are currently being taken from selected or included Project Table entries.
- Returns
The current ligand source.
- Return type
- projectChanged()¶
- projectClose()¶
- class schrodinger.ui.qt.ligand_list.LigandListModel(parent=None, source=LigSource.included)¶
Bases:
schrodinger.ui.qt.table_helper.RowBasedListModel
- __init__(parent=None, source=LigSource.included)¶
- Parameters
parent (
QtWidgets.QWidget
or NoneType) – The Qt parent widget.source (
LigSource
) – The desired ligand source.
- setLigandSource(source)¶
Specify whether ligands should be taken from selected or included Project Table entries.
- Parameters
source (
LigSource
) – The desired ligand source.
- ligandSource()¶
Return whether ligands are currently being taken from selected or included Project Table entries.
- Returns
The current ligand source.
- Return type
- updateLigandList()¶
Update the contents of the model. This method should be called whenever project inclusion or selection changes.
- atomToLigNumMapping()¶
Return a dictionary of {(entry id, atom number): ligand row number} for all atoms in all ligands in the table.