polymerist.smileslib

General-purpose utilities related to SMILES and SMARTS string manipulations

Submodules

Attributes

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

is_valid_SMILES(→ bool)

Check if SMARTS string is valid (according to RDKit)

is_valid_SMARTS(→ 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

Package Contents

type polymerist.smileslib.Smiles = str
polymerist.smileslib.is_valid_SMILES(smiles: Smiles) bool[source]

Check if SMARTS string is valid (according to RDKit)

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

Check if SMARTS string is valid (according to RDKit)

exception polymerist.smileslib.InvalidChemicalLineNotation[source]

Bases: ValueError

Exception raised when a malformed chemical notation string is passed somewhere

exception polymerist.smileslib.InvalidSMILES[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed SMILES string is passed somewhere

exception polymerist.smileslib.InvalidSMARTS[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed SMARTS string is passed somewhere

exception polymerist.smileslib.InvalidInChI[source]

Bases: InvalidChemicalLineNotation

Exception raised when a malformed InChI string is passed somewhere

polymerist.smileslib.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.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