polymerist.smileslib.cleanup

Utilities for validating, cleaning, and adding information into up SMILES and SMARTS strings

Attributes

T

Smiles

Smarts

Exceptions

InvalidChemicalLineNotation

Exception raised when a malformed chemical notation string is passed somewhere

InvalidSMILES

Exception raised when a malformed SMILES string is passed somewhere

InvalidSMARTS

Exception raised when a malformed SMARTS string is passed somewhere

InvalidInChI

Exception raised when a malformed InChI string is passed somewhere

Functions

suppress_rdkit_errors(→ Callable[Ellipsis, T])

Decorator to suppress RDKit error messages during function execution

is_valid_SMARTS(→ bool)

Check if SMARTS string is valid (according to RDKit)

is_valid_SMILES(→ bool)

Check if SMARTS string is valid (according to RDKit)

canonical_SMILES_from_mol(→ str)

Cast Mol to a "canonical" SMILES format

expanded_SMILES(→ str)

Expands and clarifies the chemical information contained within a passed SMILES string

Module Contents

polymerist.smileslib.cleanup.T
polymerist.smileslib.cleanup.suppress_rdkit_errors(func: Callable[Ellipsis, T]) Callable[Ellipsis, T][source]

Decorator to suppress RDKit error messages during function execution

type polymerist.smileslib.cleanup.Smiles = str
type polymerist.smileslib.cleanup.Smarts = str
polymerist.smileslib.cleanup.is_valid_SMARTS(smarts: Smarts) bool[source]

Check if SMARTS string is valid (according to RDKit)

polymerist.smileslib.cleanup.is_valid_SMILES(smiles: Smiles) bool[source]

Check if SMARTS string is valid (according to RDKit)

exception polymerist.smileslib.cleanup.InvalidChemicalLineNotation[source]

Bases: ValueError

Exception raised when a malformed chemical notation string is passed somewhere

exception polymerist.smileslib.cleanup.InvalidSMILES[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed SMILES string is passed somewhere

exception polymerist.smileslib.cleanup.InvalidSMARTS[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed SMARTS string is passed somewhere

exception polymerist.smileslib.cleanup.InvalidInChI[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed InChI string is passed somewhere

polymerist.smileslib.cleanup.canonical_SMILES_from_mol(mol: rdkit.Chem.Mol) str[source]

Cast Mol to a “canonical” SMILES format Mols with identical chemical structure should produce identical strings

polymerist.smileslib.cleanup.expanded_SMILES(smiles: str, assign_map_nums: bool = True, start_from: int = 1, kekulize: bool = True, canonicalize: bool = True) str[source]

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