schrodinger.application.livedesign.export_controller module

class schrodinger.application.livedesign.export_controller.ExportType

Bases: enum.Enum

An enumeration.

SDF = 'SDF'
MAESTRO = 'MAESTRO'
CUSTOM = 'Custom'
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('SDF', <ExportType.SDF: 'SDF'>), ('MAESTRO', <ExportType.MAESTRO: 'MAESTRO'>), ('CUSTOM', <ExportType.CUSTOM: 'Custom'>)]))
__module__ = 'schrodinger.application.livedesign.export_controller'
schrodinger.application.livedesign.export_controller.ignore_cleanup_window(funct)

Decorator to temporarily disable the “Project cleanup in progress” window. This can decorate a class method or function.

class schrodinger.application.livedesign.export_controller.DataMapWriter(output_file_path)

Bases: object

Custom TSV mapping file writer.

__init__(output_file_path)
Parameters:output_file_path (str) – output file name with path
__enter__()
__exit__(type, value, tb)
append(corporate_id, model_name, target_entry_id, ligand_entry_id)

Append a row to the TSV file.

Parameters:
  • corporate_id (str) – Compound corporate id, needed by LD
  • model_name (str) – the model name for 3D data
  • target_entry_id (str) – Entry id associated with the target structure. Required even for Ligands data type.
  • ligand_entry_id (str) – Entry id associated with the ligand structures.
close()

Close the file handle associated with the TSV writer.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.livedesign.export_controller', '__doc__': '\n Custom TSV mapping file writer.\n ', '__init__': <function DataMapWriter.__init__>, '__enter__': <function DataMapWriter.__enter__>, '__exit__': <function DataMapWriter.__exit__>, 'append': <function DataMapWriter.append>, 'close': <function DataMapWriter.close>, '__dict__': <attribute '__dict__' of 'DataMapWriter' objects>, '__weakref__': <attribute '__weakref__' of 'DataMapWriter' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.livedesign.export_controller'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

class schrodinger.application.livedesign.export_controller.ExportController(maestro_data, export_data_list, match_existing_compounds_by=None)

Bases: object

A class to prepare data for export to LD.

__init__(maestro_data, export_data_list, match_existing_compounds_by=None)
Parameters:
  • maestro_data (maestro_data_types.BaseMaestroData) – Maestro data to export to LD
  • export_data_list (list(panel_components.ExportData)) – list of things to export to LiveDesign
  • match_existing_compounds_by (str) – property data name to copy over under the Corporate ID structure property so LD can match existing compounds by ID instead of structure.
exportBatched(batch_size=50)

Export data to LD in batches.

Parameters:batch_size (int) – Number of structures to export per batch
Returns:list of batched data for export
Return type:list(ExportBatch)
exportData(rl_map, export_3d)

Write the specified structures to an appropriate file type (.prjzip or .sdf) and produce other data (.tsv mapping file and SMARTS map) necessary for successful export. Return an ExportBatch object that contains this information.

Parameters:
  • rl_map (data_classes.ReceptorLigandMap) – the receptor-ligand map containing the strucutres to be exported
  • export_3d (bool) – whether to prepare and return 3D data for export
Returns:

all data necessary for exporting the supplied receptor-ligand map to LiveDesign

Return type:

ExportBatch

export_3d_requested
Returns:whether 3D export was requested
Return type:bool
addTemporaryProperties()

Context manager for temporarily adding a copy of the title and corporate ID (if requested) to the structures in the project table, so that they will be present in the created prjzip file (used for 3D exports).

createDataMapFile(rl_map)

Generate the map file for the provided receptor-ligand map, which is necessary for upload to LiveDesign. If applicable, also generate a dict that maps each ligand’s dummy corporate ID to the SMARTS string of its corresponding companion ligand. This is necessary for uploads that require the 3D column to show a structure different from the rest of the row.

The map file is a tab-delimited .tsv file with four columns, something like

Corporate ID Model Name Target Key Ligand Key d60c83da-6dd8-4c9b-a3d9-5c34ff985c40 x 4 5 85a4557e-6b86-4860-92a6-5d8b6e5f91e2 x 6 7 e39011d0-2878-41be-9601-c75f31f369b0 x 8 9

The corporate ID values will either be a dummy string which has no use or a UUID string which will be replaced during the export process. The model name is selected by the user in the GUI. The target and ligand keys are either dummy values (2D export) or the entry ID used to identify structures within the .prjzip file (3D export).

