schrodinger.application.phase.phase_markers module

Phase pharmacophore workspace markers.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.phase.phase_markers.PhaseFeatureMarker(site, entry_id, color, use_highlight, allow_picking=True)

Bases: object

Class defining a single Phase marker.

ALLOWED_TO_MATCH = 'Allowed to match'
ARROW_RADII = 0.065
FEATURE_TYPE = 'Feature Type'
FORBIDDEN_TO_MATCH = 'Forbidden to match'
GLOW_COLOR = (0.95, 0.5, 0.25)
OPACITY_DEFAULT = 0.4
OPACITY_SELECTED = 1.0
SELECTED_COLOR = (0.25, 0.5, 0.95)
SPHERE_RADII = 0.4
TOLERANCE = 'Tolerance'
TORUS_RADII = 0.45
TORUS_TUBE_RADII = 0.12
USE_IN_SCREEN = 'Use in Screening'
XP_SCORE = 'XP Score'
clear()
clearLabels()

Remove all marker labels.

createLabels()

Create the labels for the sites of this feature in the Workspace.

feature_coordinates

List of coordinates of the main site and any projected coordinates

feature_counter = 1
feature_name

Display name of the pharmacophore site

feature_type

Phase type string of the pharmacophore site

getHypoID()

Return the hypothesis name/ID for the hypothesis from which this feature is from.

hide()
is_projected

Whether the marker represents a Q projected feature

setIsGlowing(is_glowing)

Enables or disables glow effect for the object.

Parameters:is_glowing (bool) – whether the object is glowing
setRightClickHandler(pick_category)

Sets right click handler for a given pick category.

Parameters:
  • pick_category – picking category of markers
  • type – str
setSelected(select)

Shows glow effect when this feature is selected.

Parameters:select (bool) – whether this feature should be selected
show()
class schrodinger.application.phase.phase_markers.PhaseMarkers(*args, **kwargs)

Bases: PyQt5.QtCore.QObject

Class for adding pharmacophore feature markers and controlling their visibility.

Variables:
  • editingFinished (QtCore.pyqtSignal) – signal that gets emitted when feature editing is finished. This signal is emitted regardless of whether feature was changed or not.
  • closeFeatureEditDialog (QtCore.pyqtSignal) – signal that gets emitted when any open edit feature dialog should be closed. This signal is emitted when the Phase GUI workflow changes, or the panel is closed.
addFeaturesForWorkspaceLigands(fds, allow_picking=True)

Add feature markers for each included ligand PT entry, according to the given feature definitions.

Parameters:
  • fds – list of feature definitions
  • allow_picking – indicates whether feature can be ‘picked’. When enabled this would make possible to show context menu when feature is right-clicked. Default is True.

:type allow_picking

Return type:list of ints
Returns:List of entry IDs for the included ligands.
addRefCtMarker(entry_id, ref_ct)

Adds reference ligand markers for a given entry ID.

Parameters:
  • entry_id (str) – entry ID
  • ref_ct (int) – data object that contains reference ligands

:note ownership is transferred to maestro project.

addSites(sites, entry_id, use_highlight=False, allow_picking=True)

Add pharmacophore features for given sites.

Parameters:
  • sites (list of phase.PhpSite) – list of pharmacophore sites
  • entry_id (int) – structure entry id
  • use_highlight (list) – indicates whether sites should be ‘highlighted’
  • allow_picking (bool) – whether this marker can be ‘picked’, which allows showing a context menu when right-clicked
addStructureFeatures(st, fds, entry_id, allow_picking=True)

Add all pharmacophore feature markers for a given structure.

Parameters:
  • st (structure.Structure) – molecule structure
  • fds (list) – list of feature definitions
  • entry_id (int) – structure entry id
  • allow_picking (bool) – whether this marker can be ‘picked’, which allows showing a context menu when right-clicked
Returns:

list of sites that were added for this structure

Return type:

list

addTolMarkers(entry_id, sites)

Adds tolerance markers for a given entry ID.

Parameters:
  • entry_id (int) – entry ID
  • sites (list of phase.PhpSite) – Phase hypothesis sites
addXvolMarkers(entry_id, x_vol, interactive=False)

