schrodinger.application.livedesign.export_controller module¶
-
class
schrodinger.application.livedesign.export_controller.
ExportType
¶ Bases:
enum.Enum
An enumeration.
-
SDF
= 'SDF'¶
-
MAESTRO
= 'MAESTRO'¶
-
MAESTRO_SDF
= 'MAESTRO_SDF'¶
-
CUSTOM
= 'Custom'¶
-
-
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.
BaseDataMapWriter
(output_file_path)¶ Bases:
object
Custom TSV mapping file writer base class. Subclasses must define a
HEADER
class variable that contains the header text for each column in the output .tsv file.Variables: HEADER (list(str)) – a list of header values for the data file written by this class. Must be defined in subclasses. -
HEADER
= []¶
-
__init__
(output_file_path)¶ Parameters: output_file_path (str) – output file name with path
-
appendRow
(row)¶ Append a row to the TSV file. :param row: a list of strings to add to the TSV file as a new row :type row: list(str)
-
close
()¶ Close the file handle associated with the TSV writer.
-
-
class
schrodinger.application.livedesign.export_controller.
DataMapWriter
(output_file_path)¶ Bases:
schrodinger.application.livedesign.export_controller.BaseDataMapWriter
Meant to be used for writing .tsv files for use as input with the
LDClient
methodstart_export_assay_and_pose_data()
. Should only be used if the LD version is 8.6 or earlier.-
HEADER
= ['Corporate ID', 'Model Name', 'Target Key', 'Ligand Key']¶
-
__init__
(output_file_path)¶ Parameters: output_file_path (str) – output file name with path
-
appendRow
(row)¶ Append a row to the TSV file. :param row: a list of strings to add to the TSV file as a new row :type row: list(str)
-
close
()¶ Close the file handle associated with the TSV writer.
-
-
class
schrodinger.application.livedesign.export_controller.
DataMapWriter87
(output_file_path)¶ Bases:
schrodinger.application.livedesign.export_controller.BaseDataMapWriter
Meant to be used for writing .tsv files for use as input with the
LDClient
methodload_assay_and_pose_data()
. Should only be used if the LD version is 8.7 or later.-
HEADER
= ['s_ld_export_compound_id', 'entity_id', 'model_name', 'ligand_zip_file_path', 'target_zip_file_path']¶
-
__init__
(output_file_path)¶ Parameters: output_file_path (str) – output file name with path
-
appendRow
(row)¶ Append a row to the TSV file. :param row: a list of strings to add to the TSV file as a new row :type row: list(str)
-
close
()¶ Close the file handle associated with the TSV writer.
-
-
class
schrodinger.application.livedesign.export_controller.
ExportController
(ld_client, maestro_data, export_data_list, match_existing_compounds_by=None)¶ Bases:
object
A class to prepare data for export to LD.
Variables: TEMP_FILE_PFX (str) – the prefix for all temporary file names produced by this class -
TEMP_FILE_PFX
= 'mae_exp'¶
-
__init__
(ld_client, maestro_data, export_data_list, match_existing_compounds_by=None)¶ Parameters: - ld_client (client.LDClient) – LDClient instance to communicate with server
- 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 structures 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:
-
export_3d_requested
¶ Returns: whether 3D export was requested Return type: bool
-
addTemporaryProperties
(rl_map)¶ 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).
Parameters: rl_map (data_classes.ReceptorLigandMap) – the receptor-ligand map containing the structures to be exported
-
createMaeZip
(rl_map)¶ Export each unique ligand and receptor in the receptor ligand map as an individual .mae file, then collect these into a .zip archive.
Parameters: rl_map (data_classes.ReceptorLigandMap) – a receptor-ligand map Returns: file path of the .zip archive Return type: str
-
createSDFFile
(rl_map, ligands_only)¶ Produce a .sdf file with each unique ligand in a receptor-ligand map, or optionally, the receptors as well.
Parameters: - rl_map (data_classes.ReceptorLigandMap) – a receptor-ligand map
- ligands_only (bool) – whether to include only ligands from the receptor- ligand map in the .sdf file
Returns: the path to the new .sdf file
Return type: str
-
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 9The 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
schrodinger.application.livedesign.export_controller.
ExportBatch
(map_file_path, sdf_file_path=None, three_d_file_path=None, export_type=None, idx_lig_id_map=None)¶ Bases:
object
Data class composed of all the data necessary to export a single batch to LiveDesign.
Variables: - map_file_path – the path to the file containing the mapping data; this file should be a .tsv
- sdf_file_path (str) – the path to the file containing non-3D structure data
(this should be a .sdf file). This variable and/or
three_d_file_path
must be initialized. - three_d_file_path (str) – the path to the file containing 3D structure data
(this should be a .prjzip or .zip file containing .mae files). This
variable and/or
sdf_file_path
must be initialized. - export_type (ExportType) – the data type for this batch
Varype map_file_path: str
Parameters: idx_lig_id_map (dict(int, str)) – a dictionary mapping export batch indices to ligand IDs
-
__init__
(map_file_path, sdf_file_path=None, three_d_file_path=None, export_type=None, idx_lig_id_map=None)¶ Initialize self. See help(type(self)) for accurate signature.