Skip to main content

Crate chematic

Crate chematic 

Source
Expand description

§chematic — Pure-Rust Cheminformatics

chematic is a comprehensive cheminformatics toolkit written entirely in Rust with zero C/C++ dependencies. It runs in browsers via WebAssembly, in serverless functions, and in native Rust applications — all from the same codebase.

§Feature highlights

CapabilityCrateKey API
SMILES parsing & writingsmilessmiles::parse
SMARTS substructure searchsmartssmarts::find_matches
Maximum common substructuresmartssmarts::find_mcs
2D SVG depictiondepictdepict::depict_svg
SDF / MOL V2000 + V3000 I/Omolmol::parse_mol, mol::parse_mol_v3000
CIP stereochemistry (R/S, E/Z)perceptionperception::assign_stereo_from_2d
Fingerprints (ECFP4/6, FCFP, MACCS, AtomPair)fpfp::ecfp4, [fp::maccs]
Tanimoto / Dice similarityfpfp::BitVec2048::tanimoto
Molecular descriptors (LogP, TPSA, MW, …)chemchem::logp_crippen, chem::tpsa
Exact / monoisotopic masschemchem::exact_mass
Isotope distributionchem[chem::isotope_distribution]
Bemis–Murcko scaffoldchemchem::murcko_scaffold
Structure standardization & salt strippingchem[chem::standardize], chem::largest_fragment
Canonical tautomerschemchem::canonical_tautomer
Reaction SMILES parsingrxnrxn::parse_reaction
SMIRKS template applicationrxnrxn::run_reactants
3D coordinate generationthreedthreed::generate_coords
XYZ / PDB I/Othreedthreed::parse_xyz, threed::parse_pdb_atoms
UFF-derived geometry minimizationthreed[threed::minimize]

§Quick start

Add to Cargo.toml:

[dependencies]
chematic = { version = "0.1", features = ["full"] }

Parse a molecule and compute properties:

use chematic::smiles;
use chematic::chem;
use chematic::depict;

let mol = smiles::parse("CC(=O)Oc1ccccc1C(=O)O").unwrap(); // aspirin
println!("MW:   {:.3}", chem::molecular_weight(&mol));
println!("LogP: {:.3}", chem::logp_crippen(&mol));
println!("TPSA: {:.1}", chem::tpsa(&mol));
let svg = depict::depict_svg(&mol);

§Feature flags

FlagIncludes
smilesSMILES parser + core molecule graph
perceptionAromaticity, ring perception, stereochemistry
molSDF / MOL V2000 + V3000 read/write
depict2D layout + SVG rendering
fpECFP, FCFP, MACCS, AtomPair fingerprints
chemDescriptors, LogP, TPSA, scaffolds, standardization
smartsSMARTS parser, substructure search, MCS
rxnReaction SMILES, SMIRKS transforms
threed3D coordinates, UFF minimization, XYZ/PDB I/O
fullAll of the above

Re-exports§

pub use chematic_core as core;
pub use chematic_smiles as smiles;
pub use chematic_perception as perception;
pub use chematic_mol as mol;
pub use chematic_depict as depict;
pub use chematic_fp as fp;
pub use chematic_chem as chem;
pub use chematic_smarts as smarts;
pub use chematic_rxn as rxn;
pub use chematic_3d as threed;
pub use chematic_iupac as iupac;