Install any skill in seconds. Free to start, no credit card required.
Get Started Free →TorchDrug is a PyTorch framework for molecular graph learning, property prediction, retrosynthesis, DTI, and generative drug design.
Use this skill ↓41% 82%+41 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 9 of 22 without it.
I have a SMILES string 'c1ccccc1' representing benzene. How do I construct a TorchDrug Molecule object that stores both atom and bond graph features?
Calls data.Molecule.from_smiles with node_feature='default'
3 of 3 safety checks passed
TorchDrug is a comprehensive machine learning framework for drug discovery built on PyTorch. It provides graph-based molecular representations (atoms as nodes, bonds as edges), a library of graph neural network (GNN) architectures, benchmark datasets, and pretrained models for tasks including molecular property prediction, drug-target interaction, retrosynthesis, and generative molecular design. TorchDrug integrates with PyTorch Lightning and standard ML tooling, making it accessible to both computational chemists and ML practitioners.
torchdrug, torch, torch-geometric, rdkitpip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu118
pip install torch-geometric
pip install torchdrug
pip install rdkit
import torch
from torchdrug import data, datasets, models, tasks, core
# Load a benchmark dataset and train a GNN for property prediction
dataset = datasets.BBBP("~/data/bbbp", node_feature="default", edge_feature="default")
print(f"Dataset: {len(dataset)} molecules, task: BBBP (blood-brain barrier penetration)")
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.