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

Class SimpleEnumDockPanel

PyQt4.QtCore.QObject --+
                       |
                      SimpleEnumDockPanel

This is the main class for the panel, to show the panel simply create an instance of this class.

Instance Methods [hide private]
 
__init__(self, enum_only=False, default_collection=None, create_qapp=True, untangle=True, jobname=None, quiet_launch=False, close_on_launch=False, write_files_only=False)
 
hideCoreImportWidgets(self)
Hide the widgets that allow importing the core into the panel.
 
initializeGrowers(self)
Initialize the mmfrag and mmbuild libraries to prepare for growing fragments
tuple
growMethyl(self, struct, atom1, atom2)
Grow a methyl in the forward direction
tuple
growFluoro(self, struct, atom1, atom2)
Grow a fluorine in the forward direction
tuple
growFragmentForward(self, handle, fragment, struct, atom1, atom2)
Grow a fragment in the forward direction
str
ensureValidCollectionTitles(self, filename)
Check all the fragment titles in filename and create a new file with valid (non-duplicate, non-blank) titles if the original file contains duplicate or blank titles.
 
setDefaultCollection(self, filenameTxt=None)
 
clearDefaultCollection(self)
 
setComblibDir(self, comblibDir)
 
openCollectionPanel(self)
 
browse_for_collection_dir(self)
 
scan_collection_dir(self, directory)
 
enableRevert(self)
 
getCore(self)
 
closePalette(self)
 
clearPalette(self)
 
clearCollection(self, clearSelection=True)
 
clearCombdef(self)
 
getPTGroupnameCollection(self)
 
getPTGroupnamePalette(self)
 
updateLibraryCounts(self)
 
loadZoomStruct(self, index)
 
tabChange(self, newtab)
 
collectionRefreshed(self)
 
collectionChanged(self)
A slot to be called by the 2d-viewer collection table
 
paletteRefreshed(self)
 
paletteChanged(self)
 
checkForPaletteChanges(self)
 
exportPalette(self)
 
savePalette(self, filename)
 
checkForCollectionChanges(self)
 
close(self)
 
help(self)
 
helpNC(self)
 
showNC(self)
 
importPalette(self)
 
fragImportFromSketcher(self)
 
importFragmentCollection(self)
 
makeAllTitlesUnique(self)
Make sure all fragment titles are unique and non-blank
 
setFragmentCollection(self, filenameTxt)
This function assumes that we *know for sure* we want to load the collection - anything that calls this function is presumed to have already prompted the user to save changes if necessary.
 
exportCombLibSelectFile(self)
 
exportCoreSelectFile(self)
 
revertCombLib(self)
 
revertCollection(self)
 
importCombLibSelectFile(self, filenameTxt="")
 
checkForCombLibChanges(self, autoSave=False)
 
flashRow(self, row)
 
swapPics(self)
 
saveCurrentCollection(self, filename)
 
saveCurrentCombLibDef(self, filename)
 
createCombLibSelectFile(self, struct=None, checkChanges=True, src=None)
 
createRowInCollectionTable(self, from_atom, to_atom, row, aname, r_num, rpath, minLink, maxLink, bondToH=False)
 
loadStructIntoStructView(self, struct)
 
doubleClickTable(self, row, column)
 
contextMenuRequested(self, pos)
 
getCollectionFilename(self, oldFilename="")
 
applyCurrentCollection(self, item=None)
 
applyCurrentSelection(self, item=None)
 
browseForNewCollection(self, item)
 
appendNewCollection(self, item)
 
countTotalStructures(self)
Count the total number of structures that will be enumerated and update the feedback widget
 
exportCollection(self, askToAssociate=True)
 
renameCollection(self, item)
 
deleteCollectionRow(self, item)
 
updateSelection(self)
 
validateLinkerChange(self, row, column)
Check any edits the user makes to one of the linker cells in the Collection Table to make sure it is a positive integer and the min < max
 
enumerate(self)
 
