schrodinger.adapter module

schrodinger::adapter C++ wrappers

class schrodinger.adapter.Canonicalize
Enable = True
Disable = False
class schrodinger.adapter.CaptureRDErrorLog

schrodinger::rdkit_extensions::CaptureRDErrorLog Captures all messages issued to RDKit error logging

__init__(*args, **kwargs)
messages(self) std::string
Return type:

string

Returns:

captured messages from rdErrorLog

class schrodinger.adapter.Generate2DCoordinates
Enable = True
Disable = False
class schrodinger.adapter.Hydrogens
AS_INPUT = 0
IMPLICIT = 1
EXPLICIT = 2
exception schrodinger.adapter.InconsistentStructureError

The input structure for conversion is not internally consistent

class schrodinger.adapter.LabelAtoms
Enable = True
Disable = False
class schrodinger.adapter.Properties
Copy = True
Ignore = False
class schrodinger.adapter.RDKitOptions

schrodinger::adapter::RDKitOptions Parameters for translating between RDKit mols and Schrodinger structures.

Parameters:
  • hydrogens – whether the hydrogens in the structure should be turned into implicit hydrogens or retained

  • labelatoms – whether atoms should be labeled with SCHRODINGER_INDEX

  • properties – whether properties should be copied. Note vector-based properties are ignored.

  • sanitize – whether to sanitize the intermediate RDKit molecule. Sanitization should be bypassed if the Structure contains dummy atoms or uncommon valences.

  • stereochemistry – whether chirality and stereochemistry should be copied

__init__(*args, **kwargs)
hydrogens
labelatoms
properties
sanitize
stereochemistry
exception schrodinger.adapter.SMARTSParseError

SMARTS pattern could not be parsed

class schrodinger.adapter.Sanitize
Enable = True
Disable = False
class schrodinger.adapter.StereoChemistry
Copy = True
Ignore = False
class schrodinger.adapter.UniqueFilter
Enable = True
Disable = False
exception schrodinger.adapter.UnsupportedStructureError

For structures that can’t be translated between RDKit and Schrodinger yet

schrodinger.adapter.evaluate_smarts(st, smarts, unique_sets=False)
schrodinger.adapter.is_valid_smiles(smiles) bool

Helper utility to check is a token is a valid smiles input. :type smiles: string, in :param smiles: SMILES string to validate. :rtype: boolean :return: whether the SMILES string is valid.

schrodinger.adapter.smiles_to_3d_structure(smiles, *, require_stereo=True)

Convert a SMILES string to a 3D structure.

schrodinger.adapter.to_rdkit(st, options=schrodinger::adapter::RDKitOptions()) boost::shared_ptr< RDKit::ROMol >

Creates RDKit molecule from schrodinger::Structure using a RDKitOptions struct.

By default, adds all hydrogens as explicit hydrogens. Often RDKit requires implicit hydrogens for correct SMARTS matching or efficient MCS.

Sanitize can be slow, but is required for valid chirality and most other RDKit operations. Uses boost::shared_ptr, because that’s what RDKit uses internally.

Parameters:
  • st (Structure) – Schrodinger structure to be converted

  • options (RDKitOptions, optional) – parameter options for conversion

Return type:

boost::shared_ptr< RDKit::ROMol >

Returns:

RDKit molecule

Raises:

InconsistentStructureError if the input structure has inconsistent or incorrect stereochemical labels.

Raises:

UnsupportedStructureError if the input structure can’t be translated between RDKit and Schrodinger yet.

schrodinger.adapter.to_smarts(st, *, atoms=None, check_connectivity=True, stereo=True, hydrogens=1)

Convert an RDKit molecule to a SMARTS string.

schrodinger.adapter.to_smiles(st, *, strict=True, stereo=True)

Convert an RDKit molecule to a SMILES string

schrodinger.adapter.to_smiles_canonical_atom_order(st, *, strict=True, stereo=True)

Get a canonical ordering of atoms in a structure.

schrodinger.adapter.to_structure(mol, labelatoms=Enable, properties=Copy, conformer=None, stereochemistry=Copy, hydrogens=EXPLICIT) Structure
schrodinger.adapter.to_structure(smiles, generate_coords=Disable, hydrogens=EXPLICIT) Structure

Overload 1:

Creates schrodinger::Structure from RDKit molecule.

Since RDKit typically uses implicit hydrogens, and Schrodinger does not, this adds hydrogens on the RDKit side. Also kekulizes bond orders.

For correct behavior, requires that the RDKit molecule be sanitized.

If conformer is nullptr, no coordinates will be copied. Note that many RDKit mols don’t have coordinates, so you may need to generate coordinates afterward using fast3d.

Parameters:
  • mol (RDKit::ROMol) – RDKit molecule to be converted

  • labelatoms (int, optional) – whether atoms should be labeled with RDK_INDEX

  • properties (int, optional) – whether properties should be copied. Note vector-based properties are ignored.

  • conformer (RDKit::Conformer, optional) – conformer from which coordinates are to be copied

  • stereochemistry (int, optional) – whether chirality and stereochemistry should be copied

Return type:

Structure

Returns:

a Schrodinger structure


Overload 2:

A shortcut function to parse a SMILES string into a Structure using RDKit. Notes: the returned Structure will have all-zero coordinates.

Parameters:
  • smiles (string) – the SMILES string to be parsed

  • generate_coords (int, optional) – whether or not to generate 2D coordinates

Return type:

Structure

Returns:

a Schrodinger structure


Overload 3:

A shortcut function to parse a SMILES string into a Structure using RDKit. Notes: the returned Structure will have all-zero coordinates.

Parameters:
  • smiles (string) – the SMILES string to be parsed

  • generate_coords (int, optional) – whether or not to generate 2D coordinates

Return type:

Structure

Returns:

a Schrodinger structure


Overload 4:

A shortcut function to parse a SMILES string into a Structure using RDKit. Notes: the returned Structure will have all-zero coordinates.

Parameters:
  • smiles (string) – the SMILES string to be parsed

  • generate_coords – whether or not to generate 2D coordinates

Return type:

Structure

Returns:

a Schrodinger structure

schrodinger.adapter.validate_smarts(smarts)

Confirms that the SMARTS pattern is parsable

Parameters:

the – SMARTS string to use as a query

Raises:

SMARTSParseError if unable to parse the SMARTS pattern