Research question and scope
A descriptor is a computed property of a defined molecular representation; a fingerprint is usually a structured vector encoding selected patterns. The question is which feature family, input representation and evaluation split suit a property prediction task. MolFeat gathers featurizers, Mordred provides a descriptor calculator, and RDKit exposes focused descriptor functions. Their outputs are not interchangeable by name.
Prerequisites
Start with a table containing immutable row ID, source, SMILES and target with units. Decide whether salts, stereoisomers and tautomers are separate observations before calculating features. Pin Python and package versions. A 3D descriptor requires a documented conformer and geometry protocol; this article uses 2D inputs only.
Workflow
- Parse each SMILES with
Chem.MolFromSmiles; quarantine rows that returnNone. Record the original and canonical isomeric SMILES, but do not assume canonicalization solves salt or tautomer policy. - Choose a small, declared feature set as baseline. For RDKit, inspect
rdkit.Chem.Descriptors; for Mordred, the official example usesCalculator(descriptors, ignore_3D=True)andcalc.pandas(mols); MolFeat showsRDKitDescriptors2D()on its site. These are separate alternative branches, not values to concatenate blindly. The examples in this article were not executed. - Export row ID, feature names, package/version, preprocessing policy and failures alongside the matrix. Fit any imputer, scaler or feature selector on training data only, then apply it to validation/test rows. Keep a held-out split chosen before model selection.
import csv
from rdkit import Chem
from rdkit.Chem import Descriptors
rows = [("m1", "CCO"), ("m2", "CC(=O)O")]
with open("rdkit_features.csv", "w", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerow(["id", "smiles", "MolWt", "MolLogP"])
for row_id, smiles in rows:
mol = Chem.MolFromSmiles(smiles)
if mol is None:
raise ValueError(f"Invalid SMILES for {row_id}")
writer.writerow([row_id, smiles, Descriptors.MolWt(mol), Descriptors.MolLogP(mol)])
How to interpret and check the output
Check that every feature row maps to exactly one retained input ID; report rejected structures and non-finite cells. Compare feature names and numerical ranges across reruns with the same versions. Validate predictive usefulness on a predefined split, including a simple baseline; descriptor count alone is not evidence of quality.
Limits and common errors
Mordred may emit missing or error values for unsupported inputs; do not silently coerce these to zero. 2D and 3D features answer different questions. Salts, stereochemistry and replicate molecules can create duplicates or leakage across splits. Review each package and model-weight license separately when deployment matters; an open source code label does not license downstream data.
Related ChemAI Atlas pages
Resources: Molfeat, Mordred, RDKit. Related guide: Building an AI Cheminformatics Workflow with RDKit. Existing Recipe: Chemical Data Cleaning Stack.
Primary sources
- https://molfeat.datamol.io/ (official source; accessed 2026-10-13)
- https://github.com/mordred-descriptor/mordred (official source; accessed 2026-10-13)
- https://www.rdkit.org/docs/GettingStartedInPython.html (official source; accessed 2026-10-13)