schrodinger.application.msv.gui.row_delegates module

Delegates used to paint an entire row at a time in the MSV tree view. Normal Qt delegates inherit from QStyledItemDelegate and paint a single cell at a time. By painting a row at a time instead, we massively speed up (~6x) painting for the alignment.

schrodinger.application.msv.gui.row_delegates.all_delegates()[source]

Return a list of all delegates in this module. :rtype: list(AbstractDelegate)

class schrodinger.application.msv.gui.row_delegates.AbstractDelegate[source]

Bases: object

Base delegate class. Non-abstract subclasses must must provide appropriate values for ANNOTATION_TYPE and PER_CELL_PAINT_ROLES and must reimplement paintRow.

Variables
  • ANNOTATION_TYPE (enum.Enum or None) – The annotation type associated with this class

  • PER_CELL_PAINT_ROLES (frozenset) – Data roles that should be fetched per-cell (as opposed to per-row). Note that data for roles in PER_ROW_PAINT_ROLES will be fetched per-row.

  • ROW_HEIGHT_CONSTANT (int or None) – The row height, in pixels. Subclasses for rows that should not vary in size as the font size changes should define this value.

  • ROW_HEIGHT_SCALE (int) – The row height relative to the font height. This value will be ignored if ROW_HEIGHT_CONSTANT is defined.

ANNOTATION_TYPE = ()
PER_CELL_PAINT_ROLES = frozenset({})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()[source]
clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)[source]

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)[source]

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

A delegate that caches text using QStaticTexts. Note that QPainter::drawStaticText is roughly 10x faster than QPainter::drawText.

__init__(*args, **kwargs)[source]
clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

ANNOTATION_TYPE = ()
PER_CELL_PAINT_ROLES = frozenset({})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.SequenceLogoDelegate(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

This delegate is used to draw multiple residue 1-letter codes at each alignment position. The letters are drawn from bottom to top, in the order of increasing frequency.

ANNOTATION_TYPE = 7
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.ResidueIndex})
ROW_HEIGHT_SCALE = 4
__init__(*args, **kwargs)[source]
clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

setLightMode(enabled)[source]

When light mode is enabled, use darker colors.

Parameters

enabled (bool) – Whether or not light mode is enabled

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_CONSTANT = None
rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

class schrodinger.application.msv.gui.row_delegates.ConsensusSymbolsDelegate(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

ANNOTATION_TYPE = 4
PER_CELL_PAINT_ROLES = frozenset({0, 9})
ROW_HEIGHT_SCALE = 1.5
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_CONSTANT = None
__init__(*args, **kwargs)
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.ResnumDelegate(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

A delegate to draw the residue number annotation. Numbers are drawn every 5.

Variables

MIN_SPACING (int) – Minimum number of spaces between painted residue numbers

ANNOTATION_TYPE = 3
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.ResSelected})
ROW_HEIGHT_CONSTANT = 16
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
__init__(*args, **kwargs)
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.PfamDelegate(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

A delegate to draw the pfam annotation.

ANNOTATION_TYPE = 23
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.ResSelected})
ROW_HEIGHT_CONSTANT = 16
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
__init__(*args, **kwargs)
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.AbstractResidueDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

PER_CELL_PAINT_ROLES = frozenset({0, 8, 9, CustomRole.ResSelected, CustomRole.SeqresOnly, CustomRole.NonstandardRes})
ROW_HEIGHT_SCALE = 1.2
RES_OUTLINE_HALF_PEN_WIDTH = 1
__init__()[source]
ANNOTATION_TYPE = ()
ROW_HEIGHT_CONSTANT = None
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.ResidueDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractResidueDelegate

Variables

EDIT_MODE_ROLES (frozenset) – Roles for data that will only be painted in edit mode.

