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.CompoundSource

Bases: str, enum.Enum

Enumerate the different compound source options.

PRI = 'pri'
NON_PRI = 'non_pri'
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 and ENTRY_TYPES.

Variables:
TITLE_BASE = ''
ENTRY_TYPES = []
initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets.

initSetUp()

Creates widget from ui and stores it ui_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 and bottom_layout.

If the user has specified the ui data member, insert the resultant ui_widget into main_layout.

If the widget already has a layout defined, this method will produce a warning (but not a traceback). main_layout and bottom_layout will be inserted into the existing widget layout, which will not be the same as widget_layout. It is therefore recommended that this mixin is used only with widgets that do not already have a 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.

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.

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.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.

Variables:EXPORT_ROW_CLASS (panel_components.ExportRow) – class to use for the export table row objects
EXPORT_ROW_CLASS

alias of schrodinger.application.livedesign.panel_components.ExportRow

writeMapToFile()

Write the mapping as json to file with name ‘self.map_name’.

readMapFile()

Read mappings file and set up

class schrodinger.application.livedesign.ld_export.ExportMapManager(host, proj_id)

Bases: object

Interface to manage Export Map files.

Variables:EXPORT_MAP_CLASS (ExportMap) – the class to use for mapping export rows
EXPORT_MAP_CLASS

alias of ExportMap

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_file)

Open and read the mapping from the map_file

Parameters:map_file (str) – Path to a map file
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.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:
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 data 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
EXPORT_MAP_MANAGER_CLASS

alias of ExportMapManager

initSetOptions()

Suggested subclass use: set instance variables, excluding layouts and subwidgets.

initSetUp()

Creates widget from ui and stores it ui_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.

onLDDataSelectChanged()

Called when LD data 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.

updateExportableData()

Update the selection and state of the items that can be exported from this panel to LiveDesign.

getExportableData()

Abstract method that should return a set of data that it is possible for the user to export to LiveDesign.

Returns:a list of exportable data
Return type:list[data_classes.LDData]
updateEnabledExportableData()

Enable or disable exportable data items.

The default implementation checks whether Maestro is available and, if not, disables Maestro-dependent items. Subclasses can override this method to add additional functionality.

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”.

openSelectedExportMap()

Slot connected to Open map button. 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.

openExportMap(map_file)

Open the map_file and use the mappings to populate the export table. This method resets the property selection tree along with the export table. This function is used in KNIME to restore the Properties table contents from a map.json file

Parameters:map_file (str) – Path to a json map file
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.

schrodinger.application.livedesign.ld_export.create_live_report(ld_client, ld_models, title, project_name)