Package schrodinger :: Package application :: Package bioluminate :: Module pml_menus
[hide private]
[frames] | no frames]

Module pml_menus

The module that creates the actions and menus for the Pymol-like interface of BioLuminate.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  ResultsWindow
  MWidgetAction
A QAction that performs a Maestro command
  MAction
A QAction that performs a Maestro command
  PMLMenu
The base menu class we subclass from
  PMLContextMenu
The base menu class we subclass from for context menus
  RockData
Stores information about the current workspace rocking state
  LigandActionMixin
Class that contains a method to restrict the asl to Ligands only
  ShowLines
  ShowLigandLines
  ShowTubes
  ShowLigandTubes
  ShowBAndS
  ShowNonBonded
  ShowNonBondedSpheres
  ShowSpheres
  ShowLigandSpheres
  ShowCartoonOrRibbon
  ShowCartoon
  ShowRibbon
  ShowLabel
  SurfaceRender
Base class for actions that render a surface
  ShowSurface
  ShowMesh
  ShowSubstructureMenu
The Show->substructure submenus
  ShowOrganicMenu
The Show->Organic submenus
  AsMenu
The Show->As submenu
  ShowMenu
The Show menu
  Zoom
  Orient
  Center
  Origin
  Clean
  Rename
  DeleteWS
  DeleteProject
  Duplicate
  MakeProjectEntry
Copies the atoms into a new project entry and includes it in the workspace
  Ray
Use PyMOL to make a ray-traced image
  Extend
Expand the selection to the atoms within X bonds of the ASL for this object
  InvertCompleteSelection
Invert or complete the selection within an object
  SelectWithinEntry
  SelectWithinChain
  SelectWithinResidue
  SelectWithinMolecule
  SelectWithinAny
  SelectWithinCalpha
  Expand
Expand the selection to the atoms around the ASL for this object
  Around
  EntrySubMenu
A submenu that lists all enabled Entry objects
  SelectionSubMenu
A submenu that lists all enabled Entry objects
  RestrictSelection
Restrict the selection to a specific object
  RestrictToVisible
  RestrictToPolymer
  RestrictToOrganic
  RestrictToSolvent
  RestrictToInorganic
  RestrictSubMenu
The modify-restrict submenu of the action menu
  IncludeInSelection
Include a specific object in the selection
  IncludeVisibleInSelection
  ExcludeFromSelection
  ExcludeVisibleFromSelection
  ExcludePolymerFromSelection
  ExcludeOrganicFromSelection
  ExcludeSolventFromSelection
  ExcludeInorganicFromSelection
  IncludeSubMenu
The modify-include submenu of the action menu
  ExcludeSubMenu
The modify-exclude submenu of the action menu
  AroundExpandSubMenu
The modify-around submenu of the action menu
  ExtendSubMenu
The modify-extend submenu of the action menu
  InvertSubMenu
The modify-invert submenu of the action menu
  CompleteSubMenu
The modify-complete submenu of the action menu
  ModifySubMenu
The modify submenu of the action menu
  PresetAction
Base class for Preset Actions
  SimplePreset
  BAndSPreset
  BFactorPreset
  TechnicalPreset
  LigandPreset
  PrettyPubPreset
Show the object as nice-looking cartoon ribbons
  DefaultPreset
  InterfaceMixin
Determine the Protein-Protein interface atoms
  InterfacePreset
  RegionInfo
  AntibodyPreset
  LigandSitesSubMenu
The Action-Preset-Ligand Sites submenu
  PresetSubMenu
The Preset submenu
  PolarContactsObject
  PolarContactsWithSidechains
  PolarContactsWithSolvent
  PolarContactsWithoutSolvent
  PolarContactsWithoutMainchain
  PolarContactsWithoutIntraMainchain
  PolarContactsOnlySidechain
  PolarContactsOnlyMainchain
  PolarContactsToEntry
  PolarContactsToEntryWithoutSolvent
  PolarContactsToAnyAtoms
  PolarContactsToAnyNonSolvent
  FindPCSubMenu
The Find Polar Contacts submenu
  RemovePC
  PolarContactsSubMenu
The Polar Contacts submenu
  GenerateSelection
Select the atoms, then generate a selection object from them
  GenerateInterfaceSelection
  GenerateLigandSelection
  GenerateSurfResSelection
  GenSelectionSubMenu
The Action Generate Selection submenu
  GenerateSymmetryMates
Generate all the symmetry mates and show those within X angstroms
  HideSymmetryMates
  GenSymMatesSubMenu
The Action Generate Symmetry Mates submenu
  GenerateSubMenu
The Action Generate submenu
  AddHydrogens
  RemoveHydrogens
  RemoveWaters
  DeleteAtoms
  HydrogenSubMenu
The Action Hydrogen submenu
  CountAtoms
  SumFormalCharge
  SumPartialCharge
  ComputeSurfaceArea
  SurfaceAreaSubMenu
The Action Surface Area submenu
  ComputeSubMenu
The Action Compute submenu
  DeleteSelections
  ActionMenu
The Action menu
  HideEverything
  HideAtoms
  HideNonBonded
  HideRibbons
  HideSurface
  HideLabel
  HideMainChain
  HideSideChain
  HideWaters
  HideHydrogens
  HideAllOthers
  HidePolarHydrogens
  HideHydrogenSubMenu
The Hide Hydrogen submenu
  HideMenu
The Hide menu
  LabelAtom
