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 assessReturns: 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.
ProteinCheckLabelSpinner
(parent=None, use_cache=False)¶ Bases:
schrodinger.ui.qt.widgetmixins.InitMixin
,PyQt5.QtWidgets.QWidget
-
results_cache
= {}¶
-
initSetOptions
()¶ Suggested subclass use: set instance variables, excluding layouts and subwidgets.
-
initSetUp
()¶ Creates widget from
ui
and stores itui_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
andbottom_layout
.If the user has specified the
ui
data member, insert the resultantui_widget
intomain_layout
.Suggested subclass use: create, initialize, and populate layouts.
-
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.
-
initFinalize
()¶ Suggested subclass use: perform any remaining initialization.
-
showSubwidgets
(show_label, show_button)¶ Convenience method for showing or hiding the label and button.
Parameters: - show_label (bool) – whether to show the label
- show_button (bool) – whether to show the button
-
start
()¶
-
stop
()¶ Stop the animation and restore the original icon
-
update
()¶ Check if the reliability calculation is finished and if so, stop the spinner and display the results.
-
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
-
finish
()¶ Display the results of the protein reliability check. If there are any problems, the warning label is set to visible and the tooltop set to the problem report. If there are no problems, the label is hidden.
-
showProteinHealthReport
()¶ Bring up protein reliability panel to show results of protein check.
-
setLabelPixmap
(pixmap)¶
-
setLabelTooltip
(text)¶
-
-
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_protein_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
- ct (
-
schrodinger.application.desmond.feputils.
setup_protein_warning
(protein_label, protein_warning_label)¶ Utility function to set up a protein warning label. This is done to provide a consistent look for protein warnings across several panels.
Parameters: - protein_label (QtWidgets.QLabel) – The protein or receptor label
- protein_warning_label (QtWidgets.QLabel) – The label that will hold the warning image
utility function to set up protein health toolbutton. This button becomes visible when protein health check detects any problems. This is done to provide consistent look across several panels.
Parameters: protein_health_btn (QtWidgets.QToolButton) – toolbutton that is used to bring up protein relaiability report panel.
-
schrodinger.application.desmond.feputils.
get_warning_pixmap
(widget_height, widget_width=None)¶ Returns a standardized pixmap for a given widget size
-
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)¶