schrodinger.application.livedesign.ld_export module¶
Classes used for LiveDesign export GUIs.
Copyright Schrödinger, LLC. All rights reserved.
-
class
schrodinger.application.livedesign.ld_export.
AbstractExportSetupPanel
(*args, **kwargs)¶ Bases:
schrodinger.ui.qt.appframework2.wizards.BaseWizardPanel
A panel to process selected entries from Maestro or from file. Subclasses must define two class variables:
TITLE_BASE
andENTRY_TYPES
.Variables: - TITLE_BASE (str) – the primary title for this panel window; the full title will include this string as well as the host URL
- ENTRY_TYPES (list(maestro_data_types.BaseMaestroData)) – list containing the types of data that this panel can prepare for upload
-
TITLE_BASE
= ''¶
-
ENTRY_TYPES
= []¶
-
initSetOptions
()¶ Suggested subclass use: set instance variables, excluding layouts and subwidgets.
-
initSetUp
()¶ Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
-
initSetDefaults
()¶ Set widget to its default state. If the widget uses a model/mapper, it’s preferable to reset the widget state by resetting the model.
-
initLayOut
()¶ Create a vertical layout for the widget (
widget_layout
) and populate it with two vertical sub-layouts:main_layout
andbottom_layout
.If the user has specified the
ui
data member, insert the resultantui_widget
intomain_layout
.Suggested subclass use: create, initialize, and populate layouts.
-
definePanelSettings
()¶ See parent class for method documentation.
-
populateEntryTypes
()¶ Populates entry types for the “Entry type” combobox.
-
onEntryTypeChanged
()¶ Function called when entry type is changed.
-
export_3d
¶
-
currentDataType
()¶ Returns the current entry data type.
Returns: Entry data type. Return type: maestro_data_types.BaseMaestroData
-
getReceptorLigandMap
()¶ Returns: a receptor-ligand map containing all structures specified for export to LiveDesign Return type: data_classes.ReceptorLigandMap
-
onDataChanged
()¶ Called when input data source is changed.
-
processNext
()¶ Called when “Next” is pressed.
-
loadLDClient
()¶ Loads the LDClient and models from the separate login panel.
-
run
(prev_panel_state=None)¶ See parent class BaseWizardPanel for method documentation.
Resets the panel to default state before running.
-
class
schrodinger.application.livedesign.ld_export.
ExportThreadRunner
(*args, **kwargs)¶ Bases:
schrodinger.application.livedesign.ld_base_classes.ImportExportThreadRunner
Perform the actual export in a thread to not block Maestro.
-
process_type
= 'export'¶
-
missingFieldsDetected
¶
-
checkFields
(**kwargs)¶
-
preStart
(**kwargs)¶
-
runMain
(task)¶ See tasks.BaseFunctionRunner for documentation.
-
updatePropNames
(prop_dicts)¶ Edit the properties to accommodate renaming behavior in SD files; these expect the structure title to have a specific name.
Parameters: prop_dicts (list(OrderedDict(str, str))) – a list of dictionaries each specifying the mapping between a maestro and LD property.
-
reportAndReturnStatus
(num_success, num_failure, live_report_url, result_urls, curr_name)¶ Pulling out the reporting code :param num_success: number of successfully uploaded compounds :param num_failure: number of unsuccessfully uploaded compounds :param live_report_url: the url of the live report :param result_urls: the urls of each upload task result :param curr_name: name of the task
-
-
class
schrodinger.application.livedesign.ld_export.
AbstractExportPanel
(*args, **kwargs)¶ Bases:
schrodinger.application.livedesign.ld_base_classes.ImportExportBasePanel
Abstract panel class for specifying how to export the data to LD.
Derived classes should define the following class variables: :cvar HELP_TOPIC: help topic string :vartype HELP_TOPIC: str
Variables: - TITLE_BASE (str) – the primary title for this panel window; the full title will include this string as well as the host URL
- SELECT_TEXT (str) – text used to label the property selection widget
- EXPORT_TEXT (str) – text used to label the export table
- THREAD_RUNNER_CLASS (ExportThreadRunner) – the thread runner class that will be instantiated when this panel is initialized.
- TABLE_VIEW_CLASS (panel_components.ExportTableView) – the table view class used for this export table
- TABLE_MODEL_CLASS (panel_components.AbstractExportTableModel) – the table model class used for the export table, must be defined in subclasses
-
HELP_TOPIC
= ''¶
-
TITLE_BASE
= ''¶
-
SELECT_TEXT
= ''¶
-
EXPORT_TEXT
= ''¶
-
THREAD_RUNNER_CLASS
¶ alias of
ExportThreadRunner
-
MAP_SELECT_TEXT
= 'Select Map...'¶
-
MAP_ERROR_MSG
= 'Error: The selected mapping could not be successfully applied. One or more property rows in the export table may be incorrect.'¶
-
MAP_EXISTS_MSG
= 'The following map name already exists: {0}\nPlease enter a new name.'¶
-
INVALID_MAP_NAME_MSG
= 'Please enter a valid name for saving a new map.'¶
-
TABLE_VIEW_CLASS
¶ alias of
schrodinger.application.livedesign.panel_components.ExportTableView
-
TABLE_MODEL_CLASS
= None¶
-
initSetOptions
()¶ Suggested subclass use: set instance variables, excluding layouts and subwidgets.
-
initSetUp
()¶ Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
-
onMissingFields
(missing_fields)¶ If any required fields are missing when a user is trying to export sets table model to highlight the missing fields. Emits a signal to trigger an update of the missing fields background color.
-
initSetDefaults
()¶ Set widget to its default state. If the widget uses a model/mapper, it’s preferable to reset the widget state by resetting the model.
-
setLiveReportDefaults
()¶ See superclass for docs
-
initLayOut
()¶ See parent class for method documentation.
-
definePanelSettings
()¶ See parent class for method documentation.
-
processSettings
(settings=None, runner=None)¶ See parent class for method documentation.
-
onPropSelectChanged
()¶ Called when Maestro project table properties selection is changed.
-
addNewLiveReport
(name)¶ Add a new Live Report to the current project.
Parameters: name (str) – the new generated live report name.
-
onLiveReportSelected
(lr_id)¶ Slot invoked when a Live Report is chosen from the combobox.
Parameters: lr_id (str) – id of current live report chosen in tree view.
-
onShowColumns
()¶ Slot invoked when ‘Show More’ or ‘Show Less’ button is clicked.
-
getExportGlobal
()¶ Returns whether to export globally.
-
setExportGlobal
(exp_global)¶ Sets whether to export globally
Parameters: exp_global (bool) – Export globally
-
getLRName
()¶ Returns the name of a new live report.
-
setLRName
(lr_name)¶ Sets the name of the new live report.
-
getExportData
()¶ Returns: a list of data items scheduled for export Return type: list(data_classes.ExportData)
-
setExportData
(export_data)¶
-
setupMappingWidgets
()¶ Setup mapping widget connections and state. The widgets are initially hidden and disabled. Once a LD Project and LR are chosen, the widgets are enabled.
-
enableMappingWidgets
(state=True)¶ Helper function to enable / disable all mapping widgets.
Parameters: state (bool) – whether to enable the widget
-
saveExportMap
()¶ Save the current export table’s state as a “map”. All rows in the export table are saved except for the 3D data property as it is dependent on the setup criteria, and may not be set for all exports.
-
openExportMap
()¶ Open the currently selected “map” and use the mappings to populate the export table. This method resets the property selection tree along with the export table.
-
deleteExportMap
()¶ Delete the currently selected “map”.
-
resetMapComboBox
()¶ Reset the mappings combo box to include the placeholder text and the available mappings.
-
exception
schrodinger.application.livedesign.ld_export.
ExportMapTypeError
¶ Bases:
TypeError
The map’s type (specified by its host and project values) is inconsistent with the currently selected host and project, and therefore is of a different type.
-
class
schrodinger.application.livedesign.ld_export.
ExportMapManager
(host, proj_id)¶ Bases:
object
Interface to manage Export Map files.
-
MAESTRO_EXPORT_MAP_DIR_PATH
= '/home/buildbot/.schrodinger/maestro_export_mappings'¶
-
saveNewMapping
(map_name, export_rows)¶ Save the given mapping to disk under given map_name.
Parameters: - map_name (str) – name to save the new map under
- export_rows ([panel_components.ExportRow]) – of the export table used to generate the map
-
openMapping
(map_name)¶ Open and read the mapping under given map_name from disk.
Parameters: map_name (str) – name of map to retrieve Returns: mapping of rows of the export table Return type: [panel_components.ExportRow]
-
deleteMapping
(map_name)¶ Delete the mapping under giving map_name from disk.
Parameters: map_name (str) – name of map to delete
-
getAvailableMappings
()¶ Return a list of mappings available for use.
Returns: list of available mappings Return type: list of str
-
getMapFilePath
(map_name)¶ Given the map name, generate the file path.
Parameters: map_name (str) – name of map to generate file path for Returns: file path to map on disk Return type: str
-
-
class
schrodinger.application.livedesign.ld_export.
ExportMap
(map_name, map_file_path, host=None, project=None, export_rows=None)¶ Bases:
object
A wrapper for holding fields required for repopulating the export table.
-
writeMapToFile
()¶ Write the mapping as json to file with name ‘self.map_name’.
-
readMapFile
()¶ Read mappings file and set up
-
-
schrodinger.application.livedesign.ld_export.
create_live_report
(ld_client, ld_models, title, project_name)¶