[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6R3RMBB2HGK83FX69385T5W":3,"skill-same:01M6R3RMBB2HGK83FX69385T5W":101},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M6R3RMBB2HGK83FX69385T5W","torchdrug",null,"Graph-based drug discovery toolkit. Molecular property prediction (ADMET), protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis, GNNs (GIN, GAT, SchNet), 40+ datasets, for PyTorch-based ML on molecules, proteins, and biomedical graphs.","Mishit18\u002Fclaude-code-templates","Mishit18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F244127857?v=4","01M6QXBYKWM76HSKYDNWSKKE41","Mishit Sharma","01M6QXBYRJ0CAVM51S1RTEKTZZ",1,"MIT","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"proteins","ADMET","Protein","prediction","for","drug discovery","gin","gat","molecular","modeling","graphs","generation","pytorch","biomedical","datasets","knowledge","discovery","knowledge graph","graph","reasoning","toolkit","ml","2026-11-10 10:12:30",false,"---\nname: torchdrug\ndescription: \"Graph-based drug discovery toolkit. Molecular property prediction (ADMET), protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis, GNNs (GIN, GAT, SchNet), 40+ datasets, for PyTorch-based ML on molecules, proteins, and biomedical graphs.\"\n---\n\n# TorchDrug\n\n## Overview\n\nTorchDrug is a comprehensive PyTorch-based machine learning toolbox for drug discovery and molecular science. Apply graph neural networks, pre-trained models, and task definitions to molecules, proteins, and biological knowledge graphs, including molecular property prediction, protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis planning, with 40+ curated datasets and 20+ model architectures.\n\n## When to Use This Skill\n\nThis skill should be used when working with:\n\n**Data Types:**\n- SMILES strings or molecular structures\n- Protein sequences or 3D structures (PDB files)\n- Chemical reactions and retrosynthesis\n- Biomedical knowledge graphs\n- Drug discovery datasets\n\n**Tasks:**\n- Predicting molecular properties (solubility, toxicity, activity)\n- Protein function or structure prediction\n- Drug-target binding prediction\n- Generating new molecular structures\n- Planning chemical synthesis routes\n- Link prediction in biomedical knowledge bases\n- Training graph neural networks on scientific data\n\n**Libraries and Integration:**\n- TorchDrug is the primary library\n- Often used with RDKit for cheminformatics\n- Compatible with PyTorch and PyTorch Lightning\n- Integrates with AlphaFold and ESM for proteins\n\n## Getting Started\n\n### Installation\n\n```bash\nuv pip install torchdrug\n# Or with optional dependencies\nuv pip install torchdrug[full]\n```\n\n### Quick Example\n\n```python\nfrom torchdrug import datasets, models, tasks\nfrom torch.utils.data import DataLoader\n\n# Load molecular dataset\ndataset = datasets.BBBP(\"~\u002Fmolecule-datasets\u002F\")\ntrain_set, valid_set, test_set = dataset.split()\n\n# Define GNN model\nmodel = models.GIN(\n    input_dim=dataset.node_feature_dim,\n    hidden_dims=[256, 256, 256],\n    edge_input_dim=dataset.edge_feature_dim,\n    batch_norm=True,\n    readout=\"mean\"\n)\n\n# Create property prediction task\ntask = tasks.PropertyPrediction(\n    model,\n    task=dataset.tasks,\n    criterion=\"bce\",\n    metric=[\"auroc\", \"auprc\"]\n)\n\n# Train with PyTorch\noptimizer = torch.optim.Adam(task.parameters(), lr=1e-3)\ntrain_loader = DataLoader(train_set, batch_size=32, shuffle=True)\n\nfor epoch in range(100):\n    for batch in train_loader:\n        loss = task(batch)\n        optimizer.zero_grad()\n        loss.backward()\n        optimizer.step()\n```\n\n## Core Capabilities\n\n### 1. Molecular Property Prediction\n\nPredict chemical, physical, and biological properties of molecules from structure.\n\n**Use Cases:**\n- Drug-likeness and ADMET properties\n- Toxicity screening\n- Quantum chemistry properties\n- Binding affinity prediction\n\n**Key Components:**\n- 20+ molecular datasets (BBBP, HIV, Tox21, QM9, etc.)\n- GNN models (GIN, GAT, SchNet)\n- PropertyPrediction and MultipleBinaryClassification tasks\n\n**Reference:** See `references\u002Fmolecular_property_prediction.md` for:\n- Complete dataset catalog\n- Model selection guide\n- Training workflows and best practices\n- Feature engineering details\n\n### 2. Protein Modeling\n\nWork with protein sequences, structures, and properties.\n\n**Use Cases:**\n- Enzyme function prediction\n- Protein stability and solubility\n- Subcellular localization\n- Protein-protein interactions\n- Structure prediction\n\n**Key Components:**\n- 15+ protein datasets (EnzymeCommission, GeneOntology, PDBBind, etc.)\n- Sequence models (ESM, ProteinBERT, ProteinLSTM)\n- Structure models (GearNet, SchNet)\n- Multiple task types for different prediction levels\n\n**Reference:** See `references\u002Fprotein_modeling.md` for:\n- Protein-specific datasets\n- Sequence vs structure models\n- Pre-training strategies\n- Integration with AlphaFold and ESM\n\n### 3. Knowledge Graph Reasoning\n\nPredict missing links and relationships in biological knowledge graphs.\n\n**Use Cases:**\n- Drug repurposing\n- Disease mechanism discovery\n- Gene-disease associations\n- Multi-hop biomedical reasoning\n\n**Key Components:**\n- General KGs (FB15k, WN18) and biomedical (Hetionet)\n- Embedding models (TransE, RotatE, ComplEx)\n- KnowledgeGraphCompletion task\n\n**Reference:** See `references\u002Fknowledge_graphs.md` for:\n- Knowledge graph datasets (including Hetionet with 45k biomedical entities)\n- Embedding model comparison\n- Evaluation metrics and protocols\n- Biomedical applications\n\n### 4. Molecular Generation\n\nGenerate novel molecular structures with desired properties.\n\n**Use Cases:**\n- De novo drug design\n- Lead optimization\n- Chemical space exploration\n- Property-guided generation\n\n**Key Components:**\n- Autoregressive generation\n- GCPN (policy-based generation)\n- GraphAutoregressiveFlow\n- Property optimization workflows\n\n**Reference:** See `references\u002Fmolecular_generation.md` for:\n- Generation strategies (unconditional, conditional, scaffold-based)\n- Multi-objective optimization\n- Validation and filtering\n- Integration with property prediction\n\n### 5. Retrosynthesis\n\nPredict synthetic routes from target molecules to starting materials.\n\n**Use Cases:**\n- Synthesis planning\n- Route optimization\n- Synthetic accessibility assessment\n- Multi-step planning\n\n**Key Components:**\n- USPTO-50k reaction dataset\n- CenterIdentification (reaction center prediction)\n- SynthonCompletion (reactant prediction)\n- End-to-end Retrosynthesis pipeline\n\n**Reference:** See `references\u002Fretrosynthesis.md` for:\n- Task decomposition (center ID → synthon completion)\n- Multi-step synthesis planning\n- Commercial availability checking\n- Integration with other retrosynthesis tools\n\n### 6. Graph Neural Network Models\n\nComprehensive catalog of GNN architectures for different data types and tasks.\n\n**Available Models:**\n- General GNNs: GCN, GAT, GIN, RGCN, MPNN\n- 3D-aware: SchNet, GearNet\n- Protein-specific: ESM, ProteinBERT, GearNet\n- Knowledge graph: TransE, RotatE, ComplEx, SimplE\n- Generative: GraphAutoregressiveFlow\n\n**Reference:** See `references\u002Fmodels_architectures.md` for:\n- Detailed model descriptions\n- Model selection guide by task and dataset\n- Architecture comparisons\n- Implementation tips\n\n### 7. Datasets\n\n40+ curated datasets spanning chemistry, biology, and knowledge graphs.\n\n**Categories:**\n- Molecular properties (drug discovery, quantum chemistry)\n- Protein properties (function, structure, interactions)\n- Knowledge graphs (general and biomedical)\n- Retrosynthesis reactions\n\n**Reference:** See `references\u002Fdatasets.md` for:\n- Complete dataset catalog with sizes and tasks\n- Dataset selection guide\n- Loading and preprocessing\n- Splitting strategies (random, scaffold)\n\n## Common Workflows\n\n### Workflow 1: Molecular Property Prediction\n\n**Scenario:** Predict blood-brain barrier penetration for drug candidates.\n\n**Steps:**\n1. Load dataset: `datasets.BBBP()`\n2. Choose model: GIN for molecular graphs\n3. Define task: `PropertyPrediction` with binary classification\n4. Train with scaffold split for realistic evaluation\n5. Evaluate using AUROC and AUPRC\n\n**Navigation:** `references\u002Fmolecular_property_prediction.md` → Dataset selection → Model selection → Training\n\n### Workflow 2: Protein Function Prediction\n\n**Scenario:** Predict enzyme function from sequence.\n\n**Steps:**\n1. Load dataset: `datasets.EnzymeCommission()`\n2. Choose model: ESM (pre-trained) or GearNet (with structure)\n3. Define task: `PropertyPrediction` with multi-class classification\n4. Fine-tune pre-trained model or train from scratch\n5. Evaluate using accuracy and per-class metrics\n\n**Navigation:** `references\u002Fprotein_modeling.md` → Model selection (sequence vs structure) → Pre-training strategies\n\n### Workflow 3: Drug Repurposing via Knowledge Graphs\n\n**Scenario:** Find new disease treatments in Hetionet.\n\n**Steps:**\n1. Load dataset: `datasets.Hetionet()`\n2. Choose model: RotatE or ComplEx\n3. Define task: `KnowledgeGraphCompletion`\n4. Train with negative sampling\n5. Query for \"Compound-treats-Disease\" predictions\n6. Filter by plausibility and mechanism\n\n**Navigation:** `references\u002Fknowledge_graphs.md` → Hetionet dataset → Model selection → Biomedical applications\n\n### Workflow 4: De Novo Molecule Generation\n\n**Scenario:** Generate drug-like molecules optimized for target binding.\n\n**Steps:**\n1. Train property predictor on activity data\n2. Choose generation approach: GCPN for RL-based optimization\n3. Define reward function combining affinity, drug-likeness, synthesizability\n4. Generate candidates with property constraints\n5. Validate chemistry and filter by drug-likeness\n6. Rank by multi-objective scoring\n\n**Navigation:** `references\u002Fmolecular_generation.md` → Conditional generation → Multi-objective optimization\n\n### Workflow 5: Retrosynthesis Planning\n\n**Scenario:** Plan synthesis route for target molecule.\n\n**Steps:**\n1. Load dataset: `datasets.USPTO50k()`\n2. Train center identification model (RGCN)\n3. Train synthon completion model (GIN)\n4. Combine into end-to-end retrosynthesis pipeline\n5. Apply recursively for multi-step planning\n6. Check commercial availability of building blocks\n\n**Navigation:** `references\u002Fretrosynthesis.md` → Task types → Multi-step planning\n\n## Integration Patterns\n\n### With RDKit\n\nConvert between TorchDrug molecules and RDKit:\n```python\nfrom torchdrug import data\nfrom rdkit import Chem\n\n# SMILES → TorchDrug molecule\nsmiles = \"CCO\"\nmol = data.Molecule.from_smiles(smiles)\n\n# TorchDrug → RDKit\nrdkit_mol = mol.to_molecule()\n\n# RDKit → TorchDrug\nrdkit_mol = Chem.MolFromSmiles(smiles)\nmol = data.Molecule.from_molecule(rdkit_mol)\n```\n\n### With AlphaFold\u002FESM\n\nUse predicted structures:\n```python\nfrom torchdrug import data\n\n# Load AlphaFold predicted structure\nprotein = data.Protein.from_pdb(\"AF-P12345-F1-model_v4.pdb\")\n\n# Build graph with spatial edges\ngraph = protein.residue_graph(\n    node_position=\"ca\",\n    edge_types=[\"sequential\", \"radius\"],\n    radius_cutoff=10.0\n)\n```\n\n### With PyTorch Lightning\n\nWrap tasks for Lightning training:\n```python\nimport pytorch_lightning as pl\n\nclass LightningTask(pl.LightningModule):\n    def __init__(self, torchdrug_task):\n        super().__init__()\n        self.task = torchdrug_task\n\n    def training_step(self, batch, batch_idx):\n        return self.task(batch)\n\n    def validation_step(self, batch, batch_idx):\n        pred = self.task.predict(batch)\n        target = self.task.target(batch)\n        return {\"pred\": pred, \"target\": target}\n\n    def configure_optimizers(self):\n        return torch.optim.Adam(self.parameters(), lr=1e-3)\n```\n\n## Technical Details\n\nFor deep dives into TorchDrug's architecture:\n\n**Core Concepts:** See `references\u002Fcore_concepts.md` for:\n- Architecture philosophy (modular, configurable)\n- Data structures (Graph, Molecule, Protein, PackedGraph)\n- Model interface and forward function signature\n- Task interface (predict, target, forward, evaluate)\n- Training workflows and best practices\n- Loss functions and metrics\n- Common pitfalls and debugging\n\n## Quick Reference Cheat Sheet\n\n**Choose Dataset:**\n- Molecular property → `references\u002Fdatasets.md` → Molecular section\n- Protein task → `references\u002Fdatasets.md` → Protein section\n- Knowledge graph → `references\u002Fdatasets.md` → Knowledge graph section\n\n**Choose Model:**\n- Molecules → `references\u002Fmodels_architectures.md` → GNN section → GIN\u002FGAT\u002FSchNet\n- Proteins (sequence) → `references\u002Fmodels_architectures.md` → Protein section → ESM\n- Proteins (structure) → `references\u002Fmodels_architectures.md` → Protein section → GearNet\n- Knowledge graph → `references\u002Fmodels_architectures.md` → KG section → RotatE\u002FComplEx\n\n**Common Tasks:**\n- Property prediction → `references\u002Fmolecular_property_prediction.md` or `references\u002Fprotein_modeling.md`\n- Generation → `references\u002Fmolecular_generation.md`\n- Retrosynthesis → `references\u002Fretrosynthesis.md`\n- KG reasoning → `references\u002Fknowledge_graphs.md`\n\n**Understand Architecture:**\n- Data structures → `references\u002Fcore_concepts.md` → Data Structures\n- Model design → `references\u002Fcore_concepts.md` → Model Interface\n- Task design → `references\u002Fcore_concepts.md` → Task Interface\n\n## Troubleshooting Common Issues\n\n**Issue: Dimension mismatch errors**\n→ Check `model.input_dim` matches `dataset.node_feature_dim`\n→ See `references\u002Fcore_concepts.md` → Essential Attributes\n\n**Issue: Poor performance on molecular tasks**\n→ Use scaffold splitting, not random\n→ Try GIN instead of GCN\n→ See `references\u002Fmolecular_property_prediction.md` → Best Practices\n\n**Issue: Protein model not learning**\n→ Use pre-trained ESM for sequence tasks\n→ Check edge construction for structure models\n→ See `references\u002Fprotein_modeling.md` → Training Workflows\n\n**Issue: Memory errors with large graphs**\n→ Reduce batch size\n→ Use gradient accumulation\n→ See `references\u002Fcore_concepts.md` → Memory Efficiency\n\n**Issue: Generated molecules are invalid**\n→ Add validity constraints\n→ Post-process with RDKit validation\n→ See `references\u002Fmolecular_generation.md` → Validation and Filtering\n\n## Resources\n\n**Official Documentation:** https:\u002F\u002Ftorchdrug.ai\u002Fdocs\u002F\n**GitHub:** https:\u002F\u002Fgithub.com\u002FDeepGraphLearning\u002Ftorchdrug\n**Paper:** TorchDrug: A Powerful and Flexible Machine Learning Platform for Drug Discovery\n\n## Summary\n\nNavigate to the appropriate reference file based on your task:\n\n1. **Molecular property prediction** → `molecular_property_prediction.md`\n2. **Protein modeling** → `protein_modeling.md`\n3. **Knowledge graphs** → `knowledge_graphs.md`\n4. **Molecular generation** → `molecular_generation.md`\n5. **Retrosynthesis** → `retrosynthesis.md`\n6. **Model selection** → `models_architectures.md`\n7. **Dataset selection** → `datasets.md`\n8. **Technical details** → `core_concepts.md`\n\nEach reference provides comprehensive coverage of its domain with examples, best practices, and common use cases.\n\n","# TorchDrug\n\n## Overview\n\nTorchDrug is a comprehensive PyTorch-based machine learning toolbox for drug discovery and molecular science. Apply graph neural networks, pre-trained models, and task definitions to molecules, proteins, and biological knowledge graphs, including molecular property prediction, protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis planning, with 40+ curated datasets and 20+ model architectures.\n\n## When to Use This Skill\n\nThis skill should be used when working with:\n\n**Data Types:**\n- SMILES strings or molecular structures\n- Protein sequences or 3D structures (PDB files)\n- Chemical reactions and retrosynthesis\n- Biomedical knowledge graphs\n- Drug discovery datasets\n\n**Tasks:**\n- Predicting molecular properties (solubility, toxicity, activity)\n- Protein function or structure prediction\n- Drug-target binding prediction\n- Generating new molecular structures\n- Planning chemical synthesis routes\n- Link prediction in biomedical knowledge bases\n- Training graph neural networks on scientific data\n\n**Libraries and Integration:**\n- TorchDrug is the primary library\n- Often used with RDKit for cheminformatics\n- Compatible with PyTorch and PyTorch Lightning\n- Integrates with AlphaFold and ESM for proteins\n\n## Getting Started\n\n### Installation\n\n```bash\nuv pip install torchdrug\n# Or with optional dependencies\nuv pip install torchdrug[full]\n```\n\n### Quick Example\n\n```python\nfrom torchdrug import datasets, models, tasks\nfrom torch.utils.data import DataLoader\n\n# Load molecular dataset\ndataset = datasets.BBBP(\"~\u002Fmolecule-datasets\u002F\")\ntrain_set, valid_set, test_set = dataset.split()\n\n# Define GNN model\nmodel = models.GIN(\n    input_dim=dataset.node_feature_dim,\n    hidden_dims=[256, 256, 256],\n    edge_input_dim=dataset.edge_feature_dim,\n    batch_norm=True,\n    readout=\"mean\"\n)\n\n# Create property prediction task\ntask = tasks.PropertyPrediction(\n    model,\n    task=dataset.tasks,\n    criterion=\"bce\",\n    metric=[\"auroc\", \"auprc\"]\n)\n\n# Train with PyTorch\noptimizer = torch.optim.Adam(task.parameters(), lr=1e-3)\ntrain_loader = DataLoader(train_set, batch_size=32, shuffle=True)\n\nfor epoch in range(100):\n    for batch in train_loader:\n        loss = task(batch)\n        optimizer.zero_grad()\n        loss.backward()\n        optimizer.step()\n```\n\n## Core Capabilities\n\n### 1. Molecular Property Prediction\n\nPredict chemical, physical, and biological properties of molecules from structure.\n\n**Use Cases:**\n- Drug-likeness and ADMET properties\n- Toxicity screening\n- Quantum chemistry properties\n- Binding affinity prediction\n\n**Key Components:**\n- 20+ molecular datasets (BBBP, HIV, Tox21, QM9, etc.)\n- GNN models (GIN, GAT, SchNet)\n- PropertyPrediction and MultipleBinaryClassification tasks\n\n**Reference:** See `references\u002Fmolecular_property_prediction.md` for:\n- Complete dataset catalog\n- Model selection guide\n- Training workflows and best practices\n- Feature engineering details\n\n### 2. Protein Modeling\n\nWork with protein sequences, structures, and properties.\n\n**Use Cases:**\n- Enzyme function prediction\n- Protein stability and solubility\n- Subcellular localization\n- Protein-protein interactions\n- Structure prediction\n\n**Key Components:**\n- 15+ protein datasets (EnzymeCommission, GeneOntology, PDBBind, etc.)\n- Sequence models (ESM, ProteinBERT, ProteinLSTM)\n- Structure models (GearNet, SchNet)\n- Multiple task types for different prediction levels\n\n**Reference:** See `references\u002Fprotein_modeling.md` for:\n- Protein-specific datasets\n- Sequence vs structure models\n- Pre-training strategies\n- Integration with AlphaFold and ESM\n\n### 3. Knowledge Graph Reasoning\n\nPredict missing links and relationships in biological knowledge graphs.\n\n**Use Cases:**\n- Drug repurposing\n- Disease mechanism discovery\n- Gene-disease associations\n- Multi-hop biomedical reasoning\n\n**Key Components:**\n- General KGs (FB15k, WN18) and biomedical (Hetionet)\n- Embedding models (TransE, RotatE, ComplEx)\n- KnowledgeGraphCompletion task\n\n**Reference:** See `references\u002Fknowledge_graphs.md` for:\n- Knowledge graph datasets (including Hetionet with 45k biomedical entities)\n- Embedding model comparison\n- Evaluation metrics and protocols\n- Biomedical applications\n\n### 4. Molecular Generation\n\nGenerate novel molecular structures with desired properties.\n\n**Use Cases:**\n- De novo drug design\n- Lead optimization\n- Chemical space exploration\n- Property-guided generation\n\n**Key Components:**\n- Autoregressive generation\n- GCPN (policy-based generation)\n- GraphAutoregressiveFlow\n- Property optimization workflows\n\n**Reference:** See `references\u002Fmolecular_generation.md` for:\n- Generation strategies (unconditional, conditional, scaffold-based)\n- Multi-objective optimization\n- Validation and filtering\n- Integration with property prediction\n\n### 5. Retrosynthesis\n\nPredict synthetic routes from target molecules to starting materials.\n\n**Use Cases:**\n- Synthesis planning\n- Route optimization\n- Synthetic accessibility assessment\n- Multi-step planning\n\n**Key Components:**\n- USPTO-50k reaction dataset\n- CenterIdentification (reaction center prediction)\n- SynthonCompletion (reactant prediction)\n- End-to-end Retrosynthesis pipeline\n\n**Reference:** See `references\u002Fretrosynthesis.md` for:\n- Task decomposition (center ID → synthon completion)\n- Multi-step synthesis planning\n- Commercial availability checking\n- Integration with other retrosynthesis tools\n\n### 6. Graph Neural Network Models\n\nComprehensive catalog of GNN architectures for different data types and tasks.\n\n**Available Models:**\n- General GNNs: GCN, GAT, GIN, RGCN, MPNN\n- 3D-aware: SchNet, GearNet\n- Protein-specific: ESM, ProteinBERT, GearNet\n- Knowledge graph: TransE, RotatE, ComplEx, SimplE\n- Generative: GraphAutoregressiveFlow\n\n**Reference:** See `references\u002Fmodels_architectures.md` for:\n- Detailed model descriptions\n- Model selection guide by task and dataset\n- Architecture comparisons\n- Implementation tips\n\n### 7. Datasets\n\n40+ curated datasets spanning chemistry, biology, and knowledge graphs.\n\n**Categories:**\n- Molecular properties (drug discovery, quantum chemistry)\n- Protein properties (function, structure, interactions)\n- Knowledge graphs (general and biomedical)\n- Retrosynthesis reactions\n\n**Reference:** See `references\u002Fdatasets.md` for:\n- Complete dataset catalog with sizes and tasks\n- Dataset selection guide\n- Loading and preprocessing\n- Splitting strategies (random, scaffold)\n\n## Common Workflows\n\n### Workflow 1: Molecular Property Prediction\n\n**Scenario:** Predict blood-brain barrier penetration for drug candidates.\n\n**Steps:**\n1. Load dataset: `datasets.BBBP()`\n2. Choose model: GIN for molecular graphs\n3. Define task: `PropertyPrediction` with binary classification\n4. Train with scaffold split for realistic evaluation\n5. Evaluate using AUROC and AUPRC\n\n**Navigation:** `references\u002Fmolecular_property_prediction.md` → Dataset selection → Model selection → Training\n\n### Workflow 2: Protein Function Prediction\n\n**Scenario:** Predict enzyme function from sequence.\n\n**Steps:**\n1. Load dataset: `datasets.EnzymeCommission()`\n2. Choose model: ESM (pre-trained) or GearNet (with structure)\n3. Define task: `PropertyPrediction` with multi-class classification\n4. Fine-tune pre-trained model or train from scratch\n5. Evaluate using accuracy and per-class metrics\n\n**Navigation:** `references\u002Fprotein_modeling.md` → Model selection (sequence vs structure) → Pre-training strategies\n\n### Workflow 3: Drug Repurposing via Knowledge Graphs\n\n**Scenario:** Find new disease treatments in Hetionet.\n\n**Steps:**\n1. Load dataset: `datasets.Hetionet()`\n2. Choose model: RotatE or ComplEx\n3. Define task: `KnowledgeGraphCompletion`\n4. Train with negative sampling\n5. Query for \"Compound-treats-Disease\" predictions\n6. Filter by plausibility and mechanism\n\n**Navigation:** `references\u002Fknowledge_graphs.md` → Hetionet dataset → Model selection → Biomedical applications\n\n### Workflow 4: De Novo Molecule Generation\n\n**Scenario:** Generate drug-like molecules optimized for target binding.\n\n**Steps:**\n1. Train property predictor on activity data\n2. Choose generation approach: GCPN for RL-based optimization\n3. Define reward function combining affinity, drug-likeness, synthesizability\n4. Generate candidates with property constraints\n5. Validate chemistry and filter by drug-likeness\n6. Rank by multi-objective scoring\n\n**Navigation:** `references\u002Fmolecular_generation.md` → Conditional generation → Multi-objective optimization\n\n### Workflow 5: Retrosynthesis Planning\n\n**Scenario:** Plan synthesis route for target molecule.\n\n**Steps:**\n1. Load dataset: `datasets.USPTO50k()`\n2. Train center identification model (RGCN)\n3. Train synthon completion model (GIN)\n4. Combine into end-to-end retrosynthesis pipeline\n5. Apply recursively for multi-step planning\n6. Check commercial availability of building blocks\n\n**Navigation:** `references\u002Fretrosynthesis.md` → Task types → Multi-step planning\n\n## Integration Patterns\n\n### With RDKit\n\nConvert between TorchDrug molecules and RDKit:\n```python\nfrom torchdrug import data\nfrom rdkit import Chem\n\n# SMILES → TorchDrug molecule\nsmiles = \"CCO\"\nmol = data.Molecule.from_smiles(smiles)\n\n# TorchDrug → RDKit\nrdkit_mol = mol.to_molecule()\n\n# RDKit → TorchDrug\nrdkit_mol = Chem.MolFromSmiles(smiles)\nmol = data.Molecule.from_molecule(rdkit_mol)\n```\n\n### With AlphaFold\u002FESM\n\nUse predicted structures:\n```python\nfrom torchdrug import data\n\n# Load AlphaFold predicted structure\nprotein = data.Protein.from_pdb(\"AF-P12345-F1-model_v4.pdb\")\n\n# Build graph with spatial edges\ngraph = protein.residue_graph(\n    node_position=\"ca\",\n    edge_types=[\"sequential\", \"radius\"],\n    radius_cutoff=10.0\n)\n```\n\n### With PyTorch Lightning\n\nWrap tasks for Lightning training:\n```python\nimport pytorch_lightning as pl\n\nclass LightningTask(pl.LightningModule):\n    def __init__(self, torchdrug_task):\n        super().__init__()\n        self.task = torchdrug_task\n\n    def training_step(self, batch, batch_idx):\n        return self.task(batch)\n\n    def validation_step(self, batch, batch_idx):\n        pred = self.task.predict(batch)\n        target = self.task.target(batch)\n        return {\"pred\": pred, \"target\": target}\n\n    def configure_optimizers(self):\n        return torch.optim.Adam(self.parameters(), lr=1e-3)\n```\n\n## Technical Details\n\nFor deep dives into TorchDrug's architecture:\n\n**Core Concepts:** See `references\u002Fcore_concepts.md` for:\n- Architecture philosophy (modular, configurable)\n- Data structures (Graph, Molecule, Protein, PackedGraph)\n- Model interface and forward function signature\n- Task interface (predict, target, forward, evaluate)\n- Training workflows and best practices\n- Loss functions and metrics\n- Common pitfalls and debugging\n\n## Quick Reference Cheat Sheet\n\n**Choose Dataset:**\n- Molecular property → `references\u002Fdatasets.md` → Molecular section\n- Protein task → `references\u002Fdatasets.md` → Protein section\n- Knowledge graph → `references\u002Fdatasets.md` → Knowledge graph section\n\n**Choose Model:**\n- Molecules → `references\u002Fmodels_architectures.md` → GNN section → GIN\u002FGAT\u002FSchNet\n- Proteins (sequence) → `references\u002Fmodels_architectures.md` → Protein section → ESM\n- Proteins (structure) → `references\u002Fmodels_architectures.md` → Protein section → GearNet\n- Knowledge graph → `references\u002Fmodels_architectures.md` → KG section → RotatE\u002FComplEx\n\n**Common Tasks:**\n- Property prediction → `references\u002Fmolecular_property_prediction.md` or `references\u002Fprotein_modeling.md`\n- Generation → `references\u002Fmolecular_generation.md`\n- Retrosynthesis → `references\u002Fretrosynthesis.md`\n- KG reasoning → `references\u002Fknowledge_graphs.md`\n\n**Understand Architecture:**\n- Data structures → `references\u002Fcore_concepts.md` → Data Structures\n- Model design → `references\u002Fcore_concepts.md` → Model Interface\n- Task design → `references\u002Fcore_concepts.md` → Task Interface\n\n## Troubleshooting Common Issues\n\n**Issue: Dimension mismatch errors**\n→ Check `model.input_dim` matches `dataset.node_feature_dim`\n→ See `references\u002Fcore_concepts.md` → Essential Attributes\n\n**Issue: Poor performance on molecular tasks**\n→ Use scaffold splitting, not random\n→ Try GIN instead of GCN\n→ See `references\u002Fmolecular_property_prediction.md` → Best Practices\n\n**Issue: Protein model not learning**\n→ Use pre-trained ESM for sequence tasks\n→ Check edge construction for structure models\n→ See `references\u002Fprotein_modeling.md` → Training Workflows\n\n**Issue: Memory errors with large graphs**\n→ Reduce batch size\n→ Use gradient accumulation\n→ See `references\u002Fcore_concepts.md` → Memory Efficiency\n\n**Issue: Generated molecules are invalid**\n→ Add validity constraints\n→ Post-process with RDKit validation\n→ See `references\u002Fmolecular_generation.md` → Validation and Filtering\n\n## Resources\n\n**Official Documentation:** https:\u002F\u002Ftorchdrug.ai\u002Fdocs\u002F\n**GitHub:** https:\u002F\u002Fgithub.com\u002FDeepGraphLearning\u002Ftorchdrug\n**Paper:** TorchDrug: A Powerful and Flexible Machine Learning Platform for Drug Discovery\n\n## Summary\n\nNavigate to the appropriate reference file based on your task:\n\n1. **Molecular property prediction** → `molecular_property_prediction.md`\n2. **Protein modeling** → `protein_modeling.md`\n3. **Knowledge graphs** → `knowledge_graphs.md`\n4. **Molecular generation** → `molecular_generation.md`\n5. **Retrosynthesis** → `retrosynthesis.md`\n6. **Model selection** → `models_architectures.md`\n7. **Dataset selection** → `datasets.md`\n8. **Technical details** → `core_concepts.md`\n\nEach reference provides comprehensive coverage of its domain with examples, best practices, and common use cases.\n\n",{"name":5,"description":7},"main","015422534a7457348a313b6381f0255d3364eb8c","cli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug",0,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates","https:\u002F\u002Fgithub.com\u002FMishit18","2026-11-13 18:15:57",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Mishit18\u002Fclaude-code-templates --skill torchdrug",{"tool":59,"command":60},"bunx","bunx skills add Mishit18\u002Fclaude-code-templates --skill torchdrug",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Mishit18\u002Fclaude-code-templates --skill torchdrug","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002FSKILL.md",true,[67,73,77,81,85,89,93,97],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fcore_concepts.md","REFERENCE","参考文档",14395,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fcore_concepts.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fdatasets.md",10952,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fdatasets.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fknowledge_graphs.md",8481,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fknowledge_graphs.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fmodels_architectures.md",13695,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmodels_architectures.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fmolecular_generation.md",10075,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmolecular_generation.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fmolecular_property_prediction.md",5668,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmolecular_property_prediction.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fprotein_modeling.md",7738,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fprotein_modeling.md",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fretrosynthesis.md",11538,"https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fretrosynthesis.md",[102,135,160,188,214,239],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":115,"publishedAt":41},"01M6R4ARN4W2VZRDERDTMN1KP0","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[110],{"categoryNo":111,"categoryName":112,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,23,134],"web artifacts builder","web","artifacts","artifacts builder","builder","frontend","css","components","react","routing","state management","state","file","Tailwind","use","single-file","ui components","multi","single",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":139,"sourceHtmlUrl":140,"categories":141,"keywords":146,"publishedAt":41},"01M6R45GXREM5DP8T08MAC788H","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[142,145],{"categoryNo":143,"categoryName":144,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":111,"categoryName":112,"taxonomyType":113,"taxonomyTypeDesc":114},[147,148,149,121,150,151,117,152,39,153,154,155,156,157,158,159,23],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","ui","logs","applications","behavior","local","with",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":164,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":41},"01M6R2GYJ470X8EB7R58V0B68K","think-tank","Run a Virtual Think Tank — a structured multi-persona debate — before planning or making architectural\u002Fdesign\u002Fstrategic decisions. Use this skill whenever the user is about to plan a system, make a technology choice, evaluate trade-offs, decide on an approach, or faces any decision where multiple perspectives would sharpen the outcome. Also trigger when the user says \"think tank\", \"debate this\", \"perspectives on\", \"trade-offs\", \"should I use X or Y\", \"help me decide\", \"before we plan\", or asks for pros\u002Fcons of competing approaches. This skill should run BEFORE any implementation planning begins — it produces a structured analysis that feeds into better plans.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fthink-tank\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fthink-tank\u002FSKILL.md",[],[168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],"think tank","think","design","run","feeds","analysis","persona","plan","sharpen","virtual","decision","choice","decide","perspectives","outcome","me","debate","make","trade-offs","when",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":192,"sourceHtmlUrl":193,"categories":194,"keywords":198,"publishedAt":41},"01M6R2FSR55AVRFA9YZ8SC2GZG","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[195],{"categoryNo":196,"categoryName":197,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000023","Skill与智能体开发",[199,200,201,202,203,204,34,205,206,207,208,209,210,211,159,23,212,187,213],"skill creator","creator","workflows","create","update","capabilities","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":218,"categories":219,"keywords":220,"publishedAt":41},"01M6R2FK42ZZ4HJTJVVK9WJBBP","ship-learn-next","Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fship-learn-next\u002FSKILL.md",[],[221,222,223,224,225,226,227,228,130,229,230,231,232,233,234,235,236,237,238,187],"learn","ship learn next","ship","next","framework","learning","read","write","advice","implementation","youtube","plans","quest","transform","actionable","action","lessons","youtube transcripts",{"skillNo":240,"name":241,"nameZh":6,"description":242,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":243,"sourceHtmlUrl":244,"categories":245,"keywords":252,"publishedAt":41},"01M6R2088G1RHDA5MDX16HASRB","slack-gif-creator","Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like \"make me a GIF of X doing Y for Slack.\"","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FMishit18\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FSKILL.md",[246,249],{"categoryNo":247,"categoryName":248,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":250,"categoryName":251,"taxonomyType":113,"taxonomyTypeDesc":114},"01JBSEEDCAT000000000000016","图像与多媒体",[253,254,255,200,256,257,258,259,34,130,183,211,185,260,261,23,262,187],"slack gif creator","slack","gif","validation","Tools","constraints","Animation","Utilities","concepts","request"]