A QAction that performs labels atoms with the given label
  LabelAtomByProp
Labels all atoms by a custom atom property
  LabelAtomByVDW
  LabelAtomByOccupancy
  LabelAtomByNumType
  LabelAtomByStereo
  LabelAtomByEntryIndex
  LabelAtomByMolIndex
  LabelResidues
  LabelChains
  LabelOtherSubMenu
The Label Other Properties submenu
  LabelAtomIdentSubMenu
The Label Atom Identifiers submenu
  LabelMenu
The Label menu
  ColorChooserPanel
A window that lets the user choose a Maestro color.
  ColorRibbonMixin
  CustomColor
  ColorHydrogens
  ColorCarbons
  ColorHNOS
  ColorObject
  ColorRecentCarbons
  ColorRecentHydrogens
  ColorRecentObjects
  ColorChains
  ColorChainsByCarbon
  ColorChainsByCalpha
  ColorAtomsBySpectrum
  ColorCarbonsBySpectrum
  ColorCalphasBySpectrum
  ColorAtomsByBFactor
  ColorCalphasByBFactor
  ColorChainbows
  ColorLabel
A label that shows off the color each element will be colored if this menu item is chosen.
  RecentColorSubMenu
A submenu that shows the most recently chosen colors - these color choices are updated each time the menu shows to reflect the most recently chosen colors at the top.
  RecentCarbonColorSubMenu
A submenu that shows the most recently chosen carbon colors - these color choices are updated each time the menu shows to reflect the most recently chosen colors at the top.
  RecentHydrogenColorSubMenu
A submenu that shows the most recently chosen hydrogen colors - these color choices are updated each time the menu shows to reflect the most recently chosen colors at the top.
  RecentObjectColorSubMenu
A submenu that shows the most recently chosen object colors - these color choices are updated each time the menu shows to reflect the most recently chosen colors at the top.
  ColorByElementSubMenu
The Color by Element submenu
  ColorChainSubMenu
The ColorChainSubMenu menu
  ColorSpectrumSubMenu
The ColorSpectrumSubMenu menu
  CustomRecentColor
  ColorBySubstructure
  ColorSubstructureSubMenu
The ColorSubstructureSubMenu menu
  AutoCycleColor
  AutoCycleCarbonColor
  AutoColorObjects
  AutoColorCarbons
  AutoColorSubMenu
The Color menu
  ColorMenu
The Color menu
  ToggleState
A MAction that toggles the enabled/disabled state of an object
  DeleteAll
  Reinitialize
  Quit
  Select
  Disable
  CreateEntry
  GeneralContextSubMenu
The submenu that contains all the main actions used for most context menus
  SubstructureContextSubMenu
The GeneralContextSubMenu for a right-click that is on an atom
  ObjectFreeContextSubMenu
The GeneralContextSubMenu for a right-click that is not on an object
  ToggleStateSubMenu
The submenu that allows the user to enable/disable individual objects
  SelectedAtomContextActionSubMenu
The submenu that allows the user to enable/disable individual objects
  SelectedAtomContextMenu
The context menu for right-clicks on selected atoms
  AtomContextMenu
The context menu for right-clicks on non-selected atoms
  SpaceContextMenu
The context menu for right-clicks in space
Functions [hide private]
 
set_wait_cursor()
Set the cursor to a wait cursor if the toggle_table widget is defined
 
restore_cursor()
Restore the cursor to its nomral state if the toggle_table widget is defined
 
start_progress(maximum)
Show and restart the progress bar on the Toggle Table if the TT is defined
 
update_progress(inc=1, total=None)
Show the current progress on the progress bar on the Toggle Table if the TT is defined
 
end_progress()
Finish the progress bar and hide it
 
show_result(msg)
 
maestro_command(command)
A wrapper that handles exceptions from Maestro commands
tuple
get_matching_ws_atoms(asl, extract=False)
Get the atoms in the workspace structure that match the given asl
list or None
get_matching_ws_entries(owner, asl)
Get the entries in the workspace structure are affected by the given asl
list
get_visible_ws_atoms()
Return list of the the Visible workspace atoms
str
get_visible_ws_asl()
Return an ASL that represents the Visible workspace atoms
str
join_asls(asl1, asl2, joiner='AND')
Joins 2 asls with the given joiner (default is AND)
str
mod_asl(modifier, asl)
Puts a modifier in front of asl - which it protects in ()'s to make sure the modifier applies to the whole asl
iterable
get_surfaces(entry)
Get the surfaces associated with entry_id entry
list
find_all_table_entry_objects(owner)
Get the structures in the workspace referred to by a given toggle table entry
 
display_atoms_as(asl, atoms, bonds=None, owner=None)
Display atoms and bonds with the given style, and turn off ribbons and surfaces
 
display_atoms(asl, atoms, bonds=None, owner=None)
Display atoms and bonds with the given style, leaving ribbons as is
 
_display_atoms_visible(asl, atoms, bonds, entry_ids)
Display the specified atoms and bonds for a visible entry
 
_display_atoms_invisible(asl, atoms, bonds, cur_owner)
Set atom display properties (without displaying the atoms) for invisible entries
tuple
_determine_visible_entries(owner)
Determine all visible and invisible entries that a toggle table object refers to.
str
_add_entry_id_to_asl(asl, cur_entry_id)
Modify the ASL to include current entry id
 
