schrodinger.trajectory.trajectory_gui_dir.energy_plots module

Functions and classes specific to energy trajectory plots.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.iter_children(item)

Iterate over all children of a QTreeWidgetItem.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.iter_tree_items(tree_widget)

Iterate over all items (both top level and their children) of a QTreeWidget.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_all_grouped_sets(st)

Return a dict of ASLs, one for each group, for all substructure set groups found in the structure.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_all_individual_sets(st)

Return a list of ASLs, one for each substructure set (ungrouped). Each ligand molecule and protein chain will be assigned its own set. Other substructures are still grouped together by type.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_sets_for_all_molecules(st)

Assign each molecule to its own set. Useful only for structure with few molecules (no solvent)

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_ligands(st)

Return a list of (ligand name, ASL) for all ligands found in the structure.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_proteins(st)

Find protein chains in the given structure.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_solvents(st)

Find solvents (including water) in the given structure.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.find_other(st)

Find metals, ions, membranes, DNA, and RNA in the given structure.

class schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetRow(name, asl, num_atoms)

Bases: object

Class representing a row in the custom ASL dialog’s sets table.

__init__(name, asl, num_atoms)
class schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetsColumns(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.TableColumns

Columns of the CustomAslSetsTableModel table.

SetName = Column 0 (Set Name)
ASL = Column 1 (ASL)
NumAtoms = Column 2 (# Atoms)
class schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetsTableModel(parent=None)

Bases: schrodinger.ui.qt.table_helper.RowBasedTableModel

Model for the table at the bottom of the “Define Custom ASL Sets” dialog.

Column

alias of schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetsColumns

ROW_CLASS

alias of schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetRow

class schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomAslSetsDialog(st, parent=None)

Bases: schrodinger.ui.qt.basewidgets.BaseDialog

Dialog for defining sets via custom ASLs.

Variables

setsDefined – A signal emitted when OK button is pressed after defining new sets.

ui_module = <module 'schrodinger.trajectory.trajectory_gui_dir.custom_asl_sets_dialog_ui' from '/scr/buildbot/savedbuilds/2024-2/NB/build-134/internal/lib/python3.11/site-packages/schrodinger/trajectory/trajectory_gui_dir/custom_asl_sets_dialog_ui.py'>
setsDefined

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__(st, parent=None)
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

createUniqueSetName()
setTableSelectionChanged()
okPressed()
class schrodinger.trajectory.trajectory_gui_dir.energy_plots.CustomSubstructureSetsDialog(st, parent=None)

Bases: schrodinger.ui.qt.basewidgets.BaseDialog

Dialog for defining which substructure sets to use for generating energy plots. Substructure sets are automatically detected in a manner similar to what is used by Structure Hierarchy. User is able to specify up to 10 of those sets to use for energy interaction calculations.

Variables

setsDefined – A signal emitted when OK button is pressed after defining new sets.

ui_module = <module 'schrodinger.trajectory.trajectory_gui_dir.custom_substructure_sets_dialog_ui' from '/scr/buildbot/savedbuilds/2024-2/NB/build-134/internal/lib/python3.11/site-packages/schrodinger/trajectory/trajectory_gui_dir/custom_substructure_sets_dialog_ui.py'>
setsDefined

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.

NAME_COL = 0
ASL_ROLE = 257
IN_USE_ROLE = 258
addItem(parent, name, asl)

Create a new QTreeWidgetItem name and ASL, and add it to the parent.

addGroup(group_name, sets)

Add given sets grouped together under a top-level parent. If only one item is present in the set, no parent is created, and that set is added as a top-level item. If no sets are present, nothing is done.

__init__(st, parent=None)
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).

initSetUp()

Creates widget from ui and stores it ui_widget.

Suggested subclass use: create and initialize subwidgets, and connect signals.

treeSelectionChanged()
listSelectionChanged()
addSelectedSets()

Called when the “Add >” button is clicked. An item will be added to the right table for each item selected in the left tree table. Items in the tree table will be hidden. When a group is added, all of its children are also hidden.

removeSelectedSets()
okPressed()
class schrodinger.trajectory.trajectory_gui_dir.energy_plots.EnergyJobSettingsDialog(*args, **kwargs)

Bases: schrodinger.ui.qt.basewidgets.BaseOptionsDialog

Dialog for letting the user select the host to run the energy analysis jobs on. Must be a remote host on Mac & Windows machines, as Desmond requires Linux.

model_class

alias of schrodinger.trajectory.trajectory_gui_dir.traj_plot_models.TrajectoryEnergyJobTask.JobConfig

ui_module = <module 'schrodinger.trajectory.trajectory_gui_dir.job_settings_dialog_ui' from '/scr/buildbot/savedbuilds/2024-2/NB/build-134/internal/lib/python3.11/site-packages/schrodinger/trajectory/trajectory_gui_dir/job_settings_dialog_ui.py'>
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).