Adds excluded volume markers for a given entry ID.

Parameters:
  • entry_id (int) – entry ID
  • x_vol (phase.PhpExclVol) – data object that contains excluded volumes
  • interactive (bool) – indicates whether markers should be ‘interactive’
clearSelection()

Clear ‘selection’ for all pharmacophore features.

closeFeatureEditDialog
editingFinished
featureExists(entry_id)

This function checks whether pharmacophore features exist for a structure with a given entry_id and returns True or False.

Parameters:entry_id (int) – structure entry_id
Returns:True if features were already added and False otherwise
Return type:bool
findXvolSphereIndex(entry_id, pick_id)

Finds excluded volume sphere index for a given sphere pick id. Pick id is used to identify graphics3d objects picked in the Workspace.

Parameters:
  • entry_id (int) – entry ID
  • pick_id (int) – pick id of graphics3d object
Returns:

index of sphere with a given pick id in the list that PhaseXvolMarkers object maintains.

Return type:

int

getAllFeatures()

Retrieve markers for all features.

Returns:list of pharmacophore markers
Return type:list
getFeature(feature_name, entry_id)

Retrieve markers for the specified feature.

Parameters:
  • feature_name (str) – feature name
  • entry_id (int) – entry id of the structure that this feature is associated with
Returns:

tuple that contains pharmacophore and projected points marker

Return type:

tuple

getFeatureFromId(marker_id)

Return the marker with the given ID.

Parameters:marker_id (int) – ID of the marker (.id attribute)

:return Marker object :rtype PhaseFeatureMarker

getFeatureNames(entry_id)

Get list of feature names that were found for the structure with a given entry id. Feature names are sorted in alphabetical order.

Parameters:entry_id (int) – entry_id

:return; list of feature names :rtype: list

getSites(entry_id)

Get list of sites for all features with a given entry id.

Parameters:entry_id (int) – entry_id
Returns:list of sites
Return type:list
hasRefCtMarker(entry_id)

Checks whether refernce ligand marker for a given entry ID exists.

Parameters:entry_id (int) – entry ID
hasTolMarkers(entry_id)

Checks whether tolerance markers for a given entry ID exist.

Parameters:entry_id (int) – entry ID
hasXvolMarkers(entry_id)

Checks whether excluded volume markers for a given entry ID exist.

Parameters:entry_id (int) – entry ID
hideAllFeatures()

Hide markers for all pharmacophore features.

hideAllFeaturesForEntry(entry_id)

Hide markers for all features associated with a given entry.

Parameters:entry_id (int) – entry id of the structure that this feature is associated with
hideFeature(feature_name, entry_id)

Hide markers for the specified pharmacophore feature.

Parameters:
  • feature_name – feature name
  • feature_name – str
  • entry_id (int) – entry id of the structure that this feature is associated with
projectModel()

Returns a Maestro project object.

Return type:schrodinger.MM_Project
Returns:Maestro project object.
removeAllFeatures()

Removes markers for all pharmacophore features.

removeAllFeaturesForEntry(entry_id)

Removes markers for all features associated with a given entry.

Parameters:entry_id (int) – entry id of the structure that this feature is associated with
removeAllRefCtMarkers()

Removes all reference ligand markers.

removeAllTolMarkers()

Removes all tolerance markers.

removeAllXvolMarkers()

Removes all excluded volume markers.

removeFeature(feature_name, entry_id)

Removes markers for the specified pharmacophore feature.

Parameters:
  • feature_name – feature name
  • feature_name – str
  • entry_id (int) – entry id of the structure that this feature is associated with
removeRefCtMarker(entry_id)

Removes all reference ligand markers for a given entry.

Parameters:entry_id (int) – entry ID
removeTolMarkers(entry_id)

Removes all tolerance markers for a given entry.

Parameters:entry_id (int) – entry ID
removeXvolMarkers(entry_id)

Removes all excluded volume markers for a given entry.

Parameters:entry_id (int) – entry ID
removeXvolMarkersWithIDs(entry_id, sphere_indices)

Removes excluded volume markers with specified sphere ids for a given entry.

