Package schrodinger :: Package application :: Package combiglide :: Module combenumdock
[hide private]
[frames] | no frames]

Module combenumdock

Creates the Combiglide Interactive Enumeration and Dock panel.

This panel has several modes - the default mode is the Combiglide version. The panel can also be opened without any docking widgets for those uses that don't require docking.

The panel emits a job_submitted(jobid) signal when an enumeration job is submitted, allowing other panels to react and track the job if necessary.

Typical usage would be:

   panel = combenumdock.SimpleEnumDockPanel(enum_only=True,
                                            untangle=False,
                                            create_qapp=False,
                                            jobname=jobname,
                                            quiet_launch=True,
                                            close_on_launch=True)
   panel.mainWindow.show()
   panel.job_submitted.connect(self.followEnumerationJob)

To simply show a new instance of the panel without maintaining a pointer to it, use:

   combenumdock.show_panel(key='myapp panel')

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  _fakeEvent
  CgHydrogenFragmentAnnotator
  collectionViewerModel
  editableViewerTable
  glidePrecisionDialog
  SimpleEnumDockPanel
This is the main class for the panel, to show the panel simply create an instance of this class.
  _StructView
  _zoomViewItem
  _StructViewItem
  ConnectionStorage
This class is used to store the data of the current connection table.
  simpleEnumDockDelegate
  createFragmentDelegate
Functions [hide private]
 
QC(obj1, signal, obj2)
A helper function for QObject.connect
 
setup_qapp()
str
get_unique_title(beginning, structs)
Adds FRAGMENT_INCREMENT_TAGx (x=integer) to the beginning string in order to create a title that is unique in the set of titles in structs.
set
uniquify_titles(structs)
Modify any duplicate and blank titles in structs so that all titles are unique.
 
resolve_links(path)
Return the target of a symbolic link, can handle symlinks to symlinks Uses 'linkresolver.exe' on Windows to resolve shortcuts ('.lnk')
 
get_maestro_groupname()
 
get_sidebar_dict(dir_kws)
This function is used to get a dictionary to be used with filedialog.py
 
show_panel(enum_only=False, default_collection=None, create_qapp=True, untangle=True, key='Combiglide')
Create the panel if necessary and show it
Variables [hide private]
  maestro = False
