schrodinger.application.msv.gui.color module

Contains the color scheme constants for msv

class schrodinger.application.msv.gui.color.AbstractRowColorSchemeMeta(cls, bases, classdict)[source]

Bases: type

A metaclass for AbstractRowColorScheme. Populates _KEY_ENUM for AbstractRowColorScheme subclasses that define COLOR_BY_KEY.

__init__(*args, **kwargs)
mro()

Return a type’s method resolution order.

class schrodinger.application.msv.gui.color.AbstractRowColorScheme(*, custom=False)[source]

Bases: schrodinger.models.json.JsonableClassMixin

A color scheme for a row in MSV.

A color scheme subclass instance encapsulates all the color information needed to draw a particular row type, as well as (optionally) the meaning of the colors. Concrete subclasses should provide ANN_TYPE, and may optionally provide NAME, COLOR_BY_KEY, KEY_FUNC, DESCRIPTION, TEXT_COLOR, and TEXT_COLOR_GAP. For color schemes that apply to RowType.Sequence rows, a unique NAME is required.

Variables
  • NAME (str) – The name of the color scheme. For sequence row color schemes, this is the name that will appear in the drop down menu.

  • ANN_TYPE (RowType or annotation._AnnotationEnum or list(RowType) or list(annotation._AnnotationEnum)) – The row type or types that this color scheme should be applied to. Only one class in this file may apply to a given annotation type, but multiple classes may apply to RowType.Sequnce.

  • COLOR_BY_KEY (dict(object, tuple(int, int, int)) or None) – A dictionary mapping color keys to rgb tuples. May be None if the color scheme doesn’t provide any colors (other than text colors).

  • KEY_NAMES (dict(object, str) or None) – A dictionary mapping color keys to human-readable key names. May be None if the key values are already human-readable strings or enums with human-readable names.

  • KEY_FUNC (function) – A function that takes input of a residue.Residue object and outputs the appropriate key for the COLOR_BY_KEY dictionary. This defaults to str, which leads to keys of one-letter residue abbreviations for COLOR_BY_KEY.

  • DESCRIPTION (str) – A textual description of the color scheme and the meaning of each color. Used for the row tooltip.

  • TEXT_COLOR (QtGui.QColor) – The color to use for text in residue (i.e. non-gap) cells.

  • TEXT_COLOR_GAP (QtGui.QColor) – The color to use for text in gap cells.

  • TEXT_COLOR_TERM_GAP (QtGui.QColor) – The color to use for text in terminal gap cells.

  • CHAIN_DIVIDER_COLOR (QtGui.QColor) – The color to use for the chain divider indicator when “Split chain view” is disabled and the first residue of the chain is not selected.

  • SEL_CHAIN_DIVIDER_COLOR (QtGui.QColor) – The color to use for the chain divider indicator when “Split chain view” is disabled and the first residue of the chain is selected.

Car _KEY_ENUM

If the keys of COLOR_BY_KEY are enums, gives the enum class. Will be None otherwise. Note that this value is automatically populated by AbstractRowColorSchemeMeta. Also note that if any key of COLOR_BY_KEY is an enum, then all keys must be enums from the same class. This is required to be able to restore a color scheme from JSON, and is enforced via test_color_scheme.py::TestJson::TestSingleEnumType.

NAME = ''
ANN_TYPE = None
COLOR_BY_KEY = None
KEY_NAMES = None
DESCRIPTION = ''
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
__init__(*, custom=False)[source]
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

KEY_FUNC

alias of str

property display_name
toJsonImplementation()[source]

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

classmethod adapter50003(json_dict)[source]

MSV-3197

classmethod fromJsonImplementation(json_dict)[source]

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getColorByKey(key)[source]

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getBrushByKey(key)[source]

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)[source]

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

setColor(key, r, g, b)[source]

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

getCustomResColorMap()[source]

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

updateCustomResColors(color_map)[source]

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

getKeys()[source]

Return a list of all possible key values. :rtype: list[object]

prettyKeyName(key)[source]

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

getSchemeSummary()[source]

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

removeKey(key)[source]

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

classmethod adapter_50003(json_dict)[source]

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

class schrodinger.application.msv.gui.color.ResidueRowColorScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AbstractRowColorScheme

Color schemes that require the residue at a given position to determine the appropriate color.

getColorByResAndAln(res, aln)[source]

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getBrushByResAndAln(res, aln)[source]

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByRes(res)[source]

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorKeyToolTipByRes(res)[source]

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.AlignmentRowColorScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AbstractRowColorScheme

A color scheme that uses both alignment and residue to determine the appropriate color to be used.

getBrushByResAndAln(res, aln)[source]

Given a residue and an alignment, returns a QBrush for the background color

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByResAndAln(res, aln)[source]

Given a residue and an alignment, returns a color

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

getColorKeyToolTipByResAndAln(res, aln)[source]

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters
Returns

A tool tip describing the color key.

Return type

