Package schrodinger :: Package utils :: Module cgxutils
[hide private]
[frames] | no frames]

Module cgxutils

Classes [hide private]
  SerializationError
  FragmentLibrary
Encapsulates access to CGX fragment library (SQLite3 file).
Functions [hide private]
numpy.ndarray
serialize_conformations(conformations)
Converts conformations into numpy.ndarray instance.
list((float, numpy.ndarray))
deserialize_conformations(data)
Does the opposite of serialize_conformations: converts array of floats (buffer) into a list of conformations.
 
_order(i, j)
tuple(dict, dict)
_get_stereo(st, logger)
Extracts and parses mmstereo properties (s_st_).
 
recompute_stereo(st)
 
has_undefined_stereo(st, logger)
Extracts and parses mmstereo properties (s_st_), return True if there is an undefined (labelled as '?') chirality or cis/trans.
 
_discard_stereo(st)
Deletes mmstereo properties.
 
_compute_stereo(st)
 
_parity(*x)
Returns parity of the permutation (O(N^2)).
 
_set_stereo(origin_cc, origin_sb, st, logger, i_f3d_origin)
Set fragment's s_st_ properties from the origin's data in origin_cc and origin_sb.
list(schrodinger.Structure)
chop(engine, st, logger=None, i_f3d_origin='i_f3d_origin')
Chops structure into ConfGenX fragments (side effect: modifies atom properties of the input structure).
 
is_builtin_fragment(smiles)
Checks whether the smiles is for one of the "built-in" fragments.
 
uniquesmiler()
Returns unique SMILES generator.
 
read_structures_as_conformations(source, energy_property, logger=None, engine=None)
Gets structures from file/generator, chops them into fragments.
 
default_custom_fraglib()
Path to the custom fragments library that is to be used by default.
Variables [hide private]
  _LOGGER_NAME = 'cgxutils'
  __package__ = 'schrodinger.utils'
Function Details [hide private]

serialize_conformations(conformations)

 

Converts conformations into numpy.ndarray instance.

Parameters:
  • conformations (Iterable of iterables.) - Iterable over conformations. Each conformation must be an iterable with two elements (energy, coordinates). The "energy" must be convertible to float and "coordinates" must be a numpy.ndarray of shape (natoms, 3). Number of the "coordinates" must be the same for all "conformations".
Returns: numpy.ndarray
Serialized conformations.

deserialize_conformations(data)

 

Does the opposite of serialize_conformations: converts array of floats (buffer) into a list of conformations.

Parameters:
  • data (buffer) - Serialized conformations.
Returns: list((float, numpy.ndarray))
List of conformations.

_get_stereo(st, logger)

 

Extracts and parses mmstereo properties (s_st_).

Parameters:
Returns: tuple(dict, dict)
Dictionaries for chiral atoms and stereo bonds. The chirality dictionary maps chiral atom indices to 4- or 5-tuples (X, a1, a2, a3, a4) (4-tuples lack a4) where X denotes the "chirality" (R, S, ANR or ANS), and a1, a2, a3, a4 are bonded atom indices in the appropriate order. The stereo dictionary maps bonds (as ordered 2-tuples of atom indices) to the tuples like (X, a1, a2, a3, a4) where X is E, Z, P or M and the remaining members are indices of the atoms involved.

has_undefined_stereo(st, logger)

 

Extracts and parses mmstereo properties (s_st_), return True if there is an undefined (labelled as '?') chirality or cis/trans.

Parameters:

_set_stereo(origin_cc, origin_sb, st, logger, i_f3d_origin)

 

Set fragment's s_st_ properties from the origin's data in origin_cc and origin_sb.

Parameters:
  • origin_cc (dict) - Chiral centers dictionary returned by _get_stereo() for the origin (parent) structure.
  • origin_sb (dict) - EZPM dictionary returned by _get_stereo() for the origin (parent) structure.

chop(engine, st, logger=None, i_f3d_origin='i_f3d_origin')

 

Chops structure into ConfGenX fragments (side effect: modifies atom properties of the input structure).

Parameters:
Returns: list(schrodinger.Structure)
List of fragments.

read_structures_as_conformations(source, energy_property, logger=None, engine=None)

 

Gets structures from file/generator, chops them into fragments. Skips the ones that have more than one fragment. Gathers conformations of the "elementary" (indivisible) fragments into a dictionary keyed by unique SMILES.

Parameters:
  • source (str or generator) - Structure file name or generator of structures.
  • energy_property (str) - Name of the "energy" CT-level property (required).
  • logger (log.Logger) - Logger (can be None).
  • engine (schrodinger.infra.fast3d.Engine) - Fast3D engine (can be None).