molfeat
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
Author
Category
Development ToolsInstall
Hot:7
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-molfeat&locale=en&source=copy
Molfeat - A Unified Molecular Featurization Platform
Skills Overview
Molfeat is a comprehensive Python molecular featurization library that integrates 100+ pretrained embeddings and handcrafted featurizers. It supports converting chemical structures (SMILES strings or RDKit molecule objects) into numerical representations usable by machine learning. It is suitable for QSAR modeling, virtual screening, similarity search, and deep learning applications.
Use Cases
1. Machine Learning Modeling in Drug Discovery
When you need to build QSAR/QSPR models to predict compound activity, toxicity, or physicochemical properties, molfeat can convert SMILES strings into feature vectors usable by models. It supports the molecular fingerprints and descriptors needed for traditional machine learning (random forests, SVM, XGBoost), as well as pretrained embeddings required for deep learning (ChemBERTa, ChemGPT) and graph neural network features.
2. Virtual Screening for Large-Scale Compound Libraries
When you need to predict activity or rank priorities for hundreds of thousands or even millions of compounds, molfeat offers parallel processing capabilities (
n_jobs=-1 automatically uses all CPU cores), batch processing, and feature caching. It can efficiently compute fingerprint features such as ECFP and MACCS, and combine them with scikit-learn classifiers to enable fast virtual screening workflows.3. Chemical Space Analysis and Similarity Search
When you need to perform compound clustering, visualization, dimensionality reduction, or find structurally similar molecules, molfeat provides multiple similarity metrics (ECFP, MACCS, MAP4 for 2D similarity; USR/USRCAT for 3D shape similarity). It supports cosine similarity computation and efficient batch feature extraction, helping you understand the distribution of chemical space and conduct scaffold-hopping research.
Core Features
1. 100+ Unified Featurization Interfaces
Provides a unified calling interface for everything from traditional molecular fingerprints (ECFP, FCFP, MACCS, MAP4, etc.) and descriptors (RDKit 2D, Mordred 1800+ descriptors, CATS pharmacophore descriptors) to modern deep learning embeddings (Transformer models such as ChemBERTa, ChemGPT, MolT5; GNN models such as GIN, Graphormer). All featurizers share a consistent API design, reducing the learning curve.
2. Batch Processing Compatible with scikit-learn
The
MoleculeTransformer class provides a transformer interface compatible with scikit-learn pipelines. It supports automatic parallel processing (n_jobs=-1), ignoring errors (ignore_errors=True), persistent configuration (save/load YAML configuration files), and memory caching. You can directly integrate it into machine learning pipelines for an end-to-end workflow from SMILES to prediction.3. Pretrained Models and Efficient Inference
Includes pretrained Transformer models such as ChemBERTa-77M-MLM and ChemGPT-1.2B, as well as graph neural networks such as GIN and Graphormer. It provides in-memory caching and batch inference optimizations. After the first run, the models remain in memory to significantly speed up subsequent inference. It supports using
ModelStore to explore all available models and get usage examples.Frequently Asked Questions
Which Python versions does molfeat support?
molfeat 0.11.0 supports Python 3.9–3.10 and does not support Python 3.11+. It is recommended to use a Python 3.9 or 3.10 environment. Install it with
uv pip install "molfeat==0.11.0". If you need GNN or Transformer models, install the corresponding extra dependencies: molfeat[dgl], molfeat[transformer], or molfeat[all].How do I handle invalid SMILES strings?
When working with datasets that may contain invalid SMILES, set
ignore_errors=True so the featurizer skips invalid molecules and continues processing, returning None as the features for failed molecules. It is recommended to use verbose=True to record error details for easier later data cleaning. For large datasets, you can also implement custom preprocessing methods for molecule standardization and salt removal.How do I choose the right featurization method for my task?
For traditional machine learning (random forests, SVM), start with ECFP fingerprints (strong generality). If you need interpretability, choose RDKit 2D descriptors or MACCS fingerprints. For large-scale screening, MAP4 fingerprints are more efficient. For deep learning tasks, ChemBERTa is suitable for transfer learning, while GIN models are well suited for graph-structured data. You can browse all available options via
ModelStore().available_models, or use FeatConcat to combine multiple features to improve model performance.