schrodinger.application.bioluminate.protein_structure_quality module

View the Ramachandran plot and Protein Report in a way that is interactive with the workspace. Operates on the workspace structure.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.bioluminate.protein_structure_quality.FakeMaestro

Bases: object

do_nothing(*args, **keyw)
command(astring)
workspace_get()
schrodinger.application.bioluminate.protein_structure_quality.maestro_command(cmd)

Executes cmd as a maestro command and silenty ignores errors. Particularly useful when an ASL may not specify any atoms, which causes Maestro to throw an error even if we don’t care about it.

Parameters

cmd (str) – The maestro command to execute

class schrodinger.application.bioluminate.protein_structure_quality.DataModelWithChart(master)

Bases: schrodinger.application.bioluminate.protein_report_widget.DataModel

A subclass of DataModel that calls a sort callback when sorting

__init__(master)

Create a DataModel instance

data_column

The column that the data to plot is in

restrictByChains(chains)

Restricts the data in the model to the specified chains

Parameters

chains (list of str) – list of chain names (or ‘all’) to display

setData(*args)

Sets the internal data list to the specified list. NOTE: Will use the actual list passed to it (without making a copy)

Overrides the parent class method to store the a copy of the data in self.all_data, since the _data property can be mutated by the restrictByChains method.

Parameters
  • data_list (list) – the list of data for the model. Uses the actual list, not a copy

  • headers (list of str) – The column headers

headerData(section, orientation, role)

Returns the string that should be displayed in the specified header cell. Used by the View.

Parameters
  • section (int) – the row or column index requested

  • orientation (Qt.Orientation (Qt.Horizontal or Qt.Vertical)) – Whether this is for the horizontal or vertical header

  • role (Qt.ItemDataRole) – The data role to return - Qt.DisplayRole to return the text of the header.

Return type

str

Returns

the str representation for the requested header item

sort(*args)

Sort the table (see parent class for argument definition). In addition to sorting, the attribute self.sortCallback() will be called if it exists (with no arguments). This attribute must be set manually by the user.

class schrodinger.application.bioluminate.protein_structure_quality.MultiReportWithChart(*args, **kwargs)

Bases: schrodinger.application.bioluminate.protein_report_widget.ReportFrame

A Protein Report widget that can deal with multiple protein structures and also has a slider chart that can be used to select residues.

__init__(*args, **kwargs)

Create the MultiReportWithChart object. See parent class for argument definition.

changeBFactorPlot()
toolbar_feedback_override(message)

Overrides the matplotlib toolbar set_message method to display the information in the first column of the row of the table that corresponds to the current X coordinate of the plot. This will usually be something like a residue name or atom name.

Parameters

message (str) – The string to be displayed in the toolbar. Will usually have x and y coordinates in the form of x=…. y=….

selectRows(rows)

Select the set of rows in the table given by the list rows

Parameters

rows (list) – list (or other iterable) of row numbers to select. Selection will be ONLY these rows - any previous selection is removed.

sliderMoved(slider)

Callback for when the user moves a slider on the sliderchart. Selects those rows of the table that are contained within the sliderchart box.

Parameters

slider (sliderchart.SlidableLine) – The line that was moved

setChanged(selected_title)

In addition to calling the parent class method, this also replots the sliderchart when the user selects a different set of data.

Parameters

selected_title (str) – The title of the new set of data

changeProtein(entry_id, chains='all')

Change the Protein whose data is displayed in the report widget & chart. If the protein has already been calculated, we just replace the Report Widget’s models with the models that contain the data for this protein. If this is a new protein, we run the report and store the data in the models.

Parameters

entry_id (str) – The entry ID of the new protein to display. Use None to clear the table and plot

getDataModelClass()

Returns the proper data model to use, allows easy subclassing of the Model in subclasses

Return type

QtCore.QAbstractTableModel class

Returns

The data model CLASS (not object) to use with this chart

updateTables(*args, **kwargs)

Calculate the data for the current protein and display it in the report widget & chart.

Parameters

entry_id (str) – The entry_id of the protein to calculate. None if the workspace structure should be used.

getSummaryData(chains='all')

Returns a dictionary with the summary data in it

Return type

dict

Returns

Dictionary with summary data

replotChart()

Replot the sliderchart with the current data

workspaceChanged(changed)

Override the parent routine to not change the syncd Value when Everything changes in the workspace, since that’s the signal that we’ve switched proteins, which we do on purpose.

class schrodinger.application.bioluminate.protein_structure_quality.HomologyRama(*args, **kwargs)

Bases: schrodinger.ui.qt.rama.Rama

A Ramachandran plot customized for the Protein Structure Quality Viewer