str

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.AbstractColorRampScheme(ramp, *, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

A base class for schemes that use a color ramp.

__init__(ramp, *, custom=False)[source]
Parameters
  • ramp (color_ramp.NamedColorRamp) – The color ramp to use.

  • custom (bool) – Whether this color scheme instance contains a user-defined color ramp (set via the Define Custom Color Scheme dialog).

removeKey(key)[source]

Override removeKey so that it raises an Exception.

property ramp
getSchemeSummary()[source]

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.AbstractColorRampOnlyScheme(ramp=None, *, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AbstractColorRampScheme

A base class for schemes that use a color ramp and only allow customization of the color ramp.

Variables

DEFAULT_RAMP (color_ramp.NamedColorRamp) – The color ramp to use if None is passed to __init__. This ramp must define colors for input values from 0 to 100. This value must be defined in concrete subclasses.

DEFAULT_RAMP = None
__init__(ramp=None, *, custom=False)[source]
Parameters
  • ramp (color_ramp.NamedColorRamp or None) – The color ramp to use. This ramp must define colors for input values from 0 to 100. If None, DEFAULT_RAMP will be used.

  • custom (bool) – Whether this color scheme instance contains a user-defined color ramp (set via the Define Custom Color Scheme dialog).

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.NucleicAcidColorScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

A color scheme for nucleic acids

COLOR_BY_KEY = {'A': (131, 115, 255), 'C': (255, 89, 133), 'G': (34, 224, 151), 'T': (216, 227, 47), 'U': (229, 186, 76)}
ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.SingleColorScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

A color scheme that uses a single color for the entire row. Custom residue colors are not supported. Note that KEY_FUNC is not used in this class and should not be defined.

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

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

getColorByKey(key=None)[source]

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)[source]

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getBrushByKey(key=None)[source]

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)[source]

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

setColor(key, r, g, b)[source]

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

getCustomResColorMap()[source]

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

updateCustomResColors(color_map)[source]

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

class schrodinger.application.msv.gui.color.DarkModeTextScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

A color scheme for rows that always use the default background color and white text.

ANN_TYPE = (<ANNOTATION_TYPES.resnum: 3>, <ANNOTATION_TYPES.consensus_symbols: 4>, <ANNOTATION_TYPES.indices: 1>, <ANNOTATION_TYPES.pfam: 23>)
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)[source]
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.LightModeTextScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

A color scheme for rows that use a light background with dark text

TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)[source]
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.SimilarityScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AlignmentRowColorScheme

A scheme that handles coloring residues according to their similarity to the current reference seq residue at their position in the alignment.

NAME = 'Residue Similarity'
ANN_TYPE = 1
KEY_FUNC(aln)

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

