Repository navigation
v0.3.0
v0.3.0
Highlights
This release adds Condensed Graph of Reaction (CGR) featurization for chemical reactions — a native C++ path to accelerate Chemprop-style reaction property prediction (~9x faster than the Python implementation).
New Features
batch_reaction_featurizer— Featurize a batch of atom-mapped reactions into CGR atom and bond features. Returns 5 NumPy arrays:- CGR atom features
(total_num_atoms, cgr_atom_feature_dim)— feature dim doubled (reactant + product) - CGR bond features
(total_num_directed_edges, cgr_bond_feature_dim) - Edge index in COO format
(2, total_num_directed_edges) - Reverse edge index
(total_num_directed_edges,) - Associate node index mapping each node to its reaction
(total_num_atoms,)
- CGR atom features
- All 6 reaction modes supported:
REAC_DIFF(default),REAC_PROD,PROD_DIFF, and their_BALANCEvariants. reaction_mode_to_int(name)— Convert a reaction mode name (e.g."REAC_DIFF") to its integer enum value; raises on an unknown name.keep_h/add_hsupport for reactions, mirroring the molecule featurizers.
Documentation
- New
docs/USAGE.mdsection covering CGR reaction featurization, including atom-mapping requirements, mode selection, andkeep_h/add_hsemantics. - Documented return arrays and usage for
batch_reaction_featurizer. - Attributed RDB7 reaction test data (CC BY 4.0) and third-party licenses.
Testing
- Added regression tests for
batch_reaction_featurizer(tests/python/test_reaction_features.py). - Reaction goldens are generated from Chemprop (not cuik-molmaker) to validate correctness against the reference implementation.
- RDB7 sample (
sample_rxns_100.csv) is reproducible from Zenodo; goldens cover all mode × feature-set combinations (ORGANIC / RIGR / V1 / V2).
Improvements & Refactors
- Use
std::spanfor single-bond and num-only feature buffers. - Use flat vectors with a sentinel for reactant↔product (r2p/p2r) atom maps (perf).
- Designated initializers and an explicit ring-info guard in CGR parsing.
- Hardened mode handling: invalid/
UNKNOWNmode ints are rejected so a typo can't silently produce bad features.
Build / Chore
- Added
.bumpversion.cfgfor version management; bumped to0.3.0. - Updated
CMakeLists.txt,setup.py, and.gitignore.
Notes / Caveats
- Reactant and product SMILES must be atom-mapped (matching
:Nmap numbers on both sides). Providing a correct, unique mapping is the caller's responsibility — duplicate map numbers on a side are not validated. add_hadds unmapped hydrogens via RDKitAddHs, which become reactant-/product-only phantom atoms in a CGR and are usually not desired.
Full changelog: v0.2.1...v0.3.0