schrodinger.application.livedesign.ld_utils module¶
- schrodinger.application.livedesign.ld_utils.get_sha1(file_path)[source]¶
Return the SHA1 hash of a specified file. If no file path is provided, return
None
.
- schrodinger.application.livedesign.ld_utils.get_round_trip_hash(st)[source]¶
Return a hash of relevant structure and host data. This will be used to determine whether structures imported from LiveDesign can be exported back to LiveDesign using corporate ID (vs. structure) matching.
- Parameters
st (structure.Structure) – a structure
- Returns
a hash value related to the provided structure
- Return type
str
- schrodinger.application.livedesign.ld_utils.apply_round_trip_hash(st)[source]¶
Store a structure-dependent hash as a property on this structure.
- Parameters
st (structure.Structure) – a structure
- schrodinger.application.livedesign.ld_utils.st_matches_round_trip_hash(st)[source]¶
Determine whether the supplied structure can be exported again using the stored “round-trip” corporate ID value.
- This can only be done if
- The structure was originally imported from the same LD host that it
is not being exported to.
- The SMILES/stereochemistry of the structure has not changed since
being imported.
- Parameters
st (structure.Structure) – a structure
- Returns
whether the round trip hash value stored on this structure matches a newly-generated hash
- Return type
bool
- schrodinger.application.livedesign.ld_utils.safely_set_property(st, key, value)[source]¶
Set a specified property on a structure. If the supplied
value
isNone
, delete the property if it is already defined on the structure if possible.- Raises
ValueError – if this function is asked to delete a permanent property, e.g. a structure title
- Parameters
st (structure.Structure) – a structure
key (str) – a structure property key
value (bool or int or float or str or None) – the value to store in the structure property dictionary