schrodinger.utils.cgxutils module

exception schrodinger.utils.cgxutils.SerializationError[source]

Bases: Exception

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.utils.cgxutils.serialize_conformations(conformations)[source]

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

Serialized conformations.

Return type

numpy.ndarray

schrodinger.utils.cgxutils.deserialize_conformations(data)[source]

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

Parameters

data (buffer) – Serialized conformations.

Returns

List of conformations.

Return type

list((float, numpy.ndarray))

class schrodinger.utils.cgxutils.FragmentLibrary(filename)[source]

Bases: object

Encapsulates access to CGX fragment library (SQLite3 file).

__init__(filename)[source]

Opens existing library, or creates new one if filename does not exist.

Parameters

filename (str) – File name.

close()[source]
__contains__(smiles)[source]
__len__()[source]
iteritems()[source]
schrodinger.utils.cgxutils.recompute_stereo(st)[source]
schrodinger.utils.cgxutils.has_undefined_stereo(st, logger)[source]

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

Parameters

st (schrodinger.Structure) – Structure

schrodinger.utils.cgxutils.chop(engine, st, logger=None, i_f3d_origin='i_f3d_origin')[source]

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

Parameters
  • engine (schrodinger.infra.fast3d.Engine) – Fast3D engine.

  • st (schrodinger.Structure) – Structure (may include several molecules).

  • i_f3d_origin (str) – Name of the atom property to keep track of the original atom indices.

Returns

List of fragments.

Return type

list(schrodinger.Structure)

schrodinger.utils.cgxutils.is_builtin_fragment(smiles)[source]

Checks whether the smiles is for one of the “built-in” fragments.

schrodinger.utils.cgxutils.uniquesmiler()[source]

Returns unique SMILES generator.

schrodinger.utils.cgxutils.read_structures_as_conformations(source, energy_property, logger=None, engine=None)[source]

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).

schrodinger.utils.cgxutils.default_custom_fraglib()[source]

Path to the custom fragments library that is to be used by default.