COLOR_BY_KEY = {<ResidueSimilarity.Identical: 1>: (255, 64, 64), <ResidueSimilarity.Similar: 2>: (255, 128, 0), <ResidueSimilarity.Dissimilar: 3>: (255, 255, 255), <ResidueSimilarity.NA: 4>: (255, 255, 255)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Given a residue and an alignment, returns a QBrush for the background color

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByResAndAln(res, aln)

Given a residue and an alignment, returns a color

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

getColorKeyToolTipByResAndAln(res, aln)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters
Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.PositionScheme(ramp=None, *, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AbstractColorRampOnlyScheme

A scheme that handles coloring residues according to the length of the sequence

setLength must be called to update the color scheme whenever the sequence changes

NAME = 'Residue Position'
ANN_TYPE = 1
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_RAMP = <schrodinger.application.msv.gui.color_ramp.NamedColorRamp object>
setLength(sequence_length)[source]

Sets the position color scheme based on the length of the sequence

Parameters

sequence_length – The total length of the sequence.

Type

int

getLength()[source]

Return the current length that is set for this color scheme.

Returns

The scheme’s current length

Return type

int

toJsonImplementation()[source]

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

classmethod fromJsonImplementation(json_dict)[source]

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(ramp=None, *, custom=False)
Parameters
  • ramp (color_ramp.NamedColorRamp or None) – The color ramp to use. This ramp must define colors for input values from 0 to 100. If None, DEFAULT_RAMP will be used.

  • custom (bool) – Whether this color scheme instance contains a user-defined color ramp (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ResidueTypeScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Residue Type'
ANN_TYPE = 1
COLOR_BY_KEY = {'A': (143, 251, 143), 'C': (251, 251, 146), 'D': (251, 147, 194), 'E': (251, 147, 194), 'F': (249, 170, 147), 'G': (143, 251, 143), 'H': (149, 186, 251), 'I': (143, 251, 143), 'K': (149, 186, 251), 'L': (143, 251, 143), 'M': (143, 251, 143), 'N': (151, 251, 252), 'P': (181, 181, 181), 'Q': (251, 222, 146), 'R': (149, 186, 251), 'S': (151, 251, 252), 'T': (151, 251, 252), 'V': (143, 251, 143), 'W': (249, 170, 147), 'Y': (249, 170, 147)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.TaylorScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Taylor Scheme'
ANN_TYPE = 1
COLOR_BY_KEY = {'A': (204, 255, 0), 'C': (255, 255, 0), 'D': (255, 0, 0), 'E': (255, 0, 102), 'F': (0, 255, 102), 'G': (255, 153, 0), 'H': (0, 102, 255), 'I': (102, 255, 0), 'K': (102, 0, 255), 'L': (51, 255, 0), 'M': (0, 255, 0), 'N': (204, 0, 255), 'P': (255, 204, 0), 'Q': (255, 0, 204), 'R': (0, 0, 255), 'S': (255, 51, 0), 'T': (255, 102, 0), 'V': (153, 255, 0), 'W': (0, 204, 255), 'Y': (0, 255, 204)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ClustalXScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AlignmentRowColorScheme

KEY_FUNC(aln)

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

NAME = 'Clustal X Scheme'
ANN_TYPE = 1
DEFAULT_COLOR = (222, 222, 222)
COLOR_BY_KEY = {'A': (143, 178, 227), 'C': (226, 134, 131), 'CH': (143, 178, 227), 'D': (191, 88, 191), 'E': (191, 88, 191), 'F': (143, 178, 227), 'G': (198, 121, 153), 'H': (77, 170, 179), 'I': (143, 178, 227), 'K': (191, 86, 86), 'L': (143, 178, 227), 'M': (143, 178, 227), 'N': (116, 191, 78), 'P': (166, 157, 66), 'Q': (116, 191, 78), 'R': (191, 86, 86), 'S': (116, 191, 78), 'T': (116, 191, 78), 'V': (143, 178, 227), 'W': (143, 178, 227), 'Y': (77, 170, 179)}
THRESHOLDS = {'A': (('WLVIMAFCHP', 0.6),), 'D': (('KR', 0.6), ('K', 0.85), ('R', 0.85), ('Q', 0.85), ('ED', 0.5)), 'E': (('KR', 0.6), ('QE', 0.5), ('E', 0.85), ('Q', 0.85), ('D', 0.85)), 'F': (('WLVIMAFCHP', 0.6),), 'H': (('WLVIMAFCHP', 0.6), ('W', 0.85), ('Y', 0.85), ('A', 0.85), ('C', 0.85), ('P', 0.85), ('Q', 0.85), ('F', 0.85), ('H', 0.85), ('I', 0.85), ('L', 0.85), ('M', 0.85), ('V', 0.85)), 'I': (('WLVIMAFCHP', 0.6),), 'K': (('KR', 0.6), ('K', 0.8), ('R', 0.8), ('Q', 0.8)), 'L': (('WLVIMAFCHP', 0.6),), 'M': (('WLVIMAFCHP', 0.6),), 'N': (('N', 0.5), ('Y', 0.85)), 'Q': (('KR', 0.6), ('QE', 0.5), ('QEKR', 0.85)), 'R': (('KR', 0.6), ('K', 0.8), ('R', 0.8), ('Q', 0.8)), 'S': (('WLVIMAFCHP', 0.6), ('TS', 0.5), ('S', 0.85), ('T', 0.85)), 'T': (('WLVIMAFCHP', 0.6), ('TS', 0.5), ('S', 0.85), ('T', 0.85)), 'V': (('WLVIMAFCHP', 0.6),), 'W': (('WLVIMAFCHP', 0.6),), 'Y': (('WLVIMAFCHP', 0.6), ('W', 0.85), ('Y', 0.85), ('A', 0.85), ('C', 0.85), ('P', 0.85), ('Q', 0.85), ('F', 0.85), ('H', 0.85), ('I', 0.85), ('L', 0.85), ('M', 0.85), ('V', 0.85))}
classmethod getCategoryByThreshold(res, aln)[source]

Return the resname for the residue only if it meets certain conditions.

The returned resname is matched with a color in the COLOR_BY_KEY dict. If None is returned, the DEFAULT_COLOR will be used.

See http://www.jalview.org/help/html/colourSchemes/clustal.html for rules.

getColorKeyToolTipByResAndAln(res, aln)[source]

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters
Returns

A tool tip describing the color key.

Return type

str

getSchemeSummary()[source]

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Given a residue and an alignment, returns a QBrush for the background color

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByResAndAln(res, aln)

Given a residue and an alignment, returns a color

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.AlignmentSetScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AlignmentRowColorScheme

ANN_TYPE = 2
COLOR_BY_KEY = {0: (141, 211, 199), 1: (255, 255, 179), 2: (190, 186, 218), 3: (251, 128, 114), 4: (128, 177, 211), 5: (253, 180, 98), 6: (179, 222, 105), 7: (252, 205, 229)}
classmethod KEY_FUNC(res, aln)[source]

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Given a residue and an alignment, returns a QBrush for the background color

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByResAndAln(res, aln)

Given a residue and an alignment, returns a color

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

getColorKeyToolTipByResAndAln(res, aln)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters
Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.HelixPropensityScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Helix Propensity'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.helix_propensity: 6>)
COLOR_BY_KEY = {<HELIX_PROPENSITY.Likely: 2>: (249, 146, 146), <HELIX_PROPENSITY.Weak: 3>: (194, 147, 251), <HELIX_PROPENSITY.Ambivalent: 4>: (181, 181, 181), <HELIX_PROPENSITY.HelixBreaking: 5>: (149, 186, 251), <HELIX_PROPENSITY.NoPropensity: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Helix Propensity Color Code:\nred - helix-forming\nmagenta - weak helix-forming\ngrey - ambivalent\nblue - helix-breaking\nwhite - no propensity'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.StrandPropensityScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Strand Propensity'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.beta_strand_propensity: 7>)
COLOR_BY_KEY = {<BETA_STRAND_PROPENSITY.StrandForming: 4>: (249, 146, 146), <BETA_STRAND_PROPENSITY.Ambivalent: 3>: (181, 181, 181), <BETA_STRAND_PROPENSITY.StrandBreaking: 2>: (149, 186, 251), <BETA_STRAND_PROPENSITY.NoPropensity: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Beta Strand Color Code:\nblue - strand-forming\ngrey - ambivalent\nred - strand-breaking'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.TurnPropensityScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Turn Propensity'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.turn_propensity: 8>)
COLOR_BY_KEY = {<TURN_PROPENSITY.TurnForming: 2>: (151, 251, 252), <TURN_PROPENSITY.Ambivalent: 3>: (181, 181, 181), <TURN_PROPENSITY.TurnBreaking: 4>: (250, 147, 251), <TURN_PROPENSITY.NoPropensity: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Turn Propensity Color Code:\ncyan - turn-forming\ngrey - ambivalent\nmagenta - turn-breaking'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.HelixTerminationTendencyScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Helix Termination'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.helix_termination_tendency: 9>)
COLOR_BY_KEY = {<HELIX_TERMINATION_TENDENCY.NoTendency: 1>: (222, 222, 222), <HELIX_TERMINATION_TENDENCY.HelixStarting: 2>: (143, 251, 143), <HELIX_TERMINATION_TENDENCY.Ambivalent: 3>: (181, 181, 181), <HELIX_TERMINATION_TENDENCY.HelixEnding: 4>: (249, 146, 146)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Helix Termination Tendency:\ngreen - helix-starting\ngrey - ambivalent\nred - helix-ending'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.HydrophobicityKDScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Hydrophobicity (Kyte-Doolittle)'
ANN_TYPE = 1
COLOR_BY_KEY = {'A': (255, 153, 153), 'C': (255, 113, 113), 'D': (56, 56, 255), 'E': (56, 56, 255), 'F': (255, 96, 96), 'G': (232, 232, 255), 'H': (73, 73, 255), 'I': (255, 0, 0), 'K': (34, 34, 255), 'L': (255, 39, 39), 'M': (255, 147, 147), 'N': (56, 56, 255), 'P': (164, 164, 255), 'Q': (56, 56, 255), 'R': (0, 0, 255), 'S': (209, 209, 255), 'T': (215, 215, 255), 'V': (255, 16, 16), 'W': (204, 204, 255), 'Y': (181, 181, 255)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.HydrophobicityHWScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Hydrophobicity (Hopp-Woods)'
ANN_TYPE = 1
COLOR_BY_KEY = {'A': (217, 217, 255), 'C': (179, 179, 255), 'D': (255, 30, 30), 'E': (255, 30, 30), 'F': (67, 67, 255), 'G': (255, 255, 255), 'H': (217, 217, 255), 'I': (120, 120, 255), 'K': (255, 30, 30), 'L': (120, 120, 255), 'M': (157, 157, 255), 'N': (255, 240, 240), 'P': (255, 255, 255), 'Q': (255, 240, 240), 'R': (255, 30, 30), 'S': (255, 232, 232), 'T': (225, 225, 255), 'V': (142, 142, 255), 'W': (0, 0, 255), 'Y': (82, 82, 255)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.SecondaryStructureScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Secondary Structure'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.secondary_structure: 18>)
COLOR_BY_KEY = {-1: (222, 222, 222), 0: (222, 222, 222), 1: (247, 150, 131), 2: (136, 216, 236), 3: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

KEY_NAMES = {-1: 'None', 0: 'Loop', 1: 'Helix', 2: 'Strand', 3: 'Turn'}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.BFactorScheme(ramp=None, *, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.AbstractColorRampOnlyScheme

NAME = 'B-Factor'
ANN_TYPE = 1
DEFAULT_RAMP = <schrodinger.application.msv.gui.color_ramp.NamedColorRamp object>
getColorByRes(res)[source]

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getBrushByRes(res)[source]

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getColorKeyToolTipByRes(res)[source]

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getColorByKey(key)[source]

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getBrushByKey(key)[source]

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(ramp=None, *, custom=False)
Parameters
  • ramp (color_ramp.NamedColorRamp or None) – The color ramp to use. This ramp must define colors for input values from 0 to 100. If None, DEFAULT_RAMP will be used.

  • custom (bool) – Whether this color scheme instance contains a user-defined color ramp (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ExposureTendencyScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Exposure Tendency'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.exposure_tendency: 10>)
COLOR_BY_KEY = {<SOLVENT_EXPOSURE_TENDENCY.Surface: 2>: (149, 186, 251), <SOLVENT_EXPOSURE_TENDENCY.Ambivalent: 3>: (181, 181, 181), <SOLVENT_EXPOSURE_TENDENCY.Buried: 4>: (251, 222, 146), <SOLVENT_EXPOSURE_TENDENCY.NoTendency: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Solvent Exposure Tendency:\nblue - surface\ngrey - ambivalent\norange - buried'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.StericGroupScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Steric Group'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.steric_group: 11>)
COLOR_BY_KEY = {<STERIC_GROUP.Small: 2>: (249, 146, 146), <STERIC_GROUP.Ambivalent: 3>: (250, 147, 251), <STERIC_GROUP.Polar: 4>: (151, 251, 252), <STERIC_GROUP.Aromatic: 5>: (149, 186, 251), <STERIC_GROUP.NoSteric: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Steric Group Color Code:\nred - small, non-interfering\nmagenta - ambivalent\ncyan - sticky polar\nblue - aromatic'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.SideChainChemistryScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Side Chain Chemistry'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.side_chain_chem: 12>)
COLOR_BY_KEY = {<SIDE_CHAIN_CHEM.AcidicHydrophilic: 2>: (251, 147, 194), <SIDE_CHAIN_CHEM.BasicHydrophilic: 3>: (149, 186, 251), <SIDE_CHAIN_CHEM.NeutralHydrophobicAliphatic: 4>: (143, 251, 143), <SIDE_CHAIN_CHEM.NeutralHydrophobicAromatic: 5>: (249, 170, 147), <SIDE_CHAIN_CHEM.NeutralHydrophilic: 6>: (151, 251, 252), <SIDE_CHAIN_CHEM.PrimaryThiol: 7>: (251, 251, 146), <SIDE_CHAIN_CHEM.IminoAcid: 8>: (181, 181, 181), <SIDE_CHAIN_CHEM.NoSideChainChem: 1>: (222, 222, 222)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Side Chain Chemistry:\nred - acidic, hydrophilic\nblue - basic, hydrophilic\ngreen - neutral, hydrophobic, aliphatic\norange - neutral, hydrophobic, aromatic\ncyan - neutral, hydrophilic\nyellow - primary thiol\ndark grey - imino acid'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ResidueChargeScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Residue Charge'
ANN_TYPE = 1
COLOR_BY_KEY = {<RESIDUE_CHARGE.Positive: 1>: (0, 0, 255), <RESIDUE_CHARGE.Neutral: 3>: (160, 160, 160), <RESIDUE_CHARGE.Negative: 2>: (255, 46, 46)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Residue Charge Color Code:\nred - negative\nblue - positive\ngrey - neutral'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.WorkspaceScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Workspace Colors'
ANN_TYPE = 1
getSchemeSummary()[source]

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ChainNameScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Chain Name'
ANN_TYPE = 1
COLOR_BY_KEY = {'A': (46, 255, 46), 'B': (46, 255, 255), 'C': (255, 107, 255), 'D': (255, 255, 46), 'E': (255, 144, 107), 'F': (230, 230, 230), 'G': (107, 107, 255), 'H': (255, 150, 46), 'I': (107, 255, 107), 'J': (0, 140, 140), 'K': (255, 46, 150), 'L': (255, 218, 107), 'M': (104, 0, 140), 'N': (191, 191, 191), 'O': (0, 102, 204), 'P': (204, 204, 0), 'Q': (181, 255, 107), 'R': (0, 204, 204), 'S': (140, 69, 0), 'T': (255, 181, 107), 'U': (255, 107, 107), 'V': (255, 107, 181), 'W': (107, 255, 255), 'X': (255, 255, 107), 'Y': (0, 204, 102), 'Z': (0, 69, 188)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DESCRIPTION = 'Chain Name'
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ColorRangeKey(min_value, max_value)[source]

Bases: schrodinger.application.msv.gui.color.ColorRangeKey

A key for use in ResiduePropertyScheme. Represents a range of property values.

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

max_value

Alias for field number 1

min_value

Alias for field number 0

class schrodinger.application.msv.gui.color.AbstractResiduePropertyScheme(seq_prop, ramp)[source]

Bases: schrodinger.application.msv.gui.color.AbstractColorRampScheme

Abstract class for residue property color schemes.

Derived classes must define _ATTRS as a tuple of private attributes that represent additional init args between seq_prop and ramp. These attributes will be automatically considered when comparing, copying, and jsonifying the class. For example, a derived class with an additional argument foo should look like this:

class FooScheme(AbstractResiduePropertyScheme):
    _ATTRS = ('_foo',)

    def __init__(self, seq_prop, foo, ramp):
        super().__init__(seq_prop, ramp)
        self._foo = foo
__init__(seq_prop, ramp)[source]
Parameters
  • ramp (color_ramp.NamedColorRamp) – The color ramp to use.

  • custom (bool) – Whether this color scheme instance contains a user-defined color ramp (set via the Define Custom Color Scheme dialog).

ANN_TYPE = None
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ResiduePropertyScheme(seq_prop, min_value, max_value, num_bins, ramp)[source]

Bases: schrodinger.application.msv.gui.color.AbstractResiduePropertyScheme

NAME = 'Residue Property'
ANN_TYPE = 1
__init__(seq_prop, min_value, max_value, num_bins, ramp)[source]
Parameters
  • seq_prop (protein.properties.SequenceProperty) – The property name to color by. Property values will be taken from the alpha-carbon of the residue. The value should be the property’s data name, not user name (i.e. “i_m_whatever_property”, not “whatever property”) and property values must be numerical, not strings.

  • min_value (float) – The minimum value to color.

  • max_value (float) – The maximum value to color.

  • num_bins (int) – The number of different colors to use.

  • ramp (schrodinger.structutils.color.ColorRamp) – The color ramp to use for the initial colors. This ramp must have a minimum value of 0 and a maximum value of 100.

KEY_FUNC

alias of str

property seq_prop
property min_value
property max_value
property num_bins
property prop_name
property display_name
keyFunc(res)[source]

Convert a residue to the appropriate ColorRangeKey based on the property value. Will return None if the residue doesn’t have a value for the specified property or if the property value is outside the range of values this instance has colors for.

Parameters

res (residue.AbstractSequenceElement) – The residue or gap to convert.

Returns

The appropriate key.

Return type

ColorRangeKey or None

getKeys()[source]

Return a list of all possible key values. :rtype: list[object]

prettyKeyName(key)[source]

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

getSchemeSummary()[source]

@overrides: AbstractColorRampScheme.getSchemeSummary

Return a dictionary where key is an RGB tuple and the value is a range of property values that the color represents

Returns

RGB tuple to property value range map.

Return type

dict{tuple(RGB color):str(range of property value)}

getColorKeyToolTipByRes(res)[source]

Get a tool tip describing the color scheme for the specified residue.

Displays the actual residue value and wraps the custom color range with a color descriptor.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.CategoricalResiduePropertyScheme(seq_prop, categories, ramp)[source]

Bases: schrodinger.application.msv.gui.color.AbstractResiduePropertyScheme

NAME = 'Categorical Residue Property'
ANN_TYPE = 1
__init__(seq_prop, categories, ramp)[source]
Parameters
  • seq_prop (protein.properties.SequenceProperty) – The property name to color by. Property values will be taken from the alpha-carbon of the residue. The property values must be either numeric (between -1 to 10, both inclusive) or string.

  • categories (list[str] or list[int]) – The categories in which the property value will fall

  • ramp (schrodinger.structutils.color.ColorRamp) – The color ramp to use for the initial colors. This ramp must have a minimum value of 0 and a maximum value of 100.

KEY_FUNC

alias of str

keyFunc(res)[source]

Convert a residue to the appropriate key (property value). Return None if the residue doesn’t have a value for the specified property or its a gap filling residue.

Parameters

res (protein.residue.Residue) – residue or gap to convert.

Returns

key for the residue.

Return type

str or None

getSchemeSummary()[source]

@overrides: AbstractColorRampScheme.getSchemeSummary

Return a dictionary where key is an RGB tuple and the value is a category

Returns

RGB tuple to category map

Return type

dict(tuple, str)

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = None
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

property ramp
removeKey(key)

Override removeKey so that it raises an Exception.

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.NoColorScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

NAME = 'No Color'
ANN_TYPE = 1
COLOR_BY_KEY = {None: (160, 160, 160)}
getSchemeSummary()[source]

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.BindingSiteScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Binding Site'
ANN_TYPE = 19
COLOR_BY_KEY = {<BINDING_SITE.CloseContact: 1>: (255, 0, 0), <BINDING_SITE.FarContact: 2>: (255, 136, 0), <BINDING_SITE.NoContact: 3>: (0, 0, 0, 0)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.AntibodyCDRScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Antibody CDR'
ANN_TYPE = 21
COLOR_BY_KEY = {<AntibodyCDRLabel.NotCDR: 1>: (36, 36, 36), <AntibodyCDRLabel.L1: 2>: (255, 0, 0), <AntibodyCDRLabel.L2: 3>: (255, 0, 0), <AntibodyCDRLabel.L3: 4>: (255, 0, 0), <AntibodyCDRLabel.H1: 5>: (255, 0, 0), <AntibodyCDRLabel.H2: 6>: (255, 0, 0), <AntibodyCDRLabel.H3: 7>: (255, 0, 0)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.DomainScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Domains'
ANN_TYPE = 20
COLOR_BY_KEY = {<Domains.Domain: 1>: (249, 146, 146), <Domains.NoDomain: 2>: (64, 64, 64)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.HydrophobicityBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 16
COLOR_BY_KEY = {'hydrophobicity': (240, 160, 240)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.IsoelectricBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 17
COLOR_BY_KEY = {'isoelectric': (160, 240, 192)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.BFactorBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 15
COLOR_BY_KEY = {'b_factor': (134, 162, 246)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.MeanHydrophobicityBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 2
COLOR_BY_KEY = {'mean_hydrophobicity': (240, 160, 240)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.MeanIsoelectricBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 3
COLOR_BY_KEY = {'mean_isoelectric': (160, 240, 192)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ConsensusFreqBarScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 6
COLOR_BY_KEY = {'consensus_freq': (160, 240, 192)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.DisulfideScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = [<ANNOTATION_TYPES.disulfide_bonds: 5>, <ANNOTATION_TYPES.pred_disulfide_bonds: 24>]
COLOR_BY_KEY = {'disulfide_bonds': (255, 255, 255)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ConstraintScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 1
COLOR_BY_KEY = {'pairwise_constraints': (70, 166, 232)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.ProximityConstraintScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.SingleColorScheme

ANN_TYPE = 29
COLOR_BY_KEY = {'proximity_constraints': (20, 133, 16)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
NAME = ''
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key=None)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res=None)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key=None)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res=None)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.KinaseFeatureScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Kinase Features'
ANN_TYPE = 30
COLOR_BY_KEY = {<KinaseFeatureLabel.GLYCINE_RICH_LOOP: 'Glycine Rich Loop'>: (155, 112, 255), <KinaseFeatureLabel.ALPHA_C: 'Alpha-C'>: (110, 250, 110), <KinaseFeatureLabel.GATE_KEEPER: 'Gate Keeper'>: (248, 110, 250), <KinaseFeatureLabel.HINGE: 'Hinge'>: (250, 143, 110), <KinaseFeatureLabel.LINKER: 'Linker'>: (250, 250, 110), <KinaseFeatureLabel.HRD: 'HRD'>: (110, 250, 252), <KinaseFeatureLabel.CATALYTIC_LOOP: 'Catalytic Loop'>: (217, 95, 110), <KinaseFeatureLabel.DFG: 'DFG'>: (110, 161, 250), <KinaseFeatureLabel.ACTIVATION_LOOP: 'Activation Loop'>: (250, 210, 110), <KinaseFeatureLabel.NO_FEATURE: 'No Feature'>: (181, 181, 181)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC

alias of str

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.KinaseConservationScheme(*, custom=False)[source]

Bases: schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Kinase Conservation'
ANN_TYPE = 31
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

DEFAULT_COLOR = (0, 0, 0, 0)
COLOR_BY_KEY = {<KinaseConservation.VeryLow: 'Very Low'>: (226, 53, 30), <KinaseConservation.Low: 'Low'>: (235, 190, 53), <KinaseConservation.Medium: 'Medium'>: (124, 163, 207), <KinaseConservation.High: 'High'>: (34, 223, 170), <KinaseConservation.VeryHigh: 'Very High'>: (11, 196, 28)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*, custom=False)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.PredictedAnnotationMixin(*args, **kwargs)[source]

Bases: object

Should be mixed in with subclasses of AbstractRowColorScheme.

__init__(*args, **kwargs)[source]
class schrodinger.application.msv.gui.color.PredictedSecondaryStructureScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.PredictedAnnotationMixin, schrodinger.application.msv.gui.color.SecondaryStructureScheme

ANN_TYPE = 25
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
COLOR_BY_KEY = {-1: (222, 222, 222), 0: (222, 222, 222), 1: (247, 150, 131), 2: (136, 216, 236), 3: (222, 222, 222)}
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = {-1: 'None', 0: 'Loop', 1: 'Helix', 2: 'Strand', 3: 'Turn'}
NAME = 'Secondary Structure'
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.PredictedSolventAccessibilityScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.PredictedAnnotationMixin, schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Predicted Solvent Accessibility'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.pred_accessibility: 26>)
COLOR_BY_KEY = {<SolventAccessibility.BURIED: 1>: (235, 235, 45), <SolventAccessibility.EXPOSED: 2>: (46, 64, 198)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.PredictedDisorderedRegionsScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.PredictedAnnotationMixin, schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Predicted Disordered Regions'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.pred_disordered: 27>)
COLOR_BY_KEY = {<Disordered.HIGHSCORE: 1>: (255, 0, 0), <Disordered.MEDIUMSCORE: 2>: (255, 127, 0), <Disordered.LOWSCORE: 3>: (85, 85, 85)}
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.

class schrodinger.application.msv.gui.color.PredictedDomainArrangementScheme(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.color.PredictedAnnotationMixin, schrodinger.application.msv.gui.color.ResidueRowColorScheme

NAME = 'Predicted Domain Arrangement'
ANN_TYPE = (<RowType.Sequence: 1>, <ANNOTATION_TYPES.pred_domain_arr: 28>)
COLOR_BY_KEY = {<DomainArrangement.Interdomain: 1>: (255, 0, 0), <DomainArrangement.DomainForming: 2>: (181, 181, 181)}
CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
DEFAULT_COLOR = (222, 222, 222)
DESCRIPTION = ''
KEY_FUNC()

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

KEY_NAMES = None
SEL_CHAIN_DIVIDER_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR = <PyQt5.QtGui.QColor object>
TEXT_COLOR_GAP = <PyQt5.QtGui.QColor object>
TEXT_COLOR_TERM_GAP = <PyQt5.QtGui.QColor object>
__init__(*args, **kwargs)
Parameters

custom (bool) – Whether this color scheme instance will contain user-defined colors (set via the Define Custom Color Scheme dialog).

classmethod adapter50003(json_dict)

MSV-3197

classmethod adapter_50003(json_dict)

For ResiduePropertyScheme we switch from using property names to access structure properties on atoms to SequencePropertys to access structure properties or descriptors

property display_name
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Create a new class instance from a JSON dictionary. See json.JsonableClassMixin for additional documentation.

Parameters

json_dict (dict) – The data that was read in the JSON file.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

getBrushByKey(key)

Get a brush for the specified key. Note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (object) – The key to fetch the color for

Returns

The requested brush.

Return type

QtGui.QBrush

getBrushByRes(res)

Get the brush for the specified residue. If None or a gap is passed in, None will be returned.

Note that this method does not check custom residue colors set via updateCustomResColors. Only the colors specified via COLOR_BY_KEY or setColor will be returned. Use getColorByRes is custom residue colors are required. Also note that the returned brush must not be modified, as that will affect the brush stored in this class. If modifications are necessary, make a copy of the brush first. (The brush is not copied before being returned for performance reasons.)

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

The requested brush.

Return type

QtGui.QBrush or None

getBrushByResAndAln(res, aln)

Get a brush for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Returns

The requested brush.

Return type

QtGui.QBrush or None

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorByKey(key)

Get a color tuple for the specified key.

Parameters

key (object) – The key to fetch the color for

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int)

getColorByRes(res)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters

key (residue.Residue or None) – The residue to fetch the color for.

Returns

A tuple representing the requested color.

Return type

tuple(int, int, int) or None

getColorByResAndAln(res, aln)

Get a color tuple for the specified residue. If None or a gap is passed in, None will be returned.

Parameters
Return type

tuple(int, int, int)

Returns

A tuple representing (r, g, b) values

This method exists on the ResidueRowColorScheme to make it compatible with an AlignmentRowColorScheme.

getColorKeyToolTipByRes(res)

Get a tool tip describing the color scheme for the specified residue. If None or a gap is passed in, an empty str will be returned.

If the residue is set with a custom color, then an empty str will be returned.

Parameters

res (residue.Residue or None) – The residue to fetch the color key tool tip for.

Returns

A tool tip describing the color key.

Return type

str

getCustomResColorMap()

Get the map of custom residue colors

Returns

Custom residue color map

Return type

dict(residue.Residue, tuple(int, int, int))

getKeys()

Return a list of all possible key values. :rtype: list[object]

getSchemeSummary()

Return a dictionary where each key is an RGB tuple and the value is a text description of what that color represents.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

prettyKeyName(key)

Get a name for the specified key suitable for presenting to the user.

Parameters

key (object) – The key to fetch the name for.

Returns

The key name

Return type

str

removeKey(key)

Removes a key color pair from the color dict (also removes the corresponding brush from the brush dict)

Parameters

key (object) – The key to remove from the color scheme

Returns

the corresponding color if the key is in the color scheme

Return type

tuple(int, int, int)

setColor(key, r, g, b)

Set a new color for the specified key.

Parameters
  • key (object) – The key value to set the color for.

  • r (int) – The red value of the color.

  • g (int) – The green value of the color.

  • b (int) – The blue value of the color.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Convert this class to a JSON-able object. See json.JsonableClassMixin for additional documentation.

Note

We don’t store custom residue colors (set via updateCustomResColors) in the JSON file. These colors are only used for matching the coloring of the Maestro workspace in WorkspaceScheme, so they can easily be regenerated after the JSON file is read in.

updateCustomResColors(color_map)

Apply a custom color to a list of residues using a map of residues keyed to the color tuples to be applied, or None to remove custom colors.

Parameters

color_map (dict(residue.Residue, tuple(int, int, int))) – Map of residues and the colors to apply

Note

Residue highlighting (i.e. the “Paint selected” swatches in the “Color Sequences” pop up) are implemented using schrodinger.application.msv.gui.gui_alignment._ProteinAlignment.setResidueHighlight. Color scheme custom res colors are currently only used for workspace colors.