ANNOTATION_TYPE = 1
PER_CELL_PAINT_ROLES = frozenset({0, 8, 9, CustomRole.ResSelected, CustomRole.SeqresOnly, CustomRole.ResAnchored, CustomRole.ChainDivider, CustomRole.NonstandardRes})
CONSTRAINTS_ROLES = frozenset({CustomRole.PartialPairwiseConstraint})
OUTLINE_ROLES = frozenset({CustomRole.ResidueIndex})
CHIMERA_ROLES = frozenset({CustomRole.HMCompositeRegion})
EDIT_MODE_ROLES = frozenset({CustomRole.ResSelectionBlockStart})
__init__()[source]
clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

setEditMode(enable)[source]

Enable or disable edit mode. This affects whether I-bars are painted or not.

Parameters

enable (bool) – Whether to enable edit mode.

setConstraintsShown(enable)[source]

Enable or disable constraints. This affects whether constraints are painted or not.

Parameters

enable (bool) – Whether to display constraints

setResOutlinesShown(enable)[source]
setChimeraShown(enable)[source]

Enable or disable chimera mode. This affects whether chimeric regions are painted.

Parameters

enable (bool) – Whether to display chimeric regions.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

setLightMode(enabled)[source]

Set light mode for the sequence alignment. This affects the overlay that is drawn over structureless residues and anchored residues

RES_OUTLINE_HALF_PEN_WIDTH = 1
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1.2
rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

class schrodinger.application.msv.gui.row_delegates.ConsensusResidueDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractResidueDelegate

ANNOTATION_TYPE = 5
ROW_HEIGHT_SCALE = 1.5
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

PER_CELL_PAINT_ROLES = frozenset({0, 8, 9, CustomRole.ResSelected, CustomRole.SeqresOnly, CustomRole.NonstandardRes})
RES_OUTLINE_HALF_PEN_WIDTH = 1
ROW_HEIGHT_CONSTANT = None
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.SpacerDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

A delegate for blank spacer rows.

ANNOTATION_TYPE = 2
paintRow(*args)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

PER_CELL_PAINT_ROLES = frozenset({})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.AbstractBracketDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

An abstract delegate for delegates that need to paint brackets (e.g. to represent a bond between two residues)

Variables

CapStyle (Enum) – An enum describing whether the bracket should be painted with its end caps flush (|_____|) or centered (|-----|)

class CapStyle(value)

Bases: enum.Enum

An enumeration.

FLUSH = 1
CENTERED = 2
ANNOTATION_TYPE = ()
PER_CELL_PAINT_ROLES = frozenset({})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.AntibodyCDRDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractBracketDelegate, schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

A delegate to draw CDR annotations. CDR annotations are drawn using a bracket surrounding the relevant residues with the CDR label drawn at the center of the bracket. For example:

1cmy    CTCGACCG
CDR      |----|
           H1
ANNOTATION_TYPE = 21
PER_CELL_PAINT_ROLES = frozenset({CustomRole.ResSelected, CustomRole.ResidueIndex})
ROW_HEIGHT_SCALE = 1.4
__init__()[source]
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_y, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

class CapStyle(value)

Bases: enum.Enum

An enumeration.

FLUSH = 1
CENTERED = 2
ROW_HEIGHT_CONSTANT = None
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.DisulfideBondsDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractBracketDelegate

A delegate to draw disulfide bonds. Bonds are drawn with a connecting bracket like so:

1cmy    CTCGACCG
ss-bond |____|

If there are multiple bonds, they are drawn at staggered heights.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.disulfide_bonds: 5>, <ANNOTATION_TYPES.proximity_constraints: 29>)
PER_CELL_PAINT_ROLES = frozenset({CustomRole.ResSelected, CustomRole.ResidueIndex})
ROW_HEIGHT_CONSTANT = 16
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_y, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

class CapStyle(value)

Bases: enum.Enum

An enumeration.

FLUSH = 1
CENTERED = 2
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.PredictedDisulfideBondsDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.DisulfideBondsDelegate

ANNOTATION_TYPE = (<ANNOTATION_TYPES.pred_disulfide_bonds: 24>,)
class CapStyle(value)

Bases: enum.Enum

An enumeration.

