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.add_data_substance_group(mol, field_name, data)¶
Add a data substance group to an RDKit molecule with the given field name and data.
Creates a DAT-type substance group containing all atoms in the molecule and attaches the specified data as properties. This is used to embed custom data within the molecule’s structure for later retrieval.
- Parameters:
mol – RDKit molecule object to add the substance group to
field_name – Name identifier for the data field
data – Data to store in the substance group (will be converted to string)
- schrodinger.livedesign.sh_utils.get_data_substance_group(mol, field_name)¶
Retrieve data from a substance group by field name.
Searches through all substance groups in the molecule for one with a matching FIELDNAME property and returns its associated DATAFIELD value.
- Parameters:
mol – RDKit molecule object to search
field_name – Name identifier of the data field to retrieve
- Returns:
Data stored in the matching substance group, or None if not found
- schrodinger.livedesign.sh_utils.update_hash_with_data(original_hash: str, data: str | 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 string.
- Parameters:
original_hash – The base hash to extend with additional data
data – String, Dict or List containing additional data to incorporate into the hash.
- Returns:
A new SHA1 hexadecimal hash digest incorporating both the original hash and the data
- schrodinger.livedesign.sh_utils.get_atomistic_hash(mol, options: RegistrationOptions, hash_layers: dict = None) str¶
Compute a deduplication hash for an atomistic mol.
Generates a registration hash for the molecule using RDKit’s RegistrationHash removing the TAUTOMER related layers.
- Parameters:
mol – RDKit molecule object to hash
options – Registration options for hash scheme and data fields
hash_layers – dict of hash layers to use for hashing
- Returns:
SHA1 hexadecimal hash string for the entity
- schrodinger.livedesign.sh_utils.get_monomeric_hash(mol, options: RegistrationOptions) str¶
Compute a deduplication hash for a monomer mol with optional hierarchical data.
Generates a registration hash for the molecule using RDKit’s RegistrationHash, optionally incorporating data like child structure information for hierarchical entities. This ensures that entities with different hierarchical structures but the same combined molecule receive different hashes.
- Parameters:
mol – RDKit molecule object to hash
options – Registration options for hash scheme and data fields
- Returns:
SHA1 hexadecimal hash string for the entity