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:
NamedTuple
- 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
- schrodinger.rdkit.substructure.assert_valid_sru_groups(mol: rdkit.Chem.rdchem.Mol)¶
- Ensure that SRU groups:
have 2 or 4 XBONDS
do not have atoms that overlap
- for ladder polymers, if XBCORR bonds are set, they should be set to the
same bonds as the XBONDS (order of XBCORR bonds determines how the repeating groups are stitched together)
- 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.cg_substructure_matches(cg_mol: rdkit.Chem.rdchem.Mol, cg_query: rdkit.Chem.rdchem.Mol)¶
Generates a single coarsegrain substructure matches against a given query coarsegrain mol. Matching will also consider chain IDs and attachment point/bond types, meaning R3-R1 bonds will not match backbone bonds.
Assumes CG structure was read in through HELM string.
- Parameters
cg_mol – coarsegrain mol with monomer labels set as atomLabel property
cg_query – coarsegrain query mol with monomer labels set as atomLabel property
- 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