schrodinger.application.desmond.feputils module

schrodinger.application.desmond.feputils.run_protein_reliability(protein_file)

Takes a protein ct and returns a message indicating problems, if any.

WARNING: This function runs very slowly (i.e., easily around 20 seconds).

Parameters:protein_file (schrodinger.structure.Structure) – A protein to assess
Returns:A tuple that contains a message indicating any problems with the protein and model that can be used to bring up protein reliability panel.
Return type:tuple
schrodinger.application.desmond.feputils.read_protein_reliability(p, std_err, reportfile, outputfile)
schrodinger.application.desmond.feputils.launch_protein_reliability(protein_file)
schrodinger.application.desmond.feputils.is_prepped(protein)

Check if a protein has been prepared in Protein PrepWizard

Parameters:protein (protein: schrodinger.structure.Structure) – protein to check
class schrodinger.application.desmond.feputils.ProteinProcessManager(protein_file)

Bases: object

A lightweight thread that spawns the protein reliability process to run in the background.

start()
poll()
terminate()
isRunning()
results()
class schrodinger.application.desmond.feputils.LabelSpinner(text=None, parent=None)

Bases: PyQt5.QtWidgets.QLabel

A label that can replace its icon with a spinning progress icon.

DEFAULT_ICON_HEIGHT = 10
ANIMATION_TIME = 250
animationTimeElapsed
updateAnimationSize()

Set the size of the spinner animation to the height of the current permanent icon, or else some default value if it is not available.

updatePermanentPic()

Set the permenent icon picture to the current pixmap value and update the size of the spinner animation to match.

setPixmap(pixmap)

Set a new pixmap, and update the spinner animation frames in response.

The setTemporaryPixmap() method should be called internally when setting a temporary pixmap for the spinner animation frames and other temporary icon images.

Parameters:pixmap (QtGui.QPixmap) – the icon to be displayed by this label
setTemporaryPixmap(pixmap)

Set the displayed pixmap without overwriting the “permanent” cached pixmap value or altering the size of the animation frames. Meant to be used to display animation frames or other temporary icon images.

Parameters:pixmap (QtGui.QPixmap) – the icon to be displayed by this label
updateAnimation()

Advance the animation by one frame. This method gets called periodically while the spinner is running.

start()

Start the spinner animation.

stop()

Stop the spinner animation and restore the original icon.

class schrodinger.application.desmond.feputils.BaseSpinnerWidget(*args, **kwargs)

Bases: schrodinger.ui.qt.widgetmixins.InitMixin, PyQt5.QtWidgets.QWidget

A widget that maintains a label and a button for displaying health check status information.

Variables:tooltip_calculating (str) – the tooltip text for when the health is being calculated
tooltip_calculating = ''
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets.

initSetUp()

Creates widget from ui and stores it ui_widget.

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

initLayOut()

Create a vertical layout for the widget (widget_layout) and populate it with two vertical sub-layouts: main_layout and bottom_layout.

If the user has specified the ui data member, insert the resultant ui_widget into main_layout.

If the widget already has a layout defined, this method will produce a warning (but not a traceback). main_layout and bottom_layout will be inserted into the existing widget layout, which will not be the same as widget_layout. It is therefore recommended that this mixin is used only with widgets that do not already have a layout.

Suggested subclass use: create, initialize, and populate layouts.

initFinalize()

Suggested subclass use: perform any remaining initialization.

showSubwidgets(show_label, show_button)

Convenience method for showing or hiding the label and button.

Raise:

ValueError

Parameters:
  • show_label (bool) – whether to show the label
  • show_button (bool) – whether to show the button
start()

Display a spinning animation in the label widget.

stop()

Stop the animation and restore the original icon.

setButtonIcon(icon)
Parameters:icon (QtGui.QIcon) – the icon to display in the button
setLabelPixmap(pixmap)
Parameters:pixmap (QtGui.QPixmap) – the pixmap to display in the label
clearLabelPixmap()

Replace the label pixmap with a transparent pixmap.