display_ribbons(asl, style, hideatoms=False, scheme=CALPHA_SCHEME, owner=None)
Show ribbons
 
_display_ribbons_visible(asl, entry_ids, style, hideatoms, scheme)
Display all ribons for a visible (i.e.
 
_display_ribbons_invisible(asl, style, scheme, owner)
Display all ribons for an invisible (i.e.
 
_update_ribbon_dict_bypos(mmct_style, toggle_table_entry, atoms, cur_entry_id, workspace)
Update the ribbon_bypos_styles dictionary, which stores ribbon display information for invisible entries
 
_update_ribbon_dict_byca(mmct_style, toggle_table_entry, atoms, cur_entry_id, workspace)
Update the ribbon_bypca_styles dictionary, which stores ribbon display information for invisible entries
 
rock_workspace(interval=1, amount=1, span=25)
Rotate the workspace back and forth smoothly by small degree increments over a span of degrees range.
 
stop_rocking()
Stop any rocking currently happening
 
_do_rocking()
Callback used to rock the workspace
 
_rocker_recall()
Removes the Maestro rocker callback
 
display_image(image_file)
Tries to display the image file in the default image viewer
str or None
ensure_proper_extension(filename, extensions)
Ensure that filename ends with the proper extension
 
create_surface(entry, asl, name, transparency=0, quality=0, style='solid', viewasl=None, viewdistance='3', scheme='"Atom Color"', owner=None)
Create a surface
 
_hide_surface_if_necessary(owner, entry, name)
If the owner is invisible, hide the newly created surface
 
create_show_menu(menu, owner)
 
create_show_substructure_menu(menu, owner)
 
create_show_organic_menu(menu, owner)
list
find_all_entries(owner=None, asl=None)
Find all the entries specified by the given owner or asl
list
find_center_of_atoms(struct)
Finds the x,y,z coordinates of the center of the atoms
 
create_modify_menu(menu)
Creates a Modify menu for selections
 
find_polar_contacts(asl1, asl2=None)
Finds all polar contacts (hydrogen bonds) between asl1 and asl2.
 
create_action_menu(menu, owner)
 
hide_atoms(asl=None, owner=None)
Hide the atoms given by asl
str
_add_entries_to_asl(asl, entries)
Add entry ids to an ASL
 
_run_maestro_command(cmd, asl, entries)
Run the given Maestro command on the specified atoms
 
_get_selection_asl(asl, owner)
If the specified ASL is blank and owner is a selection, return the selection ASL.
 
_filter_invisible_atoms(asl, owner)
Remove atoms from the owner.visible_atoms list
 
hide_ribbons(asl=None, owner=None)
Hide ribbons
 
_hide_ribbons_invisible(asl=None, owner=None)
Hide ribbons from an invisible structure.
dict
_filter_ribbon_styles(styles_dict, entry_id, atoms_to_hide_as_str)
Remove the specified atoms from a ToggleTableEntry ribbon styles dictionary
 
_filter_ribbon_colors(owner, entry_id, atoms_to_hide_as_int)
Remove the specified atoms from a ToggleTableEntry ribbon colors dictionary
 
hide_surface(entry_id=None, owner=None, asl=None)
Hide a surface
 
_hide_surface_by_owner(entry_id, owner, asl)
Given the toggle table owner, hide a surface.
 
_hide_surface_visible(entry_id)
hide surfaces from visible entries
 
_hide_surface_invisible(owner)
hide surfaces from invisible entries
 
hide_labels(asl=None, owner=None)
Hide the labels
 
hide_everything(asl=None, entry_id=None, owner=None)
Hide atoms, ribbons and surfaces
 
create_hide_menu(menu, owner)
Create the Hide menu
 
create_label_menu(menu, owner)
Put all the menu items in the Label menu
tuple
get_color()
Get a user-specified color from the list of known Maestro colors
 
color_atoms(color_name, asl)
Colors the specified atoms with the given color
 
color_atoms_rgb(red, green, blue, asl)
Colors the specified atoms with the given RGB colors
str
make_color_asl_for_element(asl, element)
Form an ASL that restricts the given ASL to those atoms of a specific element
 
color_by_element(base_asl, hydrogen=WHITE, carbon=GREEN, nitrogen=BLUE, oxygen=RED, sulfur=ORANGE)
Color H, C, N, O and S by colors
 
save_new_color(color_name, rgba, mytype)
The user has selected a new (or re-selected an existing custom set) - add it to the list of custom sets (or move it to the end) so it ends up at the top of the menu
str
get_asl_chain_name(cname)
Maestro doesn't like blank chain names in ASL without quotes so add the quotes if necessary
float or None
atom_b_factor(atom, zeros=True)
Returns the atom B-factor
list
bin_b_factors(struct, atoms, groups)
Divide atoms up into bins based on their B-factor (temperature factor).
 
color_chainbow_groups(asl, ribbons=None)
Color all the atoms (and sometimes the ribbons) as chainbows
 
create_colorbyele_menu(menu, owner, c_menu, h_menu)
 
add_common_context_items(menu, select=True)
Adds items common to many context menus
 
_color_key(item)
Sort colors in the order of magenta, blue, cyan, green, yellow, red, monochrome green, yellow, red, magenta, blue, cyan, monochrome
Variables [hide private]
  psp_antibody = None
hash(x)
  maestro = schrodinger.get_maestro()
  SIGNAL = QtCore.SIGNAL
  TRIGGERED = SIGNAL('triggered()')
  DISULFIDE = '(fillres /S0-S0/) AND atom.ptype CA,CB,SG'
  BACKBONE = 'backbone'
  SIDECHAIN = 'sidechain'
  POLYMER = '(backbone) or (sidechain)'
  SOLVENT = 'water'
  INORGANIC = 'not atom.ele H,C,N,O,F,P,S,Cl,Br,I'
  PROT_AND_DNA_SELE = "(res. ALA,CYS,CYX,ASP,GLU,PHE,GLY,HIS,HID...
  PYMOL_IONS = 'atom.ele Ca, Hg, K, Na, Zn, Mg, Cl'
  SOLVENT_AND_IONS = '(water) OR '+ PYMOL_IONS
  WATER = 'water'
  RIBBON_STYLE = 'calphatube'
hash(x)
  THIN_TRACE = 'calphaline'
  CALPHA_SCHEME = 'calphaatom'
  CHAIN_SCHEME = 'chain'
  POSITION_SCHEME = 'residueposition'
  NONE = 'none'
  TUBE = 'tube'
  CARTOON = 'cartoon'
hash(x)
  ATOM_NONE = 'none'
  BOND_NONE = 'none'
  CPK = 'cpk'
  ATOM_WIRE = 'none'
  BOND_WIRE = 'wire'
  ATOM_BALLNSTICK = 'ballnstick'
  BOND_BALLNSTICK = 'ballnstick'
  MAESTRO_TO_STRUCT_STYLE = {ATOM_WIRE: structure.ATOM_NOSTYLE, ...
  MMCT_TO_MAESTRO_RIBBON_STYLE = {mm.MMCT_RIBBON_STYLE_CALINE: '...
  MAESTRO_TO_MMCT_RIBBON_STYLE = dict([(val, key) for(key, val) ...
  DARK_BLUE = 'user2'
  BLUE = 'user27'
  CYAN = 'user4'
  SEAFOAM = 'userM'
  DARK_GREEN = 'user3'
  LIME = 'user19'
  DEEPTEAL = 'user59'
  HOTPINK = 'userN'
  YELLOWORANGE = 'userT'
  SLATE = 'blue14'
  YELLOW = 'user16'
  LIGHTBLUE = 'blue9'
  GREEN = 'green'
  RED = 'red'
  WHITE = 'white'
  ORANGE = 'orange'
  PINK = 'pink'
  MAGENTA = 'purple'
  DEEPRED = 'brown'
  OLIVE = 'olive'
  GREY = 'gray'
  ATOM_RAINBOW_COLORS = [BLUE, LIGHTBLUE, SEAFOAM, LIME, DARK_GR...
  RIBBON_RAINBOW_COLORS = ['blue', 'lightblue', 'turquoise', 'sp...
  PYMOL_COLOR_CYCLE = [GREEN, CYAN, MAGENTA, YELLOW, PINK, WHITE...
  object_color_cycles = {}
  RT_COLOR_LABEL_START = '<span style="background-color:black;fo...
  RT_COLOR_LABEL_END = '</span>'
  RT_TO_MAESTRO_COLORS = {}
  PARTIAL_CHARGE_4D = '1charge - b'
  SURFACE_AREA_CUTOFF = 10.
  PML_SURFACE = 'BL_Surface'
  PML_PRESET_SURFACE = 'BL_Preset_Surface'
  DAVE_DEBUG = os.environ.get('TOGGLE_DEBUG', 0)== 1
  results_window = None
hash(x)
  toggle_table = None
The parent Toggle Table widget
  labeler = workspacelabeler.WorkspaceLabeler()
  rock_data = RockData(interval= 1, amount= 1, span= 25)
  mmshare_data = util.hunt('mmshare', dir= 'data')
  colorpath = os.path.join(mmshare_data, 'colors.res')
  colorfile = open(colorpath, 'r')
  color_dict = OrderedDict(sorted(color_dict.items(), key= _colo...
  HYDROGEN_COLOR = 'hydrogen'
  CARBON_COLOR = 'carbon'
  OBJECT_COLOR = 'object'
  MAX_RECENT_COLORS = 12
  pref_dir = maestro.get_directory(maestro.PREFERENCES)
  color_path = os.path.join(pref_dir, 'bio_color_info.conf')
  custom_color_dicts = {}
  color_file = open(color_path, 'r')
Function Details [hide private]

start_progress(maximum)

 

Show and restart the progress bar on the Toggle Table if the TT is defined

Parameters:
  • maximum (int) - The maximum value of the progress bar

update_progress(inc=1, total=None)

 

Show the current progress on the progress bar on the Toggle Table if the TT is defined

Parameters:
  • inc (int) - The amount to increment the progress bar value
  • total (int) - The absolute value to set the progress bar to

get_matching_ws_atoms(asl, extract=False)

 

Get the atoms in the workspace structure that match the given asl

Parameters:
  • asl (str) - the asl this action will apply to
  • extract (bool) - True if a structure containing the matching atoms should be extracted and returned, False if not
Returns: tuple
workspace structure (schrodinger.Structure), list of matching atom indicies, matching structure (or None)

get_matching_ws_entries(owner, asl)

 

Get the entries in the workspace structure are affected by the given asl

Parameters:
  • owner (ToggleTableObject) - the object this command will operate on
  • asl (str) - the asl this action will apply to
Returns: list or None
Each item of the list is a workspace entry (Structure) that is affected by asl. In case of error - normally caused by multiple Scratch entries - None is returned. An empty list is returned if ASL does not affect any workspace entries.

get_visible_ws_atoms()

 

Return list of the the Visible workspace atoms

Returns: list
list of atom indexes of visible workspace atoms

get_visible_ws_asl()

 

Return an ASL that represents the Visible workspace atoms

Returns: str
an ASL expression that represents the Visible workspace objects, or None if no atoms are visible

join_asls(asl1, asl2, joiner='AND')

 

Joins 2 asls with the given joiner (default is AND)

Parameters:
  • asl1 (str) - the first asl
  • asl2 (str) - the second asl
  • joiner (str) - the linking logic (AND, AND NOT, OR...)
Returns: str
the two asls joined by the joiner

mod_asl(modifier, asl)

 

Puts a modifier in front of asl - which it protects in ()'s to make sure the modifier applies to the whole asl

Parameters:
  • modifier (str) - the modifier to prepend to the asl (NOT, FILLRES, FILLMOL)
  • asl (str) - the asl
Returns: str
the modified asl with the modifier prepended to it

get_surfaces(entry)

 

Get the surfaces associated with entry_id entry

Parameters:
  • entry (str) - The entry_id of the entry of interest
Returns: iterable
iterable object containing surfaces associated with this entry

find_all_table_entry_objects(owner)

 

Get the structures in the workspace referred to by a given toggle table entry

Parameters:
  • owner (ToggleTableObject) - the object to retrieve entries from
Returns: list
a list of all ToggleTableEntries referred to by owner

display_atoms_as(asl, atoms, bonds=None, owner=None)

 

Display atoms and bonds with the given style, and turn off ribbons and surfaces

Parameters:
  • asl (str) - the asl this action will apply to
  • atoms (str) - atom display style
  • bonds (str) - bond display style
  • owner (ToggleTableObject) - the object this command will operate on - used to see if the atoms should be made visible or not

display_atoms(asl, atoms, bonds=None, owner=None)

 

Display atoms and bonds with the given style, leaving ribbons as is

Parameters:
  • asl (str) - the asl this action will apply to
  • atoms (str) - atom display style
  • bonds (str) - bond display style
  • owner (ToggleTableObject) - the object this command will operate on - used to see if the atoms should be made visible or not

_display_atoms_visible(asl, atoms, bonds, entry_ids)

 

Display the specified atoms and bonds for a visible entry

Parameters:
  • asl (str) - the asl this action will apply to
  • atoms (str) - atom display style
  • bonds (str) - bond display style
  • entry_ids (list) - The entry ids of all structures to set display properties of

_display_atoms_invisible(asl, atoms, bonds, cur_owner)

 

Set atom display properties (without displaying the atoms) for invisible entries

Parameters:
  • asl (str) - the asl this action will apply to
  • atoms (str) - atom display style
  • bonds (str) - bond display style
  • cur_owner (ToggleTableObject) - the object this command will operate on - used to see if the atoms should be made visible or not

_determine_visible_entries(owner)

 

Determine all visible and invisible entries that a toggle table object refers to.

Parameters:
  • owner (ToggleTableObject) - The toggle table object used to find visible and invisible entries
Returns: tuple
A tuple of
  • a list of entry ids for visible entries
  • a list of toggle table entries (*not* entry ids) for invisible entries

_add_entry_id_to_asl(asl, cur_entry_id)

 

Modify the ASL to include current entry id

Parameters:
  • asl (str) - the asl this action will apply to
  • cur_entry_id (str) - the entry id to add to the asl
Returns: str
the modified asl

display_ribbons(asl, style, hideatoms=False, scheme=CALPHA_SCHEME, owner=None)

 

Show ribbons

Parameters:
  • asl (str) - the asl this action will apply to
  • style (str) - the ribbon style
  • hideatoms (bool) - True if atoms (i.e. the non-ribbon representation) should be hidden, False if not
  • scheme (str) - the ribbon scheme
  • owner (ToggleTableObject) - the object this command will operate on - used to see if the atoms should be made visible or not

_display_ribbons_visible(asl, entry_ids, style, hideatoms, scheme)

 

Display all ribons for a visible (i.e. toggled on) entry

Parameters:
  • asl (str) - the asl this action will apply to
  • entry_ids (list) - The entry ids of all structures to set display properties of
  • style (str) - the ribbon style
  • hideatoms (bool) - True if atoms (i.e. the non-ribbon representation) should be hidden, False if not
  • scheme (str) - the ribbon scheme

_display_ribbons_invisible(asl, style, scheme, owner)

 

Display all ribons for an invisible (i.e. toggled off) entry

Parameters:
  • asl (str) - the asl this action will apply to
  • style (str) - the ribbon style
  • scheme (str) - the ribbon scheme
  • owner (ToggleTableObject) - the object this command will operate on

_update_ribbon_dict_bypos(mmct_style, toggle_table_entry, atoms, cur_entry_id, workspace)

 

Update the ribbon_bypos_styles dictionary, which stores ribbon display information for invisible entries

Parameters:
  • mmct_style (int) - the ribbon style in MMCT format
  • toggle_table_entry (ToggleTableEntry) - the entry to update
  • atoms (list) - a list of atoms to update ribbon information for
  • cur_entry_id (str) - the entry id this update applies to
  • workspace (schrodinger.structure.Structure) - the current Maestro workspace

_update_ribbon_dict_byca(mmct_style, toggle_table_entry, atoms, cur_entry_id, workspace)

 

Update the ribbon_bypca_styles dictionary, which stores ribbon display information for invisible entries

Parameters:
  • mmct_style (int) - the ribbon style in MMCT format
  • toggle_table_entry (ToggleTableEntry) - the entry to update
  • atoms (list) - a list of atoms to update ribbon information for
  • cur_entry_id (str) - the entry id this update applies to
  • workspace (schrodinger.structure.Structure) - the current Maestro workspace

rock_workspace(interval=1, amount=1, span=25)

 

Rotate the workspace back and forth smoothly by small degree increments over a span of degrees range. If called when rocking is currently occuring, will stop the rocking.

Parameters:
  • interval (int) - in units of ~1/20 second, the frequency at which the rocking movement should be made
  • amount (int) - The number of degrees the workspace should be rotated each rocking movement
  • span (int) - The amount to rotate in one direction (past 0) before reversing

display_image(image_file)

 

Tries to display the image file in the default image viewer

Parameters:
  • image_file (str) - The path to the image to be displayed

ensure_proper_extension(filename, extensions)

 

Ensure that filename ends with the proper extension

Parameters:
  • filename (str) - the filename to check
  • extensions (str or list) - a list of valid extensions or a single extension. Extensions should include the '.'
Returns: str or None
either
  • filename if filename has a valid extension
  • filename + ext if filename has no extension, ext is the value of, or the first item in extensions,
  • None if filename has an extension not given by extensions

create_surface(entry, asl, name, transparency=0, quality=0, style='solid', viewasl=None, viewdistance='3', scheme='"Atom Color"', owner=None)

 

Create a surface

Parameters:
  • entry (str) - The entry id to create the surface for
  • asl (str) - The ASL defining the atoms to create the surface for
  • name (str) - The name given to the created surface
  • style (str or None) - One of the following values
    • 'solid' (default)
    • 'mesh'
    • 'dots'
  • quality (int) - The quality of the displayed surface.
    • 1 is medium quality (default)
    • 2 is high quality
  • transparancy (int) - transparancy % of the surface. Default is 0 (solid), max is 100.
  • viewasl (str) - The ASL that defines the portion of the surface to view - default is to view the entire surface
  • viewdistance (str) - A string representation of a number that defines how close the suface needs to be to the set of viewasl atoms to be shown. Default is 3 Angstroms.
  • scheme (str) - The coloring scheme for the surface (default is Atom Color)
  • owner (ToggleTableEntry) - The object this command will operate on. This is used to decide if the surface will be shown or not. Default is to show the surface

_hide_surface_if_necessary(owner, entry, name)

 

If the owner is invisible, hide the newly created surface

Parameters:
  • owner (ToggleTableEntry) - The structure this command will operate on
  • entry (str) - The entry id of the structure
  • name (str) - The name given to the created surface

create_show_menu(menu, owner)

 
Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on

create_show_substructure_menu(menu, owner)

 
Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on

create_show_organic_menu(menu, owner)

 
Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on

find_all_entries(owner=None, asl=None)

 

Find all the entries specified by the given owner or asl

Parameters:
  • owner (ToggleTableObject) - The ToggleTableObject this function applies to, if None and asl is None,(the default), then all included entry id's are returned
  • asl (str) - The asl to find entries for
Returns: list
list of entry ID's the asl spans

find_center_of_atoms(struct)

 

Finds the x,y,z coordinates of the center of the atoms

Parameters:
  • struct (schrodinger.Structure object) - structure containing the atoms
Returns: list
[x, y, z] specifying the center of the atoms

find_polar_contacts(asl1, asl2=None)

 

Finds all polar contacts (hydrogen bonds) between asl1 and asl2.

Parameters:
  • asl1 (str) - ASL defining one set of atoms to find H-bonds between. If asl2 is defined, then H-bonds are found between the two sets, but not within. If asl2 is not defined, then H-bonds are found within asl1.
  • asl2 (str) - ASL defining one set of atoms to find H-bonds between. If asl2 is defined, then H-bonds are found between asl1 and asl2, but not within. If asl2 is not defined, then H-bonds are found within asl1.

create_action_menu(menu, owner)

 
Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on

hide_atoms(asl=None, owner=None)

 

Hide the atoms given by asl

Parameters:
  • asl (str) - the asl this action will apply to. Must be given if owner is None
  • owner (ToggleTableObject) - the object this action will apply to. Must be given if asl is None

_add_entries_to_asl(asl, entries)

 

Add entry ids to an ASL

Parameters:
  • asl (str or NoneType) - The ASL to add the entry IDs to. If blank, an ASL specifying only the entry IDs will be returned.
  • entries (list) - A list of entry ids to add to the asl. If None, no entry ids will be added.
Returns: str
The new ASL

_run_maestro_command(cmd, asl, entries)

 

Run the given Maestro command on the specified atoms

Parameters:
  • cmd (str) - The maestro command to run
  • asl (str or NoneType) - An ASL specifying the atoms to run the command on. If blank, all atoms in the specified entry ids will be used.
  • entries (list) - A list of entry ids to run the command on. Must not be an empty list.

_get_selection_asl(asl, owner)

 

If the specified ASL is blank and owner is a selection, return the selection ASL. Otherwise, return the specified ASL.

Parameters:
  • asl (str or NoneType) - The specified ASL
  • owner (toggle_table.ToggleTableEntry) - The toggle table entry

_filter_invisible_atoms(asl, owner)

 

Remove atoms from the owner.visible_atoms list

Parameters:
  • asl (str) - the asl describing atoms to remove from the visible atom list
  • owner (ToggleTableEntry) - the entry to remove visible atoms from

hide_ribbons(asl=None, owner=None)

 

Hide ribbons

Parameters:
  • asl (str) - the asl this action will apply to. If None, then owner must be given, and all atoms specified by owner will be hidden.
  • owner (ToggleTableObject) - The object to hide ribbons in. If given and the entry is currently invisible, the ribbons will be appropriately updated. If not given, no invisible atoms will be hidden

_hide_ribbons_invisible(asl=None, owner=None)

 

Hide ribbons from an invisible structure. Note that owner is a mandatory argument, but asl is optional. (The arguments are in this order to be consistent with hide_ribbons, where owner is not mandatory.)

Parameters:
  • asl (str) - the asl this action will apply to. If None, then all atoms specified by owner will be hidden.
  • owner (ToggleTableEntry) - the structure to hide ribbons in

_filter_ribbon_styles(styles_dict, entry_id, atoms_to_hide_as_str)

 

Remove the specified atoms from a ToggleTableEntry ribbon styles dictionary

Parameters:
  • styles_dict (dict) - a ToggleTableEntry styles dictionary (either ribbon_bypos_styles or ribbon_byca_styles)
  • entry_id (str) - the entry id of the entry to filter out
  • atoms_to_hide_as_str (frozenset) - a set of the atoms to filter out, where each atom is represented by a string of its atom id (ex. frozenset(["45", "46", "97", ...]))
Returns: dict
The filtered styles_dict

_filter_ribbon_colors(owner, entry_id, atoms_to_hide_as_int)

 

Remove the specified atoms from a ToggleTableEntry ribbon colors dictionary

Parameters:
  • owner (toggle_table.ToggleTableEntry) - the toggle table entry object
  • entry_id (str) - the entry id of the entry to filter out
  • atoms_to_hide_as_int - a set of the atoms to filter out, where each atom is represented by the integer of its atom id (ex. frozenset([45, 46, 97, ...]))
  • atoms_to_hide_as_str (frozenset)

Note: Unlike _filter_ribbon_styles, this function acts directly on the owner object and does not return anything

hide_surface(entry_id=None, owner=None, asl=None)

 

Hide a surface

Parameters:
  • entry_id (str) - the entry_id this action will apply to
  • owner (ToggleTableObject) - The object to hide surfaces from. Used to determine if an entry is invisible. If not given, no invisible atoms will be hidden
  • asl (str) - The ASL describing atoms to hide the surface of. If this ASL is given and does not contain any protein atoms, then the no surfaces will be hidden. Otherwise, all surfaces of the specified entry will be hidden.

_hide_surface_by_owner(entry_id, owner, asl)

 

Given the toggle table owner, hide a surface.

Parameters:
  • entry_id (str) - the entry_id this action will apply to (may be None)
  • owner (ToggleTableObject) - The object to hide surfaces from
  • asl (str) - The ASL describing atoms to hide the surface of (may be None)

hide_labels(asl=None, owner=None)

 

Hide the labels

Parameters:
  • asl (str) - The ASL defining the atoms whose labels will be hidden. If not given, the asl from owner will be used
  • owner (ToggleTableObject) - If asl is None, the object containing the labels to be hidden

hide_everything(asl=None, entry_id=None, owner=None)

 

Hide atoms, ribbons and surfaces

Parameters:
  • asl (str) - the asl this action will apply to
  • entry_id (str) - the entry_id this action will apply to
  • owner (ToggleTableObject)

Note: At least one argument must be provided.

create_hide_menu(menu, owner)

 

Create the Hide menu

Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on

get_color()

 

Get a user-specified color from the list of known Maestro colors

Returns: tuple
(Maestro color name, (R, G, B, Alpha)) or (None, None) if the user cancels the window.

color_atoms(color_name, asl)

 

Colors the specified atoms with the given color

Parameters:
  • color_name (str) - a Maestro-recognized color name, found in mmshare/data/colors.res
  • asl (str) - The ASL specifying the atoms to color

color_atoms_rgb(red, green, blue, asl)

 

Colors the specified atoms with the given RGB colors

Parameters:
  • red (int) - integer between 0 and 255
  • green (int) - integer between 0 and 255
  • blue (int) - integer between 0 and 255
  • asl (str) - The ASL specifying the atoms to color

make_color_asl_for_element(asl, element)

 

Form an ASL that restricts the given ASL to those atoms of a specific element

Parameters:
  • asl (str) - The general asl to make element specific
  • element (str) - an atomic symbol to restrict the ASL to
Returns: str

color_by_element(base_asl, hydrogen=WHITE, carbon=GREEN, nitrogen=BLUE, oxygen=RED, sulfur=ORANGE)

 

Color H, C, N, O and S by colors

Parameters:
  • base_asl (str) - asl defining the group of atoms to color
  • hydrogen (str) - the Maestro color string defining the color for H atoms
  • carbon (str) - the Maestro color string defining the color for C atoms
  • nitrogen (str) - the Maestro color string defining the color for N atoms
  • oxygen (str) - the Maestro color string defining the color for O atoms
  • sulfur (str) - the Maestro color string defining the color for S atoms

save_new_color(color_name, rgba, mytype)

 

The user has selected a new (or re-selected an existing custom set) - add it to the list of custom sets (or move it to the end) so it ends up at the top of the menu

Parameters:
  • color_name (str) - the Maestro color name of the color to save
  • rgba (4-tuple or None) - tuple of (red, blue, green, alpha) if this is a new color, or None if this is already an existing color
  • mytype (str) - the type of color this is (HYDROGEN_COLOR, CARBON_COLOR, OBJECT_COLOR)

get_asl_chain_name(cname)

 

Maestro doesn't like blank chain names in ASL without quotes so add the quotes if necessary

Parameters:
  • cname (str) - the chain name
Returns: str
cname if cname is not blank, otherwise a double-quoted space

atom_b_factor(atom, zeros=True)

 

Returns the atom B-factor

Parameters:
  • atom (schrodinger._Atom) - atom object to return the B-factor for
  • zeros (bool) - True if atoms with No B-factor should return 0.0, False if it should return None
Returns: float or None
the B-factor of the given atom

bin_b_factors(struct, atoms, groups)

 

Divide atoms up into bins based on their B-factor (temperature factor). The groups are determined to span equal ranges of b-factor (some groups may therefore contain no atoms).

Parameters:
  • atoms (list) - list of atom indexes to bin
  • groups (int) - The number of bins to create
  • struct (schrodinger.structure.Structure)
Returns: list
List of binned atom indexes - each item of the list is a list containing the atom indexes for that bin. Item 0 are the lowest B-Factors.

color_chainbow_groups(asl, ribbons=None)

 

Color all the atoms (and sometimes the ribbons) as chainbows

Parameters:
  • asl (str) - the asl this action will apply to
  • ribbons (str) - The type of ribbons to create with these colorings. The default is not to create ribbons.

    Color each chain like a rainbow! Each group of atoms within a chain gets different colors. Groups are created to (roughly) equal number of atoms in each group, and all the atoms in a residue are given the same color (if the residue != UNK).

create_colorbyele_menu(menu, owner, c_menu, h_menu)

 
Parameters:
  • menu (QMenu) - the QMenu that owns this action
  • owner (ToggleTableObject) - the object this Menu will operate on
  • c_menu (QMenu) - Submenu for recent custom carbon colors
  • h_menu (QMenu) - Submenu for recent custom hydrogen colors

add_common_context_items(menu, select=True)

 

Adds items common to many context menus

Parameters:
  • menu (PMLMenu) - the menu to add items to
  • select (bool) - True if Select is on the menu, False if not

Variables Details [hide private]

PROT_AND_DNA_SELE

Value:
"(res. ALA,CYS,CYX,ASP,GLU,PHE,GLY,HIS,HID,HIE,HIP,HISE,HISD,HISP,ILE,\
LYS,LEU,MET,MSE,ASN,PRO,GLN,ARG,SER,THR,VAL,TRP,TYR,A,C,T,G,U)"

MAESTRO_TO_STRUCT_STYLE

Value:
{ATOM_WIRE: structure.ATOM_NOSTYLE, BOND_WIRE: structure.BOND_WIRE, TU\
BE: structure.BOND_TUBE, ATOM_NONE: structure.ATOM_NOSTYLE, BOND_NONE:\
 structure.BOND_NOSTYLE, CPK: structure.ATOM_CPK, ATOM_BALLNSTICK: str\
ucture.ATOM_BALLNSTICK, BOND_BALLNSTICK: structure.BOND_BALLNSTICK, No\
ne: structure.BOND_NOSTYLE}

MMCT_TO_MAESTRO_RIBBON_STYLE

Value:
{mm.MMCT_RIBBON_STYLE_CALINE: 'calphaline', mm.MMCT_RIBBON_STYLE_CARTO\
ON: 'cartoon', mm.MMCT_RIBBON_STYLE_CATUBE: 'calphatube', mm.MMCT_RIBB\
ON_STYLE_CURVELINE: 'curvedline', mm.MMCT_RIBBON_STYLE_NONE: 'none', m\
m.MMCT_RIBBON_STYLE_RIBBON: 'ribbon', mm.MMCT_RIBBON_STYLE_THINTUBE: '\
thintube', mm.MMCT_RIBBON_STYLE_TUBE: 'tube'}

MAESTRO_TO_MMCT_RIBBON_STYLE

Value:
dict([(val, key) for(key, val) in MMCT_TO_MAESTRO_RIBBON_STYLE.iterite\
ms()])

ATOM_RAINBOW_COLORS

Value:
[BLUE, LIGHTBLUE, SEAFOAM, LIME, DARK_GREEN, GREEN, OLIVE, YELLOW, ORA\
NGE, PINK, RED]

RIBBON_RAINBOW_COLORS

Value:
['blue', 'lightblue', 'turquoise', 'springgreen', 'darkgreen', 'green'\
, 'yellowgreen', 'yellow', 'orange', 'pink', 'red']

PYMOL_COLOR_CYCLE

Value:
[GREEN, CYAN, MAGENTA, YELLOW, PINK, WHITE, SLATE, ORANGE, LIME, DEEPT\
EAL, HOTPINK, YELLOWORANGE, GREY]

RT_COLOR_LABEL_START

Value:
'<span style="background-color:black;font-size:16px">'

color_dict

Value:
OrderedDict(sorted(color_dict.items(), key= _color_key))