Parameters:
  • entry_id (int) – entry ID
  • sphere_indices (list) – list of sphere indices
setFeatureSelection(feature_name, entry_id, selected)

Set specified pharmacophore feature selection mode. Shows glow effect around markers.

Parameters:
  • feature_name – feature name
  • feature_name – str
  • entry_id (int) – entry id of the structure that this feature is associated with
  • selected (bool) – indicates whether feature should be selected or not
setPropertyLabelVisible(entry_id, visible)

Shows or hides detailed (property) label for all feature markers.

Parameters:
  • entry_id (int) – entry id of the structure that these features are associated with
  • visible (bool) – whether to make property labels visible or not
setSelection(features, entry_id, selected)

Sets selection mode for multiple features.

Parameters:
  • features (list) – list of feature names
  • entry_id (int) – entry id of the structure that this feature is associated with
  • selected (bool) – indicates whether feature should be selected or not
setXvolSelected(entry_id, sphere_indices)

Selects spheres with given sphere ids for a given entry id.

Parameters:
  • entry_id (int) – entry ID
  • sphere_indices (list) – list of sphere indices
showAllFeatures()

Shows markers for all pharmacophore features.

showAllFeaturesForEntry(entry_id)

Shows markers for all features associated with a given entry.

Parameters:entry_id (int) – entry id of the structure that this feature is associated with
showFeature(feature_name, entry_id)

Show markers for the specified pharmacophore feature.

Parameters:
  • feature_name – feature name
  • feature_name – str
  • entry_id (int) – entry id of the structure that this feature is associated with
updateXvolMarker(entry_id, sphere_index, r, x, y, z)

This function is called to change radius and coordinates of excluded volume with a given sphere id and entry id.

Parameters:
  • entry_id (int) – entry ID
  • sphere_index (int) – sphere index
  • r (float) – new radius
  • x (float) – new x-coordinate
  • y (float) – new y-coordinate
  • z (float) – new z-coordinate
class schrodinger.application.phase.phase_markers.PhaseSphere(*args, **kwargs)

Bases: schrodinger.graphics3d.sphere.MaestroSphere

Phase sphere graphics object.

setSelected(selected, color=None)

Shows sphere as selected (with a glow effect). Glow effect color only needs to be specified when turning it ‘on’.

Parameters:
  • selected (bool) – whether sphere should be selected
  • color (tuple) – color used for selected glow effect.
class schrodinger.application.phase.phase_markers.PhaseSphereMarkers(entry_id)

Bases: object

Base class that defines group of sphere markers.

ANGLE_DEP_TRANSPARENCY = True
SELECTED_COLOR = (0.25, 0.5, 0.95)
SPHERE_COLOR = (1.0, 1.0, 0.0)
SPHERE_OPACITY = 0.1
SPHERE_RESOLUTION = 20
addSphere(xyz, radius)

Adds spehere to marker group.

Parameters:
  • xyz ((float, float, float)) – sphere coordinates
  • radius (float) – sphere radius
clear()

Deletes all spheres for this group.

hide()

Hide all spheres for this group.

next_sphere_id = 1
removeSpheres(sphere_indices)

Removes spheres from the group.

Parameters:sphere_indices (list) – list of indices to the self.sphere list
resetSelected()

Resets current selection.

setSelected(sphere_indices)

Shows the specified spheres as selected (with a glow effect).

Parameters:sphere_indices (list) – list of indices to the self.sphere list
setSphereRadiusAndCoords(sphere_index, r, x, y, z)

Sets sphere radius and coordinates.

Parameters:
  • sphere_index (int) – index of sphere in self.spheres list
  • r (float) – sphere radius
  • x – sphere x-coordinate
  • x – float
  • y – sphere y-coordinate
  • y – float
  • z – sphere z-coordinate
  • z – float
show()

Show all spheres for this group.

class schrodinger.application.phase.phase_markers.PhaseTolMarkers(entry_id, sites)

Bases: schrodinger.application.phase.phase_markers.PhaseSphereMarkers

Class that defines group of tolerance spheres.

SPHERE_COLOR = (0.5, 0.5, 0.5)
SPHERE_OPACITY = 0.5
class schrodinger.application.phase.phase_markers.PhaseXvolMarkers(entry_id, x_vol, interactive=False)

