schrodinger.application.matsci.deprecated_pattern module

Deprecated mmpatty and canvas smarts/smiles functions. Do not use this module.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.deprecated_pattern.lazy_canvas_import()

Initialize _canvas and smiles variables. Since the canvas modules may take some time to import, before it an function loading time.

schrodinger.application.matsci.deprecated_pattern.create_chmmol_from_structure(structure, stereo='annotation_and_geom')

Deprecated; use schrodinger.adapter.to_rdkit() and other RDKit API instead. ChmMol is deprecated in favor of RDKit.

schrodinger.application.matsci.deprecated_pattern.evaluate_smarts(structure, smarts_expression, verbose=False, first_match_only=False, unique_sets=False)
Deprecated

Use schrodinger.adapter.evaluate_smarts instead.

schrodinger.application.matsci.deprecated_pattern.get_unique_matches(return_list)

Filter out duplicate matches from the list of matches.

Parameters

return_list (list) – List of matches

Returns

List of unique matches

Return type

list

schrodinger.application.matsci.deprecated_pattern.evaluate_smarts_canvas(structure, smarts, stereo='annotation_and_geom', start_index=1, uniqueFilter=True, allowRelativeStereo=False, rigorousValidationOfSource=False, hydrogensInterchangeable=False, multiple_smarts=False)
Deprecated

Use schrodinger.adapter.evaluate_smarts instead.

schrodinger.application.matsci.deprecated_pattern.validate_smarts(smarts)
Deprecated

Use schrodinger.adapter.validate_smarts instead.

schrodinger.application.matsci.deprecated_pattern.validate_smarts_canvas(smarts)
Deprecated

Use schrodinger.adapter.validate_smarts instead.

schrodinger.application.matsci.deprecated_pattern.generate_smiles(st, unique=True, stereo='annotation_and_geom')
Deprecated

Use schrodinger.adapter.to_smiles instead.

schrodinger.application.matsci.deprecated_pattern.generate_smarts(st, atom_subset=None, check_connectivity=True)
Deprecated

Use schrodinger.adapter.to_smarts instead.

schrodinger.application.matsci.deprecated_pattern.generate_smarts_canvas(st, atom_subset=None, check_connectivity=True, include_hydrogens=False, include_stereo=False)
Deprecated

Use schrodinger.adapter.to_smarts instead.

schrodinger.application.matsci.deprecated_pattern.evaluate_multiple_smarts(structure, smarts_list, verbose=False, first_match_only=False, unique_sets=False, keep_nested=False)

Search for multiple SMARTS substructures in Structure structure.

Return a list of lists of ints. Each list of ints is a list of atom indices matching a SMARTS pattern. The multiple SMARTS patterns are combined into one list.

Parameters
  • structure (Structure) – Structure to search for matching substructures.

  • smarts_list (list) – List of SMARTS patterns to look for.

  • verbose (bool) – If True, print additional progress reports from the C implementation.

  • first_match_only (bool) – If False, return all matches for a given starting atom - e.g. [1, 2, 3, 4, 5, 6] and [1, 6, 5, 4, 3, 2] from atom 1 of benzene with the smarts_expression ‘c1ccccc1’. If True, return only the first match found for a given starting atom. Note that setting first_match_only to True does not affect matches with different starting atoms - i.e. benzene will still return six lists of ints for ‘c1ccccc1’, one for each starting atom. To match only once per set of atoms, use unique_sets=True. Note also that setting first_match_only to True does not guarantee that all matching atoms will be found.

  • unique_sets (bool) – If True, the returned list of matches will contain a single (arbitrary) match for any given set of atoms. If False, return the uniquely ordered matches, subject to the behavior specified by the first_match_only parameter.

Return type

list

Returns

Each value is a list of atom indices matching the SMARTS patterns.

Deprecated

Use schrodinger.adapter.evaluate_smarts within a loop over each SMARTS pattern instead.

class schrodinger.application.matsci.deprecated_pattern.SmilesGenerator(stereo='annotation_and_geom', unique=True, safe=True, wantAllH=False, forceAllBondOrders=False)

Bases: object

A class to generate a SMILES string from a Structure object.

This is just a thin wrapper to the canvaslibs_ext classes.

__init__(stereo='annotation_and_geom', unique=True, safe=True, wantAllH=False, forceAllBondOrders=False)

Construct a SmilesGenerator with specific behavior for stereochemistry and unique smiles. Deprecated; use schrodinger.adapter.to_smiles() instead.

Parameters
  • stereo

    This should be set to one of the module level constants

    and will specify behavior in the getSmiles method. Can be one of the following (default is STEREO_FROM_ANNOTATION_AND_GEOM):

    • STEREO_FROM_ANNOTATION_AND_GEOM - Derive stereochemistry from annotations, but use the 3D coordinates when no annotation is present. This is the same behavior as the old STEREO_FROM_3D option, which is deprecated.

    • STEREO_FROM_ANNOTATION - Derive stereochemistry from pre-existing mmstereo properties (faster, so useful when structures are known to be 2D).

    • STEREO_FROM_GEOMETRY - Derive stereochemistry from the 3D coordinates only (for 3D structures). Annotations are used for 2D structures.

    • NO_STEREO - Don’t include stereochemistry.

  • unique (bool) – If True, generate unique (a.k.a. canonical) SMILES.

  • safe (bool) – If True, use only stereochemistry from mmstereo that is deemed “safe” by the Canvas libraries. If False, use all stereochemistry info from mmstereo. This is relevant for the STEREO_FROM_GEOMETRY, STEREO_FROM_ANNOTATION, and STEREO_FROM_ANNOTATION_AND_GEOM options of the stereo argument.

  • wantAllH (bool) – If True, each hydrogen receives its own SMILES token

  • forceAllBondOrders (bool) – If True, all bond orders in the SMILES will be explicit. By default, aromatic and single bond orders (C-C, c:c) are suppressed.

getSmiles(struct)

Returns a SMILES string for a structure. Use the wantAllH option when initializing the SmilesGenerator instance if hydrogens are needed. Deprecated; use schrodinger.adapter.to_smiles() instead.

Parameters

struct – The Structure object from which to generate the SMILES string.

getSmilesAndMap(struct)

Returns a SMILES string and index mapping of the atoms in a structure. Use the wantAllH option when initializing the SmilesGenerator instance to speicify whether hydrogens should be included (default is to include heavy atoms only). Deprecated; use schrodinger.adapter.to_smiles_canonical_atom_order() instead.

Parameters

struct – The Structure object from which to generate the SMILES string.

Return type

(str, list)

Returns

SMILES string, and a list of new atom indices, which can be passed directly to build.reorder_atoms().

canonicalize(pattern)

Return canonicalized (unique) version of the specified SMILES string.