defineMappings()

Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:

  1. a basic widget, like QLineEdit or QComboBox

  2. a custom object that inherits MapperMixin or TargetMixin

  3. a TargetSpec instance

  4. a slot

For common widgets, standard signals and getter/setter methods will be used, as defined in mappers._get_default_access_names().

For more fine-grained custom control, instantiate a TargetSpec object, which allows custom setters, getters, and signals to be specified.

Supplying a slot as the first element of the tuple is equivalent to providing TargetSpec(slot=my_slot).

Note that all target slots are triggered on setModel() as well as in response to the specified signal.

The param is an abstract param reference, e.g. MyModel.my_param.

Example:

def defineMappings(self):
    combo = self.style_combo
    return [(self.name_le, MyModel.name),
            (TargetSpec(combo,
                    getter=combo.currentText,
                    setter=combo.setCurrentText), MyModel.style),
            (self.coord_widget, MyModel.coord),
            (self._onASLTextChanged, MyModel.asl_text)]
isDoNotShowChecked()
showDialog(show_cb=False)

Sets the visibility of the “do not show again” checkbox, then execs the dialog

Parameters

show_cb (bool) – Whether to show “do not show again” checkbox

class schrodinger.trajectory.trajectory_gui_dir.energy_plots.BrowseCfgFileDialog(cfg_file)

Bases: PyQt6.QtWidgets.QDialog

Dialog box for asking the user to select a CFG file.

__init__(cfg_file)
browseCfgFile()
askForNewCfgFile()

Show the dialog, and when it’s dismissed, return the path to the new CFG file, or None if dialog was cancelled.

schrodinger.trajectory.trajectory_gui_dir.energy_plots.parse_results_file(results_file)

Parse the given results file (generated by analyze_simulation.py) and and return data needed for generating a plot.

Parameters

results_file (str) – Result text file

Returns

(Energy data, List of set ASLs, List of trajectory frame times in picoseconds).

Return type

(sea.Map, list, list)

schrodinger.trajectory.trajectory_gui_dir.energy_plots.sum_results(results, use_sets, use_terms, include_self)

Return a list of energies, one for each frame, by summing up the terms specified by “use_terms” for interactions between sets specified via “use_sets”.

Parameters
  • results (sea.Map) – Energy data returned by parse_results_file().

  • use_sets (list(str)) – Which set names to sum energy for.

  • use_terms (list(str)) – Which terms to sum up. One or more of: elec, vdw, stretch, angle, dihedral.

  • include_self (bool) – Whether to include terms within each set. If False, include energies for interactions between terms are included.

Returns

Energy plot data, as a numpy array. Each item represents a frame, and value is the total energy.

Return type

numpy.array or None

schrodinger.trajectory.trajectory_gui_dir.energy_plots.format_results_by_frame(results)

Assemble energies from the backend result object into a dict, where keys are strings representing the energy term (e.g. sel000_vdw, sel000_es, sel000-sel001_ele), and values are lists of energies for all frames. Used for export to Excel.

Parameters

results (sea.Map) – Energy data returned by parse_results_file().

Returns

Dictionary of energies by term.

Return type

dict(str, list(float))