schrodinger.ui.qt.rama module

A Ramachandran Plot widget, along with some tools for manipulating structures/points.

Usage:

Rama(parent)

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.ui.qt.rama.RamaResidueType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: schrodinger.models.jsonable.JsonableEnum

Enum describing the six Ramachandran plot categories as defined by MolProbity from the Top8000 dataset.

See https://doi.org/10.1002/pro.3330, https://doi.org/10.1016/j.str.2011.08.006

GLY = 'Glycine'
CISPRO = 'Cis-proline'
TRANSPRO = 'Trans-proline'
PREPRO = 'Pre-proline'
ILEVAL = 'Isoleucine/Valine'
GENERAL = 'General'
classmethod from_residue(res: schrodinger.structure._structure.Residue) schrodinger.ui.qt.rama.RamaResidueType

Classify res according to the criteria in Read et. al. 2011.

Order of precedence: Gly,Pro > pre-Pro > Ile/Val > general; see https://doi.org/10.1016/j.str.2011.08.006

Parameters

res (structure._Residue) – Residue to classify.

Returns

Enum corresponding to the residue’s category.

Return type

RamaResidueType

class schrodinger.ui.qt.rama.BackboneDihedral(CA: int = 0, N1: int = 0, C1: int = 0, N2: int = 0, C2: int = 0, dihedral_type: schrodinger.ui.qt.rama.RamaResidueType = RamaResidueType.GENERAL, phi: float = 0.0, psi: float = 0.0, original_phi: float = 0.0, original_psi: float = 0.0, saved_phi: float = 0.0, saved_psi: float = 0.0, chain: str = '', resname: str = '', resnum: int = 0, inscode: str = '', is_outlier: bool = True)

Bases: object

Class representing the relevant backbone dihedral angles needed to place a residue on a Ramachandran plot.

