Skip to content
Back to skills

Torchdrug

ASecurity

"Route TorchDrug graph learning, drug discovery, molecular ML,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
toolspythongobashnodegcpapidocumentation

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill torchdrug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Torchdrug?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Torchdrug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-torchdrug/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-torchdrug)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: torchdrug
description: "Route TorchDrug graph learning, drug discovery, molecular ML,
  protein, knowledge graph, data, model, and training engine workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# TorchDrug

Use this repo skill when a task involves TorchDrug, TorchProtein, graph neural networks for drug discovery, molecular property prediction, molecular generation, retrosynthesis, protein workflows, knowledge graph completion, or TorchDrug's `core.Engine` training stack.

## Start Here

- Read [references/repo-provenance.md](references/repo-provenance.md) before deciding whether this skill is current for a TorchDrug checkout or package version.
- Read [references/troubleshooting.md](references/troubleshooting.md) for install/import, PyTorch/PyG compiled packages, RDKit, data downloads, GPU, `mps`, and package-version pitfalls.
- Run `python scripts/check_torchdrug_env.py` in the user's TorchDrug environment for a no-download import and capability check.

## Install And Verify

TorchDrug 0.2.1 supports Python `>=3.7,<3.11` and PyTorch `>=1.8.0`. Prefer a fresh environment with Python 3.10 or earlier:

```bash
python -m pip install torchdrug
python - <<'PY'
import torchdrug
from torchdrug import data
print(torchdrug.__version__)
graph = data.Graph([[0, 1], [1, 0]], num_node=2)
print(graph.num_node, graph.num_edge)
PY
```

When installing from pip, install PyTorch first, then choose `torch-scatter` and `torch-cluster` wheels that match the PyTorch and CUDA/CPU build. Conda users can prefer the documented conda channels because they solve PyTorch, PyG, RDKit, and compiled packages together.

## Route By Task

| User task | Read |
| --- | --- |
| Graph, molecule, protein, dataset, SMILES, sequence, packing, masking, splitting, collator, or data validation tasks | [sub-skills/graph-data/SKILL.md](sub-skills/graph-data/SKILL.md) |
| Choosing or customizing graph layers, representation models, readouts, samplers, variadic tensor utilities, or `MessagePassingBase` subclasses | [sub-skills/layers-and-extensions/SKILL.md](sub-skills/layers-and-extensions/SKILL.md) |
| Building `core.Engine` loops, checkpointing, config serialization, logging, CPU/GPU settings, task contracts, or training harnesses | [sub-skills/training-engine/SKILL.md](sub-skills/training-engine/SKILL.md) |
| Molecular property prediction, molecular pretraining, generation with GCPN/GraphAF, or USPTO50k retrosynthesis | [sub-skills/molecular-workflows/SKILL.md](sub-skills/molecular-workflows/SKILL.md) |
| Knowledge graph triples, FB15k/WN18/YAGO/Hetionet, TransE/RotatE/NeuralLP/KBGAT, negative sampling, or filtered ranking | [sub-skills/knowledge-graphs/SKILL.md](sub-skills/knowledge-graphs/SKILL.md) |
| Protein sequences/structures, contact prediction, GearNet, ESM, protein property/function, or protein-protein interaction workflows | [sub-skills/protein-workflows/SKILL.md](sub-skills/protein-workflows/SKILL.md) |

## Common Workflows

- For a tiny in-memory smoke test, route to `graph-data` and run its `scripts/smoke_graph_data.py` helper.
- For a new molecular prediction project, combine `graph-data` for the molecule dataset, `molecular-workflows` for task/model choices, and `training-engine` for `core.Engine` save/load.
- For custom graph neural layers, use `layers-and-extensions` first, then return to `training-engine` to wire the module into a task.
- For protein GearNet or ESM tasks, use `protein-workflows` for data/model/task choices and `layers-and-extensions` only for graph construction internals.
- For knowledge graph reasoning, use `knowledge-graphs` for model/task/dataset decisions and `training-engine` for optimizer, evaluation, and checkpoint details.

## Safety Boundaries

- Do not run dataset downloads, long training, retrosynthesis generation, benchmark sweeps, or ESM weight downloads unless the user allows network, storage, and compute cost.
- Do not assume `gpus=[0]` is valid. Use `gpus=None` for CPU-only work and check `torch.cuda.is_available()` before GPU examples.
- Do not use Apple `mps`; TorchDrug documentation says Apple silicon can run on CPU but `mps` is unsupported.
- Do not tell users to open original TorchDrug docs, tests, or examples as runtime requirements. This skill bundles the needed routes, references, and safe helpers.

## Repository Scope

This skill covers public TorchDrug package usage and repo-derived workflows: source APIs under `torchdrug/`, install metadata, Sphinx docs, tutorials, benchmarks, and representative tests. It intentionally does not cover maintainer release automation, full benchmark reproduction, or external dataset/model-weight acquisition beyond documented prerequisites.

Files in this skill

  • SKILL.md4.6 KB
  • references/repo-provenance.md1.6 KB
  • references/repo-routing-metadata.json496 B
  • references/troubleshooting.md3.7 KB
  • scripts/check_torchdrug_env.py1.7 KB
  • sub-skills/graph-data/SKILL.md2.3 KB
  • sub-skills/graph-data/references/data-objects.md12.3 KB
  • sub-skills/graph-data/references/troubleshooting.md7.7 KB
  • sub-skills/graph-data/scripts/smoke_graph_data.py3.2 KB
  • sub-skills/knowledge-graphs/SKILL.md2 KB
  • sub-skills/knowledge-graphs/references/api-reference.md6.7 KB
  • sub-skills/knowledge-graphs/references/reasoning-workflows.md7.4 KB
  • sub-skills/knowledge-graphs/references/troubleshooting.md5.9 KB
  • sub-skills/knowledge-graphs/scripts/plan_kg_reasoning.py3.5 KB
  • sub-skills/layers-and-extensions/SKILL.md2.7 KB
  • sub-skills/layers-and-extensions/references/customization.md6.4 KB
  • sub-skills/layers-and-extensions/references/layer-and-model-api.md10.6 KB
  • sub-skills/layers-and-extensions/references/troubleshooting.md5.2 KB
  • sub-skills/layers-and-extensions/scripts/inspect_layers.py5.6 KB
  • sub-skills/molecular-workflows/SKILL.md2.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.