hash(x)
  STEREO = canvas2d.ChmMmctAdaptor.StereoFromAnnotationAndGeomet...
  BLACK_COLOR_MAP = {5: 0xFF000000, 7: 0xFF000000, 8: 0xFF000000...
  APPDATA_DIR = mm.mmfile_schrodinger_appdata_dir()
  SCHROD_TMP = mm.mmfile_get_schrodinger_temp()
  PERSONAL_FRAGS_DIR = os.path.join(APPDATA_DIR, "cg", "interact...
  PERSONAL_PALS_DIR = os.path.join(APPDATA_DIR, "cg", "interacti...
  MMSHARE_DATA_DIR = os.path.join(MMSHARE_DATA_DIR, 'data')
  SCHROD_FRAGS_DIR = os.path.join(MMSHARE_DATA_DIR, "cg", "inter...
  SCHROD_PALS_DIR = os.path.join(MMSHARE_DATA_DIR, "cg", "intera...
  LINK_TO_URL = {'schrod_frags': SCHROD_FRAGS_DIR, 'my_frags': P...
  LINK_TO_TXT = {'schrod_frags': "Schrodinger Collections", 'my_...
  NULL_LINKER = zlib.decompress('eJytUsFOwzAMvfcrrO68qQ2FsX0AR85...
  FRAGFILE_STR = zlib.decompress('x\x9c\xa5TMo\x830\x0c\xbd\xe7W...
  DELETE_SELECTED_MENU_ITEM = "Delete selected structures"
  RETAIN_ONLY_SELECTED_MENU_ITEM = "Retain only selected structu...
  EXPORT_SELECTED_MENU_ITEM = "Export selected structures to pro...
  DELETE_STRUCTURE_MENU_ITEM = "Delete this structure"
  RETAIN_ONLY_STRUCTURE_MENU_ITEM = "Retain only this structure"
  SHOW_IN_WORKSPACE_MENU_ITEM = "Show this structure in workspace"
  EXPORT_STRUCTURE_MENU_ITEM = "Export this structure to project...
  CHANGE_TITLE_MENU_ITEM = 'Rename structure'
  GENERIC_FRAGMENT_TITLE = 'frag'
  FRAGMENT_INCREMENT_TAG = '-ied'
  panels = {}
Function Details [hide private]

get_unique_title(beginning, structs)

 

Adds FRAGMENT_INCREMENT_TAGx (x=integer) to the beginning string in order to create a title that is unique in the set of titles in structs.

This method strips off any 'FRAGMENT_INCREMENT_TAGx' (where x=integer) ending off of the beginning string before adding the new suffix in order to avoid names like frag-ied1-ied1.

Parameters:
  • beginning (str) - The string that will begin the title and have an integer appended to it to be unique
  • structs (list) - A list of Structure objects to use to check if a title is unique
Returns: str
A title unlike any currently found in the list of structures

uniquify_titles(structs)

 

Modify any duplicate and blank titles in structs so that all titles are unique. Note that this directly modifies the structures in the list.

Parameters:
  • structs (list) - A list of Structure objects to use to check if a title is unique
Returns: set
set of modified structure titles

show_panel(enum_only=False, default_collection=None, create_qapp=True, untangle=True, key='Combiglide')

 

Create the panel if necessary and show it

Parameters:
  • enum_only (bool) - If True, hide all GUI items relating to Docking and rename the panel, if False show panel in default mode.
  • default_collection (str) - The path to the default collection file
  • create_qapp (bool) - True if a QApplication should be created if the panel is being run outside of Maestro, False if not
  • untangle (bool) - True if the combgen untangle option should be used when enumerating structures, False if not
  • key (hashable) - Panel instances are stored in a dictionary. If a panel with this key already exists, that panel will simply be re-shown. If a panel with this key does not exist, a new panel will be created, stored in the dictionary under this key, and shown. Default is 'Combiglide', which is the panel with all default options.

Variables Details [hide private]

STEREO

Value:
canvas2d.ChmMmctAdaptor.StereoFromAnnotationAndGeometry_Safe

BLACK_COLOR_MAP

Value:
{5: 0xFF000000, 7: 0xFF000000, 8: 0xFF000000, 9: 0xFF000000, 13: 0xFF0\
00000, 14: 0xFF000000, 15: 0xFF000000, 16: 0xFF000000, 17: 0xFF000000,\
 35: 0xFF000000, 53: 0xFF000000}

PERSONAL_FRAGS_DIR

Value:
os.path.join(APPDATA_DIR, "cg", "interactive_fragments")

PERSONAL_PALS_DIR

Value:
os.path.join(APPDATA_DIR, "cg", "interactive_palettes")

SCHROD_FRAGS_DIR

Value:
os.path.join(MMSHARE_DATA_DIR, "cg", "interactive_fragments")+ os.path\
.sep

SCHROD_PALS_DIR

Value:
os.path.join(MMSHARE_DATA_DIR, "cg", "interactive_palettes")+ os.path.\
sep

LINK_TO_URL

Value:
{'schrod_frags': SCHROD_FRAGS_DIR, 'my_frags': PERSONAL_FRAGS_DIR, 'sc\
hrod_pals': SCHROD_PALS_DIR, 'my_pals': PERSONAL_PALS_DIR}

LINK_TO_TXT

Value:
{'schrod_frags': "Schrodinger Collections", 'my_frags': "My Collection\
s", 'schrod_pals': "Schrodinger Palettes", 'my_pals': "My Palettes"}

NULL_LINKER

Value:
zlib.decompress('eJytUsFOwzAMvfcrrO68qQ2FsX0AR85ICEVdk42IJpncDDbQ/p046\
dJ2IE6kUmo/v/g5sbMvyAA6rrlmyvJ3iZ2yxkPr9drv5aJcFJCdIcu2ntM4SHynXCsTMX+\
081aZN4k5ETSvndXP7CXyAWbwoLBz0Nj2oA2oDogAygh5hFmgKCpCW8HdaS8Dgh458sZaF\
Mk/XfmfI58yoOyUOEhuDnojMcBUrTKdROev5ulCJjjo+SMJaF5rZbiptUwZfckWk54n4E6\
WVz5LCfZiM9RwSXMJ0J2n6A7tx1SOOKoZ10/o1qKu214tnZ7mi53wTYO4KjLmxYLd3C6Lg\
hCyV8vVMtpFWBCP5P57CjsAK4f4yKJQz6Af7psyv+j5aB47zcbq/mzFKnZ/16tXFSvZf6m\
zX9TjG5zjDG6sEX/OIBF+zOAWrU6Os8n0U9Y35PqhB5MFc/IOg1kOwVTmOfsG5tngWA=='\
.decode('base64'))

FRAGFILE_STR

Value:
zlib.decompress('x\x9c\xa5TMo\x830\x0c\xbd\xe7WD\xe9\x95Lj\xb7\x13\xd2\
\x0e\xd5\xb4\x0fM\xdaN\xbdO)\x04\x1a\x89$\x95\tE\x13\xe2\xbf/)cK\x1a\x\
18\x9b\xe6K\x88\xed\xf7l\x9e\r\xe8\x01X)\xb92\x14\x9a\x8a\xd78MoQ\x870\
\xc6\x8aI\x8e\xc9j\xbb\xdbm\xef\x9e^\xb7/\xf7+\x928\x7f\t\xba\xa5\xb9\\
x00\x9e\x19\xa1U\x8d\xcf\xc9\xd6\xc6\xf3\x0bZhh\x19\xe4\x03*0\xe05U\x8\
d\xa4\x0683\xae6\x16*\x03\xee\x9e\xbc\xe4L+\xe5\x8a\x9c\x84\x11\xbc\xf\
6\xf9\xc3jA6\xee\n\xd0\x12w\x04\x8e\xd9\x9a\xf4\t6z\xb8lH\xdfG\x9d(\xd\
e\xd2\xbdV\xf9\x1fP\xfd\xf7\xcd\x8f\x18\r\xb5\x95\x83Zu\x9a\xe3b\xb3\x\
...

RETAIN_ONLY_SELECTED_MENU_ITEM

Value:
"Retain only selected structures"

EXPORT_SELECTED_MENU_ITEM

Value:
"Export selected structures to project table"

EXPORT_STRUCTURE_MENU_ITEM

Value:
"Export this structure to project table"