scientific-skills/Evidence Insights/pytdc/SKILL.md
Therapeutics Data Commons (PyTDC) for AI-ready therapeutic ML datasets and benchmarks; use it when you need standardized dataset loading, meaningful splits (e.g., scaffold/cold-start), and consistent evaluation for ADME/Toxicity/DTI/DDI or molecular optimization.
npx skillsauth add aipoch/medical-research-skills pytdcInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
random, scaffold, and cold-start variants such as cold_drug, cold_target, cold_drug_target, plus temporal where applicable.Evaluator with common metrics (ROC-AUC, PR-AUC, RMSE, MAE, Spearman, etc.).references/oracles.md).Install (recommended):
uv pip install PyTDC
Upgrade:
uv pip install PyTDC --upgrade
Core runtime dependencies (installed automatically; versions depend on the PyTDC release you install):
PyTDC (latest from PyPI)numpypandasscikit-learntqdmseabornfuzzywuzzyOptional dependencies may be pulled in automatically depending on which submodules you use (e.g., graph backends or chemistry toolchains).
A complete runnable example that:
# pip install PyTDC scikit-learn
from tdc.single_pred import ADME
from tdc import Evaluator, Oracle
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import Ridge
def main():
# 1) Load a single-instance prediction dataset (ADME)
data = ADME(name="Caco2_Wang")
# 2) Create a scaffold split (train/valid/test)
split = data.get_split(method="scaffold", seed=42, frac=[0.7, 0.1, 0.2])
train, valid, test = split["train"], split["valid"], split["test"]
# 3) Train a simple baseline model on SMILES strings
# (character n-gram + ridge regression; replace with your own model)
model = Pipeline(
steps=[
("featurizer", CountVectorizer(analyzer="char", ngram_range=(2, 5))),
("regressor", Ridge(alpha=1.0)),
]
)
model.fit(train["Drug"], train["Y"])
# 4) Evaluate on the test set using a TDC Evaluator
y_pred = model.predict(test["Drug"])
evaluator = Evaluator(name="MAE")
mae = evaluator(test["Y"], y_pred)
print(f"Test MAE: {mae:.4f}")
# 5) Oracle scoring example (property scoring for a SMILES)
oracle = Oracle(name="DRD2")
score = oracle("CC(C)Cc1ccc(cc1)C(C)C(O)=O")
print(f"DRD2 Oracle score: {score}")
if __name__ == "__main__":
main()
Related references and templates (if present in this skill package):
references/oracles.mdreferences/utilities.mdreferences/datasets.mdscripts/load_and_split_data.py, scripts/benchmark_evaluation.py, scripts/molecular_generation.pyPyTDC datasets follow a consistent interface:
from tdc.<problem> import <Task>
data = <Task>(name="<DatasetName>")
df = data.get_data(format="df")
split = data.get_split(method="scaffold", seed=1, frac=[0.7, 0.1, 0.2])
<problem> is typically one of:
single_pred (single-entity property prediction)multi_pred (pairwise/multi-entity interaction prediction)generation (molecule/reaction generation tasks)Use get_split(...) to obtain {"train": ..., "valid": ..., "test": ...}.
Common parameters:
method: split strategyseed: random seed for reproducibilityfrac: [train, valid, test] fractions (when supported)Typical methods:
random: random shuffling splitscaffold: Bemis–Murcko scaffold-based split to reduce scaffold leakage and improve chemical generalizationcold_drug: test contains unseen drugscold_target: test contains unseen targetscold_drug_target: test contains unseen drugs and targetstemporal: time-based split for datasets with timestamps (when available)Example:
split = data.get_split(method="cold_target", seed=1)
TDC provides a unified evaluator:
from tdc import Evaluator
evaluator = Evaluator(name="ROC-AUC") # classification
score = evaluator(y_true, y_pred)
Choose metrics appropriate to the task type:
ROC-AUC, PR-AUC, F1, Accuracy, etc.RMSE, MAE, R2, Spearman, Pearson, etc.While schemas vary by task, common conventions include:
Single-instance prediction (e.g., ADME/Tox):
Drug (often SMILES) and label YDrug_ID / Compound_IDMulti-instance prediction (e.g., DTI):
Drug (SMILES), Target (protein sequence), label YDrug_ID, Target_IDOracles provide a callable scoring interface:
from tdc import Oracle
oracle = Oracle(name="GSK3B")
score = oracle("CCO...")
scores = oracle(["SMILES1", "SMILES2"])
Use Oracles to:
For the full list of Oracles and their expected inputs/outputs, see references/oracles.md.
tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.