FLUSH = 1
CENTERED = 2
PER_CELL_PAINT_ROLES = frozenset({CustomRole.ResSelected, CustomRole.ResidueIndex})
ROW_HEIGHT_CONSTANT = 16
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_y, col_width, row_height)

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.RulerDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

A delegate to draw the ruler. Numbers are drawn above the ruler at intervals of 10 with a long tick. Medium ticks are drawn at intervals of 5. Other ticks are very short.

ANNOTATION_TYPE = 1
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.IsAnchoredColumnRangeEnd})
ROW_HEIGHT_CONSTANT = 24
__init__()[source]
setLightMode(enabled)[source]

Set light mode on the ruler delegate. The anchor icon is drawn with a darker anchor when in light mode

clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

class schrodinger.application.msv.gui.row_delegates.ColorBlockDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

A delegate that paints only colored blocks using the Qt.BackgroundRole color.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.helix_propensity: 6>, <ANNOTATION_TYPES.beta_strand_propensity: 7>, <ANNOTATION_TYPES.turn_propensity: 8>, <ANNOTATION_TYPES.helix_termination_tendency: 9>, <ANNOTATION_TYPES.exposure_tendency: 10>, <ANNOTATION_TYPES.steric_group: 11>, <ANNOTATION_TYPES.side_chain_chem: 12>, <ANNOTATION_TYPES.domains: 20>, <ANNOTATION_TYPES.kinase_features: 30>, <ANNOTATION_TYPES.kinase_conservation: 31>)
PER_CELL_PAINT_ROLES = frozenset({8, CustomRole.ResSelected})
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.BindingSiteDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.ColorBlockDelegate

A delegate for binding site rows.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.binding_sites: 19>,)
CONSTRAINTS_ROLES = frozenset({CustomRole.BindingSiteConstraint})
__init__()[source]
setConstraintsShown(enable)[source]

Enable or disable constraints. This affects whether constraints are painted or not.

Parameters

enable (bool) – Whether to display constraints

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

PER_CELL_PAINT_ROLES = frozenset({8, CustomRole.ResSelected})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.StripedColorBlockDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.ColorBlockDelegate

PER_CELL_PAINT_ROLES = frozenset({8, CustomRole.ResSelected})
ANNOTATION_TYPE = (<ANNOTATION_TYPES.pred_accessibility: 26>, <ANNOTATION_TYPES.pred_disordered: 27>, <ANNOTATION_TYPES.pred_domain_arr: 28>)
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.BarDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

A delegate for bar charts with only positive values.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.mean_isoelectric_point: 3>, <ANNOTATION_TYPES.window_isoelectric_point: 17>, <ANNOTATION_TYPES.b_factor: 15>, <ANNOTATION_TYPES.consensus_freq: 6>)
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.ResSelected})
ROW_HEIGHT_CONSTANT = 40
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.SSADelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

A delegate for painting secondary structures. Alpha helixes are painted as rectangles with ellipses on the ends and beta strands are painted as arrows.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.secondary_structure: 18>,)
PER_CELL_PAINT_ROLES = frozenset({8, CustomRole.ResSelected, CustomRole.ResidueIndex})
ROW_HEIGHT_CONSTANT = 16
__init__()[source]
clearCache()[source]

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.PredSSADelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.SSADelegate

Paint shapes with overlayed stripes and arrows with dashed lines.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.pred_secondary_structure: 25>,)
PER_CELL_PAINT_ROLES = frozenset({8, CustomRole.ResSelected, CustomRole.ResidueIndex})
ROW_HEIGHT_CONSTANT = 16
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.BidirectionalBarDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

Delegate used for bar charts that represent positive and negative values. Positive values are drawn above the midpoint of the bar and negative values below.

ANNOTATION_TYPE = (<ANNOTATION_TYPES.window_hydrophobicity: 16>, <ANNOTATION_TYPES.mean_hydrophobicity: 2>)
PER_CELL_PAINT_ROLES = frozenset({0, CustomRole.ResSelected})
ROW_HEIGHT_CONSTANT = 40
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.PairwiseConstraintDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegate

