torchdrug
PyTorch-native graph neural networks for molecules and proteins. Use when building custom GNN architectures for drug discovery, protein modeling, or knowledge graph reasoning. Best for custom model development, protein property prediction, retrosynthesis. For pre-trained models and diverse featurizers use deepchem; for benchmark datasets use pytdc.
Author
Category
Development ToolsInstall
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
TorchDrug - A PyTorch-Native Graph Neural Network Toolkit for Drug Discovery
Skill Overview
TorchDrug is a comprehensive machine learning toolkit built on PyTorch, dedicated to drug discovery and molecular science research. It provides graph neural networks, pretrained models, and task definitions, supporting property prediction, modeling, inference, and generation for molecules, proteins, and biomedical knowledge graphs.
Use Cases
- Predict ADMET properties such as solubility, toxicity, and activity
- Generate new molecular structures with specific properties
- Plan chemical synthesis routes
- Perform lead optimization and multi-objective drug design
- Predict enzyme functions and subcellular localization from protein sequences
- Predict protein stability and interactions based on 3D structures
- Integrate AlphaFold and ESM structure predictions for downstream analysis
- Predict protein–protein interactions and binding affinities
- Perform link prediction in biomedical knowledge bases such as Hetionet
- Discover drug repositioning opportunities and disease mechanisms
- Predict gene–disease associations
- Multi-hop medical reasoning and knowledge discovery
Core Features
- Provides 20+ molecular datasets (BBBP, HIV, Tox21, QM9, etc.)
- Supports multiple GNN architectures such as GIN, GAT, and SchNet
- Used for drug screening, toxicity detection, and quantum chemical property prediction
- Includes scaffold-splitting strategies to enable realistic real-world performance evaluation
- Supports 15+ protein datasets and multiple models (ESM, ProteinBERT, GearNet)
- Handles protein sequences and 3D structures (PDB files)
- Compatible with structure predictions from AlphaFold and ESM
- Offers a unified interface for sequence models and structure models
- Autoregressive generation and reinforcement-learning-driven GCPN generation
- Supports conditional generation and multi-objective attribute optimization
- Retrosynthesis prediction based on the USPTO-50k dataset
- Provides an end-to-end workflow for reaction-center identification and completion of reaction fragments
Frequently Asked Questions
What is TorchDrug? What is it suitable for?
TorchDrug is a PyTorch-native machine learning toolkit designed for drug discovery and molecular science design. It is mainly used for molecular property prediction, protein modeling, knowledge graph reasoning, molecular generation, and retrosynthesis planning. If you need to build custom graph neural network architectures for drug discovery, protein modeling, or knowledge graph reasoning, TorchDrug is an ideal choice. For pretrained models and diverse featurizers, you can use DeepChem; for benchmark datasets, you can use PyTDC.
What installation environment does TorchDrug require? Which PyTorch versions does it support?
TorchDrug 0.2.1 requires Python 3.7–3.10 and PyTorch 1.8–2.0. Before installing TorchDrug, you need to install PyTorch first, along with torch-scatter and torch-cluster that match your PyTorch and CUDA versions (the specific wheel URLs depend on your PyTorch and CUDA versions). On Apple Silicon, you need to compile scatter/cluster from source; TorchDrug runs only on CPU (MPS is not supported). You can also install via Conda: conda install torchdrug -c milagraph -c conda-forge -c pytorch -c pyg
How does TorchDrug differ from DeepChem? How should I choose?
Both TorchDrug and DeepChem are machine learning toolkits for drug discovery, but they focus on different strengths. TorchDrug is built on PyTorch, making it better suited for custom model development and deep research—especially when you need to build custom GNN architectures, perform protein modeling, or do knowledge graph reasoning. DeepChem provides richer pretrained models and featurizers, making it more suitable for rapid prototyping and standardized workflows. If you focus on benchmark datasets and standard tasks, PyTDC may be a better choice. In short: choose TorchDrug for customized research, and DeepChem for quick applications.