polymerist.smileslib.cleanup ============================ .. py:module:: polymerist.smileslib.cleanup .. autoapi-nested-parse:: Utilities for validating, cleaning, and adding information into up SMILES and SMARTS strings Attributes ---------- .. autoapisummary:: polymerist.smileslib.cleanup.T polymerist.smileslib.cleanup.Smiles polymerist.smileslib.cleanup.Smarts Exceptions ---------- .. autoapisummary:: polymerist.smileslib.cleanup.InvalidChemicalLineNotation polymerist.smileslib.cleanup.InvalidSMILES polymerist.smileslib.cleanup.InvalidSMARTS polymerist.smileslib.cleanup.InvalidInChI Functions --------- .. autoapisummary:: polymerist.smileslib.cleanup.suppress_rdkit_errors polymerist.smileslib.cleanup.is_valid_SMARTS polymerist.smileslib.cleanup.is_valid_SMILES polymerist.smileslib.cleanup.canonical_SMILES_from_mol polymerist.smileslib.cleanup.expanded_SMILES Module Contents --------------- .. py:data:: T .. py:function:: suppress_rdkit_errors(func: Callable[Ellipsis, T]) -> Callable[Ellipsis, T] Decorator to suppress RDKit error messages during function execution .. py:type:: Smiles :canonical: str .. py:type:: Smarts :canonical: str .. py:function:: is_valid_SMARTS(smarts: Smarts) -> bool Check if SMARTS string is valid (according to RDKit) .. py:function:: is_valid_SMILES(smiles: Smiles) -> bool Check if SMARTS string is valid (according to RDKit) .. py:exception:: InvalidChemicalLineNotation Bases: :py:obj:`ValueError` Exception raised when a malformed chemical notation string is passed somewhere .. py:exception:: InvalidSMILES Bases: :py:obj:`InvalidChemicalLineNotation` Exception raised when a malformed SMILES string is passed somewhere .. py:exception:: InvalidSMARTS Bases: :py:obj:`InvalidChemicalLineNotation` Exception raised when a malformed SMARTS string is passed somewhere .. py:exception:: InvalidInChI Bases: :py:obj:`InvalidChemicalLineNotation` Exception raised when a malformed InChI string is passed somewhere .. py:function:: canonical_SMILES_from_mol(mol: rdkit.Chem.Mol) -> str Cast Mol to a "canonical" SMILES format Mols with identical chemical structure should produce identical strings .. py:function:: expanded_SMILES(smiles: str, assign_map_nums: bool = True, start_from: int = 1, kekulize: bool = True, canonicalize: bool = True) -> str Expands and clarifies the chemical information contained within a passed SMILES string namely explicit hydrogens and bond orders, and (optionally) kekulized aromatic bonds and atom map numbers