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.
-
class
schrodinger.application.msv.gui.row_delegates.
AbstractDelegate
¶ Bases:
future.types.newobject.newobject
Base delegate class. Non-abstract subclasses must must provide appropriate values for ANNOTATION_TYPE and must reimplement
paintRow
.Variables: ANNOTATION_TYPE ( enum.Enum
or None) – The annotation type associated with this class-
ANNOTATION_TYPE
= ()¶
-
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, 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.
- row_data (list(dict(int, object))) – A list of data for the entire row. Each column is represented by a dictionary of {role: value}.
- 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
schrodinger.application.msv.gui.row_delegates.
AbstractDelegateWithTextCache
(*args, **kwargs)¶ 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.
-
clearCache
()¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
BarDelegate
¶ 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: 15>, <ANNOTATION_TYPES.b_factor: 13>, <ANNOTATION_TYPES.consensus_freq: 6>)¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
BidirectionalBarDelegate
¶ 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: 14>, <ANNOTATION_TYPES.mean_hydrophobicity: 2>)¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
ColorBlockDelegate
¶ 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: 4>, <ANNOTATION_TYPES.beta_strand_propensity: 5>, <ANNOTATION_TYPES.turn_propensity: 6>, <ANNOTATION_TYPES.helix_termination_tendency: 7>, <ANNOTATION_TYPES.exposure_tendency: 8>, <ANNOTATION_TYPES.steric_group: 9>, <ANNOTATION_TYPES.side_chain_chem: 10>)¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
ConsensusSymbolsDelegate
(*args, **kwargs)¶ Bases:
schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache
-
ANNOTATION_TYPE
= 4¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
ResidueDelegate
¶ Bases:
schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache
-
ANNOTATION_TYPE
= (<RowType.Sequence: 1>, <ANNOTATION_TYPES.consensus_seq: 5>)¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
ResnumDelegate
(*args, **kwargs)¶ Bases:
schrodinger.application.msv.gui.row_delegates.AbstractDelegateWithTextCache
A delegate to draw the residue number annotation. Numbers are drawn every 5.
-
ANNOTATION_TYPE
= 1¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
RulerDelegate
¶ 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¶
-
clearCache
()¶
-
paintRow
(painter, row_data, row_rect, left_edges, top_edge, col_width, row_height)¶
-
-
class
schrodinger.application.msv.gui.row_delegates.
SpacerDelegate
¶ Bases:
schrodinger.application.msv.gui.row_delegates.AbstractDelegate
A delegate for blank spacer rows.
-
ANNOTATION_TYPE
= 2¶
-
paintRow
(*args)¶
-
-
schrodinger.application.msv.gui.row_delegates.
all_delegates
()¶ Return a list of all delegates in this module. @rtype: list(AbstractDelegate)