enumerateDock(self)
 
gridBrowse(self)
 
coreSketch(self)
 
getCoreCBChanged(self, str)
Class Variables [hide private]
  job_submitted = pyqtSignal(str)
  enumeration_files_written = pyqtSignal(str)
Method Details [hide private]

__init__(self, enum_only=False, default_collection=None, create_qapp=True, untangle=True, jobname=None, quiet_launch=False, close_on_launch=False, write_files_only=False)
(Constructor)

 
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
  • jobname (str) - The jobname for the panel. By default, the jobname is cgenumerate for Enumeration-only jobs and cg_enumerate_dock for Enumerate and Dock jobs. jobname must be supplied if write_files_only is True and will be the name of the directory the files are written to and will also be the base name of the files in that directory.
  • quiet_launch (bool) - If True, do not post dialog or open monitor panel when job successfully launches. If False, a dialog will be posted and the monitor panel may open depending on user preferences. False is the default.
  • close_on_launch (bool) - if True, close when a job is submitted successfully (or when files are written successfully if write_files_only=True). If False, remain open. False is the default.
  • write_files_only (bool) - If True, the files required to run the job will be written and the enumeration_files_written signal will be emitted. If False, the enumeration job will be launched and the job_submitted signal will be emitted. The default is False. A RuntimeError is raised if this flag is True and enum_only is False or of jobname is not provided.
Raises:
  • RuntimeError - If write_files_only is True and either enum_only is False or jobname is not provided

hideCoreImportWidgets(self)

 

Hide the widgets that allow importing the core into the panel. Workflows that implement this will have to manually import a core, probably using the createCombLibSelectFile method.

This allows the panel to be used to modify a specific structure only.

growMethyl(self, struct, atom1, atom2)

 

Grow a methyl in the forward direction

Parameters:
  • struct (schrodinger.structure.Structure) - The structure object to grow the methyl on
  • atom1 (int) - The atom index of the from atom
  • atom2 (int) - The atom index of the to atom
Returns: tuple
(int, int, dictionary) The new atom1, the new atom2, and a dictionary mapping old atoms to new

growFluoro(self, struct, atom1, atom2)

 

Grow a fluorine in the forward direction

Parameters:
  • struct (schrodinger.structure.Structure) - The structure object to grow the fluorene on
  • atom1 (int) - The atom index of the from atom
  • atom2 (int) - The atom index of the to atom
Returns: tuple
(int, int, dictionary) The new atom1, the new atom2, and a dictionary mapping old atoms to new

growFragmentForward(self, handle, fragment, struct, atom1, atom2)

 

Grow a fragment in the forward direction

Parameters:
  • handle (mmfrag handle) - A handle created via mmfrag_new()
  • fragment (str) - Name of a fragment available in the mmfrag handle set, such as "Methyl" or "fluoro"
  • struct (schrodinger.structure.Structure) - The structure object to grow the fluorene on
  • atom1 (int) - The atom index of the from atom
  • atom2 (int) - The atom index of the to atom
Returns: tuple
(int, int, dictionary) The new atom1, the new atom2, and a dictionary mapping old atoms to new

ensureValidCollectionTitles(self, filename)

 

Check all the fragment titles in filename and create a new file with valid (non-duplicate, non-blank) titles if the original file contains duplicate or blank titles.

Parameters:
  • filename (str) - The absolute path to the file to check
Returns: str
The path to the file to use. If filename contains all valid titles, filename is returned

setFragmentCollection(self, filenameTxt)

 

This function assumes that we *know for sure* we want to load the collection - anything that calls this function is presumed to have already prompted the user to save changes if necessary. Also the caller of this function will be responsible for setting the text in the Collection Table filename line and setting the collectionbp if there is a selected collection.

validateLinkerChange(self, row, column)

 

Check any edits the user makes to one of the linker cells in the Collection Table to make sure it is a positive integer and the min < max

Parameters:
  • row (int) - The table row of the cell
  • column (int) - The table column of the cell