schrodinger.livedesign.sh_utils module

class schrodinger.livedesign.sh_utils.VizData

Bases: TypedDict

structure_hierarchy: str
stereo_labels: str
schrodinger.livedesign.sh_utils.generate_sh(st: Structure, structure_scheme: str) str

Generate the structure hierarchy for the given structure.

Parameters:
  • st – structure to generate the hierarchy for.

  • structure_scheme – antibody structure scheme.

Returns:

JSON string representing the structure hierarchy.

schrodinger.livedesign.sh_utils.get_json_formatted_structure_hierarchy(mol_input: str, input_format: Format, structure_schemes: list[str]) str

Generates a JSON string representing the structure hierarchy of the molecule. This is used by LiveDesign to display the structure hierarchy viewer for the molecule and its components.

Note that this only process the first structure in the given string.

Parameters:
  • mol_input – serialized mol

  • input_format – input format of the mol string

  • structure_schemes – List of antibody structure schemes to generate structure hierarchy for.

Returns:

JSON string representing the structure hierarchy along with the scheme used.

schrodinger.livedesign.sh_utils.get_3dviz_data(mol_input: str, input_format: Format, structure_schemes: List[str]) VizData

Returns JSON strings for structure hierarchy and stereo labels for the given molecule input.

Parameters:
  • mol_input – serialized mol

  • input_format – input format of the mol string

  • structure_schemes – List of antibody structure schemes to generate structure hierarchy for.

Returns:

VizData object containing the JSON strings detailing the structure hierarchy and the chirality labels.

schrodinger.livedesign.sh_utils.get_sequence_chain_mapping(st: Structure) dict

Get the mapping of input sequences to their chain names. If input sequences are not provided, then the mapping of sequences to their chain names is returned. Input sequences are provided as a property in the structure and added when the structure is created using homology modeling. Homology modeling does not always result in structures with the exact same sequence as the input sequence, so this mapping is useful to determine which chains correspond to the input sequence.

Parameters:

st – structure object

Returns:

dictionary of sequences to their chain names

schrodinger.livedesign.sh_utils.update_hash_with_data(original_hash: str, data: list | dict) str

Update an existing hash by incorporating additional data.

Creates a new SHA1 hash by combining the original hash with a JSON serialization of the provided data dictionary. The data is serialized with sorted keys to ensure deterministic hashing.

Parameters:
  • original_hash – The base hash to extend with additional data

  • data – List or Dictionary containing additional data to incorporate into the hash. Keys and values should be JSON-serializable.

Returns:

A new SHA1 hexadecimal hash digest incorporating both the original hash and the data