setLabelToolTip(text)
setButtonToolTip(text)
class schrodinger.application.desmond.feputils.ProteinCheckSpinnerWidget(parent=None, use_cache=False)

Bases: schrodinger.application.desmond.feputils.BaseSpinnerWidget

results_cache = {}
tooltip_calculating = 'Calculating protein health'
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets.

initSetUp()

Creates widget from ui and stores it ui_widget.

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

initSetDefaults()

Set widget to its default state. If the widget uses a model/mapper, it’s preferable to reset the widget state by resetting the model.

start()

Start the protein health check and spinner animation.

startValidate()
Returns:whether a health check needs to be run
Return type:bool
stop()

Stop the spinner animation and health check process.

update()

Check if the reliability calculation is finished and if so, stop the spinner and display the results.

updateToolTips()

Update widget tooltips depending on the status of the health check.

finish()

Display the health check results. If there are any problems, the warning label is set to visible and the tooltop will report the issue. If there are no problems, the label is hidden.

setProtein(protein)

Set the protein for the spinner, stopping and restarting the spinner with the new protein if it has changed or if _use_cache is False. :param protein: the new protein :type protein: structure.Structure

showProteinHealthReport()

Bring up protein reliability panel to show results of protein check.

schrodinger.application.desmond.feputils.truncate_label(label, label_string, max_chars=40)

Sets the text on a label to label_string, truncating the text if necessary and setting the full text in a tooltip, if the text has been truncated. The original tooltip text will be returned.

Parameters:
  • label (QtWidgets.QLabel) – the label to modify
  • label_string (str) – the text for the label
  • max_chars (int) – maximum number of characters in the label text
Returns:

the original tooltip text

Return type:

str

schrodinger.application.desmond.feputils.get_protein_label_string(ct)

Returns a string for use in GUI to indicate the protein. Returns the title if available; otherwise returns a short description. If called with None, returns “–”.

Parameters:ct (schrodinger.structure.Structure) – the protein
schrodinger.application.desmond.feputils.format_structure_label(ct, label, max_chars=40)

Sets the protein name on a label, truncating the text if necessary and setting the untruncated text in a tooltip, if the text has been truncated.

Parameters:
  • ct (schrodinger.structure.Structure) – the protein
  • label (QtWidgets.QLabel) – The label to modify
  • max_chars (int) – The max number of characters to allow on the label
schrodinger.application.desmond.feputils.get_proteins(ct_list)

Iterates through a list of structures and returns only the proteins

Parameters:ct_list (list) – a list of structures
schrodinger.application.desmond.feputils.get_ligands(ct_list)

Iterates through a list of structures and returns only the ligands.

Parameters:ct_list (list) – a list of structures
schrodinger.application.desmond.feputils.import_pt_entries()

Imports selected entries from the project table. For convenience, workspace-included proteins are also imported.

Returns:a list of imported structures. Each structure is tagged with a property ‘s_fepmapper_entryid’ to store the entry id.
Return type:list
schrodinger.application.desmond.feputils.import_pv_file(filename)

Imports a list of structures from a structure file. Typically used on PV files, but can be used on any structure file. :param filename: the filename :type filename: str

schrodinger.application.desmond.feputils.get_opls_dir_setting()
schrodinger.application.desmond.feputils.make_fep_cmd(cd_params, ao, jobname, struct_fname, opt=[], use_custom_opls=True)

Generates an FEP command list based on the specified parameters.

Parameters:
  • cd_params (dict) – config dialog parameters
  • ao (dict) – FEP Advanced Options (AO) parameters
  • jobname (str) – the jobname
  • master_msj_fname (str) – the filename for the master msj file
  • struct_fname (str) – the filename for the input structure
  • use_custom_opls (bool) – whether the custom opls parameters will be used. If False, the default built-in opls parameters will be used.
Returns:

a command list for launching the job

Return type:

list

schrodinger.application.desmond.feputils.generate_scripts(cd_params, jobname, cmd, opls_dir_setting)