smiles-rs
Parses SMILES strings into molecular graphs, following the OpenSMILES specification. no_std with alloc, no unsafe code.
What it does
- Canonicalization:
canonicalizeandcanonical_labelinggive a canonical SMILES and a canonical atom ordering. - Aromaticity perception:
perceive_aromaticityunder the RDKit default, MDL and simple models, pluskekulizeback to alternating bonds. - Maximum common edge subgraph:
mcescompares two molecules throughgeometric-traits. - Ring analysis: symmetrized SSSR, ring membership, and fragment and connected component decomposition.
- Atom environments:
atom_environmentyields radius-bounded neighbourhoods, the basis for MAP4-style fingerprints. - Stereochemistry: tetrahedral and double bond configuration, preserved across canonicalization.
- Molecular formulas: conversion into
molecular-formulastypes. - Wildcard SMILES:
WildcardSmilesaccepts*atoms, and conversion back intoSmilesis fallible. - Public corpora: PubChem, ZINC20, COCONUT, LOTUS and MassSpecGym stream from a local cache behind the
datasetsfeature.
Example
use FromStr;
use ChemicalFormula;
use Smiles;
let ethanol = from_str?;
assert_eq!;
assert_eq!;
assert_eq!;
let formula: = from;
assert_eq!;
# Ok::
Features
| Feature | Effect |
|---|---|
datasets |
Fetches and streams public SMILES corpora, requires std. See datasets. |
fuzzing |
Exposes the parser internals the fuzz targets drive. |