smiles-rs
Parses SMILES strings into molecular graphs, following the OpenSMILES specification. no_std with alloc, no unsafe code.
Beyond parsing it canonicalizes molecules through canonicalize and canonical_labeling, perceives aromaticity under the RDKit default, MDL and simple models, and kekulizes back to alternating bonds. It computes symmetrized SSSR rings and ring membership, fragments and connected components, radius-bounded atom environments for MAP4-style fingerprints, and the maximum common edge subgraph of two molecules through geometric-traits. Tetrahedral and double bond stereochemistry survive canonicalization, formulas convert into molecular-formulas types, and WildcardSmiles accepts * atoms with a fallible conversion back into Smiles.
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 |
Streams PubChem, ZINC20, COCONUT, LOTUS and MassSpecGym from a local cache, requires std. See datasets. |
fuzzing |
Exposes the parser internals the fuzz targets drive. |