ANNOTATION_TYPE = 1
PER_CELL_PAINT_ROLES = frozenset({CustomRole.ResidueIndex})
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_y, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
__init__()
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.AlignmentSetDelegate[source]

Bases: schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache

ANNOTATION_TYPE = 2
__init__()[source]
paintRow(painter, per_cell_data, per_row_data, row_rect, left_edges, top_edge, col_width, row_height)[source]

Paint an entire row of data. Non-abstract subclasses must reimplement this method.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • per_cell_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Only roles with differing values between different columns are present in these dictionaries. Note that the keys of this dictionary are self.PER_CELL_PAINT_ROLES.

  • per_row_data (dict(int, object)) – A dictionary of {role: value} for data that’s the same for all columns in the row. Note that the keys of this dictionary are PER_ROW_PAINT_ROLES - self.PER_CELL_PAINT_ROLES.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • col_width (int) – The width of each column in pixels.

  • row_height (int) – The height of the row in pixels.

PER_CELL_PAINT_ROLES = frozenset({})
ROW_HEIGHT_CONSTANT = None
ROW_HEIGHT_SCALE = 1
clearCache()

Clear any cached data. Called whenever the font size changes. The base implementation of this method does nothing, but subclasses that cache data must reimplement this method to prevent cache staling.

rowHeight(text_height)

Return the appropriate height for this row type.

Parameters

text_height (int) – The height of the current font, in pixels.

Returns

The desired height of this row, in pixels.

Return type

int

setLightMode(enabled)

Reimplement on subclasses which need to respond to changes in light mode

Parameters

enabled (bool) – whether to turn light mode on or off

class schrodinger.application.msv.gui.row_delegates.FixedColumnsDelegate[source]

Bases: object

A delegate for the fixed columns on the left and right of the view. Note that this delegate does not inherit from AbstractDelegate and that paintRow takes different arguments than AbstractDelegate.paintRow. This is because this delegate has to paint heterogeneous columns with per-row selection rather than homogeneous columns with per-cell selection.

Variables

PAINT_ROLES (frozenset) – Data roles that should be fetched per-cell. Note that this delegate does not fetch any roles per-row.

PAINT_ROLES = frozenset({0, 1, 6, 7, 8, 9, CustomRole.RowType, CustomRole.RowHeightScale, CustomRole.SeqSelected, CustomRole.PreviousRowHidden, CustomRole.NextRowHidden, CustomRole.AnnotationSelected})
__init__()[source]
setLightMode(enabled)[source]

Set light mode for the delegate. This affects how the first row (header) is drawn

clearCache()[source]

Clear any cached data. Must be called whenever the font size changes.

paintRow(painter, data, is_title_row, selection_rect, row_rect, left_edges, col_widths, top_edge, row_height, is_mouse_over_row, is_mouse_over_struct_col, paint_expansion_column)[source]

Paint an entire row of data.

Parameters
  • painter (QtGui.QPainter) – The painter to use for painting.

  • data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}. Note that the keys of this dictionary are self.PAINT_ROLES.

  • is_title_row (bool) – Whether this row is a title row that should get a special background color.

  • selection_rect (QtCore.QRect) – A QRect to use for painting the selection highlighting for selected rows. The left and right edges of this rectangle are set correctly, but the top and bottom need to be updated before painting. Note that the left and right edges of this rectangle must not be changed.

  • row_rect (QtCore.QRect) – A rectangle that covers the entire area to be painted.

  • left_edges (list(int)) – A list of the x-coordinates for the left edges of each column.

  • col_widths (list(int)) – A list of the widths of each column in pixels.

  • top_edge (int) – The y-coordinate of the top edge of the row

  • row_height (int) – The height of the row in pixels.

  • is_mouse_over_row (bool) – Whether the mouse is over this row

  • is_mouse_over_struct_col (bool) – Whether the mouse is over the struct column

  • paint_expansion_column (bool) – Whether to paint the expansion column (i.e. whether left_edges[0] represents the leftmost column)