Atom labeling convention is as follows (’' are escaped slashes, not double bonds!):

                     O
                     ||
     (preceding res) C1        CA         N2 (next res)
                    /  \     /  \      /  \
                   / omega  phi   psi   /    \
                  /      \ /       \ /      ...
(preceding res CA)        N1         C2
                                     ||
                                     O

Previously named backbone_dihedral.

CA: int = 0
N1: int = 0
C1: int = 0
N2: int = 0
C2: int = 0
dihedral_type: schrodinger.ui.qt.rama.RamaResidueType = 'General'
phi: float = 0.0
psi: float = 0.0
original_phi: float = 0.0
original_psi: float = 0.0
saved_phi: float = 0.0
saved_psi: float = 0.0
chain: str = ''
resname: str = ''
resnum: int = 0
inscode: str = ''
is_outlier: bool = True
classmethod from_residue(res: schrodinger.structure._structure.Residue) schrodinger.ui.qt.rama.BackboneDihedral

Create instance from a Residue.

Raises

ValueError if dihedrals aren’t all defined. This happens during normal operation if res is at the start or end of a chain, and may also happen if the residue is structureless.

classmethod from_CA_index(CA_idx: int, st: schrodinger.structure._structure.Structure) schrodinger.ui.qt.rama.BackboneDihedral

Create instance from the index of an alpha carbon.

Raises ValueError if dihedrals not all definable. This happens during normal operation if the residue is at the start or end of a chain.

Parameters
  • CA_idx (int) – index of the residue’s alpha carbon

  • st (structure.Structure) – Structure containing the alpha carbon

__init__(CA: int = 0, N1: int = 0, C1: int = 0, N2: int = 0, C2: int = 0, dihedral_type: schrodinger.ui.qt.rama.RamaResidueType = RamaResidueType.GENERAL, phi: float = 0.0, psi: float = 0.0, original_phi: float = 0.0, original_psi: float = 0.0, saved_phi: float = 0.0, saved_psi: float = 0.0, chain: str = '', resname: str = '', resnum: int = 0, inscode: str = '', is_outlier: bool = True) None
class schrodinger.ui.qt.rama.RamaFigure(width=5, height=4, dpi=100, toolbar=True, layout=None, expanding=True, toolbar_class=None, **kwargs)

Bases: schrodinger.ui.qt.smatplotlib.SmatplotlibCanvas

sizeHint(self) QSize
miniumSizeHint()
class schrodinger.ui.qt.rama.DihedralSpinBox(layout, command, dtype)

Bases: PyQt6.QtWidgets.QDoubleSpinBox

A DoubleSpinBox with min/max = -180/180, step=0.1. Takes a layout argument that it places itself in, and a command to call when its value changes.

__init__(layout, command, dtype)
class schrodinger.ui.qt.rama.RamaClassification(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.Enum

Enum representing the three classifications of a dihedral angle on the Ramachandran plot.

OUTLIER = 'Outlier'
ALLOWED = 'Allowed'
FAVORED = 'Favored'
class schrodinger.ui.qt.rama.RamaContourMixin

Bases: object

Mixin for creating a matplotlib contour plot of Ramachandran reference data, to be used as a background for the scatter plot of Ramachandran angles.

FAVORABLE_COLOR = '#ffa07a'
ALLOWED_COLOR = '#ffffe0'
CROSSHAIR_COLOR = '#cccccc'
CROSSHAIR_LINEWIDTH = 0.5
TICK_SPACING = 30
TEXT_SIZE = 'small'
TICK_LABEL_SIZE = 'x-small'
DATA_MIN = -180.0
DATA_MAX = 180.0
draw_axes()
draw_regions(residue_type: schrodinger.ui.qt.rama.RamaResidueType = RamaResidueType.GENERAL)
class schrodinger.ui.qt.rama.RamaScatterMixin

Bases: object

Mixin for the scatterplot component of the Ramachandran plot, with points for all the selected residues.

DEFAULT_MARKER_SIZE = 1.0
MARKER_SCALING_FACTOR = 2.0
set_symbol_size(value=None)
get_marker_color(idx: int) str

Get the color to use for the scatterplot marker corresponding to dihedral idx.

update_point_faces(indexes)

Update the face colors for points on the plot - faster than doing a complete replot.

Parameters

indexes (list) – List of indexes to recolor. Should be the index of the point in the self.dihedral_list list

update_point_xval(index, xval)

Update the x-value of a point on the plot

Parameters

index (int) – The index of the point in the self.dihedral_list list

update_point_yval(index, yval)

Update the y-value of a point

Parameters

index (int) – The index of the point in the self.dihedral_list list

updateScatterPlot()

Re-plot the scatterplot component of the Ramachandran plot, with points for all the selected residues.

class schrodinger.ui.qt.rama.Rama(widget, layout, size=450, ticks=30, show_status=True, show_counters=False, zoom_on_pick=True, dpi=100, multiselect=False, spacer_size=20)

Bases: schrodinger.ui.qt.rama.RamaScatterMixin, schrodinger.ui.qt.rama.RamaContourMixin

A class showing a matplotlib plot of the Phi and Psi angles of a polypeptide.

SPINBOX_ADJUST_THRESH = 0.049
__init__(widget, layout, size=450, ticks=30, show_status=True, show_counters=False, zoom_on_pick=True, dpi=100, multiselect=False, spacer_size=20)

Create a Rama object

Parameters
  • widget (QWidget) – the PyQt widget that ‘owns’ this plot

  • layout (QLayout) – the layout to place the plot into

  • size (int) – size of square plot in pixels, (default=450).

  • dpi (int) – dots per inch resolution of plot (default=100).

  • size – unused, kept for backward compatibility

  • show_status (bool) – If True, cursor location feedback is given in the matplotlib toolbar

  • show_counters (bool) – If True, show controls for changing the Phi and Psi values of the selected dihedral. Only one of multiselect and show_counters can be True.

  • zoom_on_pick (bool) – If True, zoom the Maestro workspace to the dihedral picked

  • multiselect (bool) – If True, the user can pick multiple points with shift/cntl-click. If False (default), only one point can be picked at a time. Only one of multiselect and show_counters can be True.

setup_counters(layout)

Add additional widgets for angle manipulation to the layout

update_display()
display_structure(ct, CA_list=None)
save()

Store the current phi & psi values of the current point.

This method only makes sense with multiselect == False

revert_to_original()

Set the current point to its original phi & psi values

This method only makes sense with multiselect == False

revert_to_saved()

Set the current point to its previously saved phi & psi values

This method only makes sense with multiselect == False

get_residue_label(residue)

Format the label displayed in the toolbar for the currently moused-over residue.

Parameters

residue (Residue) – The residue to label

Return type

str

Returns

The label for the residue

display_residue(which='all')

Select residues in the workspace corresponding to the given points

Parameters

which (int, None or 'all') – If None, all residues are deselected. If an integer, that integer is taken as the index in the dihedral list to select. If ‘all’, residues for all selected points are selected.

adjust_phi(value)

React to changed value of the Phi spinbox

The method only makes sense with multiselect == False

Parameters

value (float) – new value of the spinbox

adjust_psi(value)

React to changed value of the Psi spinbox

The method only makes sense with multiselect == False

Parameters

value (float) – new value of the spinbox

apply_dihedral(idihedral)

Change the value of a dihedral

Parameters

idihedral (int) – The index of the dihedral to change

clear_selection(event)

Clear the selected points

Parameters

event (event or None) – The event that generated this call, or None if not being called as a response to an event. This parameter is unused.

drag(event)

As the user moves the mouse over a point, display information for that point in the toolbar and select the corresponding residue in the workspace.

Parameters

event (matplotlib MouseEvent) – The event that generated the call to this method.

change_current_pick(new_pick, multi=False)
find_closest_point(event)

Find the plot point that is closest to the event

Parameters

event (MouseEvent) – The matplotlib mouse event that generates this call

pick_by_point(event)
pick_by_atom(iatom)
get_picked()

Get the BackboneDihedral object for the selected dihedral that was most recently selected.

Return type

Optional[BackboneDihedral]

Returns

The BackboneDihedral object for the selected dihedral that was most recently selected, or None if there are no selected dihedrals.

write_file(filename)
adjust_symbol_size(value)
options_quit()
clearGraph()

Gets called when project is closed