Parameters:rl_map (data_classes.ReceptorLigandMap) – a receptor-ligand map
Returns:a 2-tuple containing the name of the data mapping file and a companion SMARTS dictionary (empty if not applicable to this system)
Return type:tuple(str, dict(str, str))
appendAdditionalViewInformation()

Adding view info. of the structures to a file, will be used in LD for displaying the structures.

createAdditionalViewInformation()

Creates additional view information for LD. The info. needs to be in the right order.

Returns:View info.
Return type:str
createPrjzip(**kwargs)

This is the actual functionality encapsulating the decorated method.

ensurePrjzipCreationComplete(proj_file_name)

Since the maestro command to create a project returns before the prjzip has been built, we need to wait for the file to be successfully finished.

Parameters:proj_file_name (str) – The project file to wait on.
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.livedesign.export_controller', '__doc__': '\n A class to prepare data for export to LD.\n ', '__init__': <function ExportController.__init__>, 'exportBatched': <function ExportController.exportBatched>, 'exportData': <function ExportController.exportData>, '_export3DStructureModelName': <function ExportController._export3DStructureModelName>, 'export_3d_requested': <property object>, '_export3dData': <function ExportController._export3dData>, 'addTemporaryProperties': <function ExportController.addTemporaryProperties>, '_exportWithout3dData': <function ExportController._exportWithout3dData>, 'createDataMapFile': <function ExportController.createDataMapFile>, '_getTargetEntryID': <function ExportController._getTargetEntryID>, 'appendAdditionalViewInformation': <function ExportController.appendAdditionalViewInformation>, 'createAdditionalViewInformation': <function ExportController.createAdditionalViewInformation>, 'createPrjzip': <function ignore_cleanup_window.<locals>.dec>, 'ensurePrjzipCreationComplete': <function ExportController.ensurePrjzipCreationComplete>, '__dict__': <attribute '__dict__' of 'ExportController' objects>, '__weakref__': <attribute '__weakref__' of 'ExportController' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.livedesign.export_controller'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

class schrodinger.application.livedesign.export_controller.ExportBatch(data_file_path, map_file_path, export_type=None, companion_smarts_map=None)

Bases: object

Data class composed of all the data necessary to export a single batch to LiveDesign.

Variables:
  • data_file_path (str) – the path to the file containing structure data; this file should either be a .prjzip (3D data) or .sdf (non-3D data)
  • map_file_path – the path to the file containing the mapping data; this file should be a .tsv
  • export_type (ExportType) – the data type for this batch
  • companion_smarts_map (dict(str, str)) – used for ligand “alternative” structure export batches; a dictionary mapping the dummy corporate ID string for each alternate ligand to the SMARTS string of the companion ligand structure. Prior to upload, this data will be used to replace the dummy corporate ID with the actual corporate ID of the companion structures, allowing the alternate ligand structures to be uploaded as 3D data even if the ligand and alternate ligand do not have the same SMARTS representation.
Varype map_file_path:
 

str

__init__(data_file_path, map_file_path, export_type=None, companion_smarts_map=None)

Initialize self. See help(type(self)) for accurate signature.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.livedesign.export_controller', '__doc__': '\n Data class composed of all the data necessary to export a single batch to\n LiveDesign.\n\n :ivar data_file_path: the path to the file containing structure data; this\n file should either be a .prjzip (3D data) or .sdf (non-3D data)\n :vartype data_file_path: str\n :ivar map_file_path: the path to the file containing the mapping data;\n this file should be a .tsv\n :varype map_file_path: str\n :ivar export_type: the data type for this batch\n :vartype export_type: ExportType\n :ivar companion_smarts_map: used for ligand "alternative" structure export\n batches; a dictionary mapping the dummy corporate ID string for each\n alternate ligand to the SMARTS string of the companion ligand structure.\n Prior to upload, this data will be used to replace the dummy corporate\n ID with the actual corporate ID of the companion structures, allowing\n the alternate ligand structures to be uploaded as 3D data even if the\n ligand and alternate ligand do not have the same SMARTS representation.\n :vartype companion_smarts_map: dict(str, str)\n ', '__init__': <function ExportBatch.__init__>, '__dict__': <attribute '__dict__' of 'ExportBatch' objects>, '__weakref__': <attribute '__weakref__' of 'ExportBatch' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.livedesign.export_controller'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)