Bases: schrodinger.application.phase.phase_markers.PhaseSphereMarkers

Class that defines group of spheres for the excluded volume.

SPHERE_COLOR = (0.2, 0.9, 0.95)
SPHERE_OPACITY = 0.2
addExcludedVolumes(x_vol)

Adds excluded volume spheres to the current group.

Parameters:x_vol (phase.PhpExclVol) – excluded volume object
schrodinger.application.phase.phase_markers.get_phase_markers()

This function returns global PhaseMarkers object that should be used to generate Phase marker throughout Maestro session.

Returns:PhaseMarkers object
Return type:PhaseMarkers
schrodinger.application.phase.phase_markers.hide_phase_hover_markers(pick_id)

Remove glow effect when mouse is moved away from a phase marker.

Parameters:pick_id (int) – Phase marker pick id
schrodinger.application.phase.phase_markers.hide_workspace_phase_markers(entry_ids)

Removes Phase pharmacophore site markers for given entries.

Parameters:entry_ids (list) – list of Phase hypothesis entries
schrodinger.application.phase.phase_markers.project_close()

Delete all Phase feature markers.

schrodinger.application.phase.phase_markers.set_entry_property(entry_id, prop_name, value)

Sets entry ct property to a given value. This function is used to set special hypothesis properties that define whether excluded volumes, tolerances and reference structure should be visible.

Parameters:
  • entry_id (int) – hypothesis entry id
  • prop_name (str) – property name
  • value (float or int or str) – property value
schrodinger.application.phase.phase_markers.set_excluded_volume_visible(entry_id, visible)

Toggles hypothesis properties which can be shown in the workspace for hypothesis with a given entry id.

Parameters:
  • entry_id (int) – Phase hypothesis entry id
  • visible (bool) – whether to make visible in the workspace or not
schrodinger.application.phase.phase_markers.set_feature_tolerance_visible(entry_id, visible)

Toggles display of feature tolerance spheres in the Workspace for hypothesis with a given entry id.

Parameters:
  • entry_id (int) – Phase hypothesis entry id
  • visible (bool) – whether to make visible in the workspace or not
schrodinger.application.phase.phase_markers.set_freestyle_site_type(site, feature_type)

Updates a site with the given pharmacophore feature type, and if applicable assigns projected coordinates of the corresponding free-style site type.

Returns:pharmacophore site
Return type:phase.PhpSite
Parameters:feature_type (str) – site’s feature type
schrodinger.application.phase.phase_markers.set_property_labels_visible(entry_id, visible)

Toggles display of feature property labels for hypothesis with a given entry_id.

Parameters:
  • entry_id (int) – Phase hypothesis entry id
  • visible (bool) – whether to make property labels visible or not
schrodinger.application.phase.phase_markers.set_reference_ligand_visible(entry_id, visible)

Toggles display of reference ligand in the Workspace for hypothesis with a given entry id.

Parameters:
  • entry_id (int) – Phase hypothesis entry id
  • visible (bool) – whether to make visible in the workspace or not
schrodinger.application.phase.phase_markers.setup_project_close()

Sets up function that should be called when project is closed.

schrodinger.application.phase.phase_markers.show_phase_hover_markers(pick_id)

Show glow effect when mouse is hovered on a phase marker.

Parameters:pick_id (int) – Phase marker pick id
schrodinger.application.phase.phase_markers.show_workspace_phase_markers(entry_ids, include_Q=False)

Delays the call to show workspace phase markers with a single shot to allow for the project table project_model to update appropriately.

Parameters:
  • entry_ids (list of int) – list of Phase hypothesis entries
  • include_Q (bool) – whether to include Q site phase markers
schrodinger.application.phase.phase_markers.update_hypothesis_entry(hypo, entry_id)

Updates the structure in the project table for the given entry ID with the current PhaseHypothesis, updating the reference ligand if needed.

Parameters:
  • hypo (hypothesis.PhaseHypothesis) – hypothesis to assign to the given PT entry
  • entry_id (int or str) – entry id to set hypothesis to