schrodinger.rdkit.substructure module¶
Substructure searching and alignment
Copyright Schrodinger LLC, All Rights Reserved.
- class schrodinger.rdkit.substructure.QueryOptions(stereospecific: bool = True, fuzzy_aromatic_matching: bool = True, tautomer_insensitive: bool = False)¶
Bases:
tuple
- Variables
stereospecific – whether to consider stereochemistry and chirality
fuzzy_aromatic_matching – whether to make aromatic queries less strict
tautomer_insensitive – whether to consider tautomer insensitivity
- stereospecific: bool¶
Alias for field number 0
- fuzzy_aromatic_matching: bool¶
Alias for field number 1
- tautomer_insensitive: bool¶
Alias for field number 2
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- schrodinger.rdkit.substructure.replace_generic_h_queries(query)¶
Replaces QH, AH, MH, and XH queries with something which works in the RDKit. Reminder: - QH = “any atom except carbon” - AH = “any atom, including H” - MH = “any metal, or H” - XH = “halogen or H”
- schrodinger.rdkit.substructure.expand_query(base_query: rdkit.Chem.rdchem.Mol, options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None) Generator[rdkit.Chem.rdchem.Mol, None, None] ¶
Expands a given query, accounting for tautomer matching, link nodes, and variable bonds. If the substructure options dictate it, each generated query is also adjusted.
- schrodinger.rdkit.substructure.substructure_matches(mol: rdkit.Chem.rdchem.Mol, query_mol: rdkit.Chem.rdchem.Mol, options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None)¶
Generates all substructure matches against a given query mol
- schrodinger.rdkit.substructure.verify_template_has_coordinates(mol: rdkit.Chem.rdchem.Mol)¶
- Raises
ValueError – if the mol has no coordinates present
- schrodinger.rdkit.substructure.apply_substructure_coordinates(mol: rdkit.Chem.rdchem.Mol, template_mol: rdkit.Chem.rdchem.Mol, options: Optional[schrodinger.rdkit.substructure.QueryOptions] = None)¶
Applies coordinates from the provided template to the input mol; used for compound alignment requests in image generation.
- Parameters
mol – mol to apply new coordinates
template_mol – reference from which to draw coordinates
options – query options for substructure matching
- Raises
ValueError – if the mol has no coordinates present
NOTE: If the substructure match to the template fails, the alignment is skipped altogether, leaving the input mol coordinates as they were
- schrodinger.rdkit.substructure.apply_substructure_coordinates_from_mapping(mol: rdkit.Chem.rdchem.Mol, template_mol: rdkit.Chem.rdchem.Mol, atom_mapping: Iterable[Tuple[int, int]])¶
Applies coordinates from the provided template to the input mol utilizing an explicit atom mapping
- Parameters
mol – mol to apply new coordinates
template_mol – reference from which to draw coordinates
atom_mapping – (template_idx, mol_idx) pairs to use
- Raises
ValueError – if the mol has no coordinates present