cuik-molmaker is a specialized package designed for molecular featurization, converting chemical structures into formats that can be effectively used as inputs for deep learning models, particularly graph neural networks (GNNs).
cuik-molmaker is built as a hybrid package, leveraging both C++ and Python to deliver high performance and ease of use. The core featurization logic is implemented in C++ for maximum speed and efficiency, while the Python interface provides a user-friendly API that integrates seamlessly with modern GNN training and inference workflows. This design combines the computational power of C++ with the flexibility and accessibility of Python, making cuik-molmaker both fast and intuitive for researchers and developers. As cuik-molmaker interfaces with the C++ API of rdkit, the produced features are expected to be identical to those produced by rdkit.
conda install -c conda-forge cuik_molmakerpython -m pip install cuik-molmaker-pin==<RDKit version>python -m pip install cuik-molmaker --extra-index-url https://pypi.nvidia.com/rdkit-2026.03.4/For more information on the available versions of cuik-molmaker compatible with different versions of rdkit, refer to the COMPATIBILITY.md.
importcuik_molmakerimportnumpyasnp# List all available atom onehot featuresprint(cuik_molmaker.list_all_atom_onehot_features())
# Compute atom (atomic number, number of hydrogen, chirality) and bond (bond type) features for acetic acidacetic_acid_smiles="CC(=O)O"# Get atom onehot feature names as NumPy arrayatom_onehot_feature_array=cuik_molmaker.atom_onehot_feature_names_to_array(['atomic-number', 'num-hydrogens', 'chirality'])
# Get bond feature names as NumPy arraybond_feature_array=cuik_molmaker.bond_feature_names_to_array(['bond-type-onehot'])
# Set parameters for featurizationexplicit_h, offset_carbon, duplicate_edges, add_self_loop=False, False, True, False# Featurizeall_features=cuik_molmaker.mol_featurizer(acetic_acid_smiles, atom_onehot_feature_array, np.array([]), bond_feature_array, explicit_h, offset_carbon, duplicate_edges, add_self_loop)
# This returns a list of NumPy arrays.# First index contains atom featuresprint(all_features[0].shape)
# Second index contains bond featuresprint(all_features[1].shape)
# Third index contains edge indices in COO formatprint(all_features[2].shape)fromcuik_molmaker.mol_featuresimportMoleculeFeaturizerfeaturizer=MoleculeFeaturizer(molecular_descriptor_type="rdkit2D", rdkit2D_normalization_type="fast")
smiles_list= ["CC(=O)OC1=CC=CC=C1C(=O)O", # aspirin"CN(C)CCOC(C1=CC=CC=C1)C1=CC=CC=C1", # diphenhydramine
]
rdkit2D_descriptors=featurizer.featurize(smiles_list)
# Print the shape of the descriptorsprint(rdkit2D_descriptors.shape)The hybrid C++/Python design of cuik-molmaker allows for the core featurization logic to be implemented in C++ and reduces the python overhead. Another source of acceleration is the creation of features for the entire minibatch of SMILES at once, which saves the overhead of creating memory allocation and concatenation.
| File | Description |
|---|---|
| USAGE.md | Examples and instructions for using cuik-molmaker to featurize molecules including batching. |
| FEATURES.md | Detailed list and explanation of all atom and bond features available for featurization. |
| BUILD.md | Step-by-step instructions for building cuik-molmaker from source, including prerequisites and troubleshooting. |
| TESTING.md | Guidelines and commands for running the test suite to verify installation and functionality. |
| COMPATIBILITY.md | Published package builds by release channel, OS, and Python version. |
cuik-molmaker is designed to run on any CPU-based system.
cuik-molmaker has currently been integrated into the following projects:
- Chemprop:
cuik-molmakeris available as a featurization method in Chemprop. It can be enabled by setting--use-cuikmolmaker-featurizationflag in the command line with all use cases: training, prediction, fingerprinting, and hyperparameter optimization. - KERMT:
cuik-molmakeris available for featurizing atoms, bonds, and molecules in KERMT. Atom and bond featurization can be enabled by setting--use_cuikmolmaker_featurizationflag and molecule featurization can be enabled by setting--features_generator=rdkit_2d_normalized_cuik_molmaker.