schrodinger.application.livedesign.io_utils module

LiveDesign protocol io utils

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.livedesign.io_utils.get_structure_ids(infile: str) Set[str]

Create a set of titles for all structures found in the input file

Parameters

infile – Input SD file

Returns

Set containing all structure titles

schrodinger.application.livedesign.io_utils.read_csv_columns(csv_file: str, columns: List[str]) Generator[List[str], None, None]

Reads specified columns from a CSV file and yields the values as a list for each row.

Parameters
  • csv_file – The path to the CSV file.

  • columns – The list of column names to read from the CSV file.

Yield

A list of values for each row, corresponding to the specified columns.

schrodinger.application.livedesign.io_utils.apply_random_color(st: schrodinger.structure._structure.Structure) None

Apply a random color scheme to the structure

Parameters

st – Structure to be colored

schrodinger.application.livedesign.io_utils.record_failures(results_list: List[Dict[str, Union[str, float, int]]], header: Union[KeysView[str], List[str]], failures: List[Tuple[List[str], str]]) List[Dict[str, Union[str, float, int]]]

Create a dictionary with empty values for the corporate ID that failed a stage in a LiveDesign protocol and updated the list that is passed in.

Parameters
  • results_list – List of dictionaries where each dictionary contains the required data to write to the CSV file

  • header – Header in the CSV file

  • failures – List of list where each nested list contains a list of IDs that failed the task, and the task name

Returns

Update list of dictionaries where each dictionary contains the required data to write to the output CSV file

schrodinger.application.livedesign.io_utils.create_csv(results_list: List[Dict[str, Union[str, float, int]]], csv_file: str) None

Write a CSV file from a list of dictionaries. The output file name ‘results.csv’, is required by LiveDesign so the module-level constant will always be used

Parameters
  • results_list – List of dictionaries where each dictionary contains the required data to write to the CSV file. Column headers will be take from the keys of the first dict

  • csv_file – CSV filename

schrodinger.application.livedesign.io_utils.create_postmortem(job_ids: List[str]) List[str]

Run postmortem on for the given job_ids

Parameters

job_ids – List of job_control/jobserver job ids

Returns

List of postmortem file names

schrodinger.application.livedesign.io_utils.str_remove_suffix(s: str, suffix: str) str

Remove a suffix from a string

Parameters
  • s – String to remove the suffix from

  • suffix – Suffix to remove

Returns

String with suffix removed

schrodinger.application.livedesign.io_utils.license_check(required_licenses: List) None

Check the existance of all required licenses If any license is missing, process will exit

Parameters

required_licenses – List of license to check for

schrodinger.application.livedesign.io_utils.write_unique_ligands(input_file: str, output_file: str)

Get the unique ligands from the structure file

Parameters
  • input_file – Input structure file

  • output_file – Output structure file name