DEFAULT_MARKER_SIZE = 2.0
MARKER_SCALING_FACTOR = 1.0
PICK_RADIUS = 1.5
__init__(*args, **kwargs)

Create a HomologyRama object.

See parent class for argument documentation

change_current_pick(new_pick, multi=False)

React to picking a new point in the plot by changing the phi/psi counters if used and highlighting the selection in the workspace.

Parameters

new_pick (int) – the index of the picked point in self.dihedral_list

getCategory(xval, yval)

Get the favorable, allowed or disallowed status of a point

Parameters
  • xval (float) – the x value of the point

  • yval (float) – the y value of the point

Return type

str

Returns

one of HomologyRama.FAVORABLE, HomologyRama.ALLOWED, HomologyRama.DISALLOWED

draw_regions(residue_type: schrodinger.ui.qt.rama.RamaResidueType = RamaResidueType.GENERAL)

Draw the various regions on the Ramachandran plot, and define the favorable, allowed and disallowed bins

recolorPlot(favorable, allowed, disallowed)

Change the color of the regions on the plot

Parameters
  • favorable (str) – matplotlib-recognized color string for the favorable regions

  • allowed (str) – matplotlib-recognized color string for the allowed regions

  • disallowed (str) – matplotlib-recognized color string for the disallowed regions

makeBinPoint(xval, yval)

Return the bottom left corner of a 10x10 degree patch of the plot that contains xval, yval

Parameters
  • xval (float) – the x value of the point

  • yval (float) – the y value of the point

Return type

tuple

Returns

(X, Y) of the bottom left corner of the patch that contains (xval, yval). Will be integer multiples of 10.

defineBins(allowed, favorable)

Define the 10x10 degree bins for what is allowed and what is favorable

Parameters
  • allowed (list) – matplotlib Polygon object defining an allowed region

  • favorable (list) – matplotlib Polygon object defining a favorable region

display_structure(ct, ca_list=None, chains='all')

Plot the dihedrals for a new structure

Parameters
  • ct (schrodinger.structure.Structure) – structure with dihedrals to plot

  • ca_list (list) – list of Calpha carbons to plot (default is all)

  • chains ('all' or list of str) – What chains to display, default is ‘all’, otherwise should be a list of chain names

updateScatterPlot()

Updates the plot to show the displayed structure. Overrides the parent class method in order to only show dihedrals from the specified chains.

find_closest_point(event)

Find the dihedral closes to the point (x, y). Overrides the parent class method in order to only choose points from the displayed chain.

Parameters

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

isInDisplayedChain(dihedral)

Returns True if the dihedral is from one of the displayed chains, False if not

Parameters

dihedral (rama.Rama.backbone_dihedral) – The object to test to see if it belongs to one of the displayed chains

Return type

bool

Returns

True if the dihedral is from one of the displayed chains, False if not

class schrodinger.application.bioluminate.protein_structure_quality.ProteinStructureQualityViewer(models=None)

Bases: schrodinger.ui.qt.appframework.AppFramework

The Main Panel Class

__init__(models=None)

Create a ProteinStructureQualityViewer instance

Parameters

models (list) – list of Homology models to view in the panel

toggleFavorable()

Refresh the workspace view when the user changes what regions to color

toggleAllowed()

Refresh the workspace view when the user changes what regions to color

toggleDisallowed()

Refresh the workspace view when the user changes what regions to color

loadModels(models=None)

Load the models into the viewer

Parameters

models (list or None) – list of Homology models to view in the panel, or None if the selected rows of the project table should be used.

changeModel()

Switch which model the panel is displaying data for

tabSelected(index)

When the user switches to the report tab, show everything as wire

Parameters

index (int) – The index of the current tab

showNewStructure(struct, chains='all')

Show data for a new structure in the Ramachandran plot

Parameters
  • struct (schrodinger.structure.Structure object) – The structure to display in the plot

  • chains (list or 'all') – list of chain names (or ‘all’) to display

changePreset(choice)

Change which preset set of appearances to use when modifying the workspace structure appearances based on the Ramachandran plot regions.

Parameters

choice (str) – Which preset set of appearances to use

updateWorkspaceView(all=False, favorable=False, allowed=False, disallowed=False)

Change the workspace appearance based on the Ramachandran plot regions

Parameters
  • all (bool) – If True, all residue appearances will be updated. False is default

  • favorable (bool) – If True, modify the appearance of residues in the favorable regions. If False, do not.

  • allowed (bool) – If True, modify the appearance of residues in the allowed regions. If False, do not.

  • disallowed (bool) – If True, modify the appearance of residues in the disallowed regions. If False, do not.

help()

Display the help dialog (or a warning dialog if no help can be found). This function requires help_topic to have been given when the class was initialized.

null()