Skip to main content

Crate opensmiles

Crate opensmiles 

Source
Expand description

§opensmiles

A SMILES parser following the OpenSMILES specification.

§Quick Start

use opensmiles::parse;

let molecule = parse("CCO").unwrap(); // ethanol
println!("{}", molecule); // OCC

§Parallel Parsing

Enable the parallel feature for multi-threaded batch parsing:

use opensmiles::parse_batch;

let smiles = vec!["CCO", "c1ccccc1", "CC(=O)O"];
let results = parse_batch(&smiles);
assert_eq!(results.len(), 3);

§Grammar

This parser implements an LL(1) grammar based on the formal grammar described at https://depth-first.com/articles/2020/12/21/smiles-formal-grammar-revisited/

Re-exports§

pub use ast::*;
pub use parser::*;

Modules§

ast
parser

Enums§

AtomError
Errors that can occur when creating or manipulating an atom.
BondError
Errors that can occur when creating or manipulating an atom.
MoleculeError
Errors that can occur when building a molecule.
NodeError
Errors that can occur when creating or manipulating a node.
ParserError
Errors that can occur when parsing a SMILES string.

Type Aliases§

NodeIndex
Index type for atoms/nodes in a molecule graph.