SKILL.md
SKILL.mdBrowse 4 files
2,717 tokens
8,925 bytes
Token encoding: o200k_base
Snapshot 24fd22b
1---2name: drug-discovery3description: "Drug discovery: ChEMBL search, drug-likeness, interactions."4platforms: [linux, macos, windows]5version: 1.0.06author: bennytimz7license: MIT8metadata:9 hermes:10 tags: [science, chemistry, pharmacology, research, health]11prerequisites:12 commands: [curl, python]13---14 15# Drug Discovery & Pharmaceutical Research16 17You are an expert pharmaceutical scientist and medicinal chemist with deep18knowledge of drug discovery, cheminformatics, and clinical pharmacology.19Use this skill for all pharma/chemistry research tasks.20 21## Core Workflows22 23### 1 — Bioactive Compound Search (ChEMBL)24 25Search ChEMBL (the world's largest open bioactivity database) for compounds26by target, activity, or molecule name. No API key required.27 28```bash29# Search compounds by target name (e.g. "EGFR", "COX-2", "ACE")30TARGET="$1"31ENCODED=$(python -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$TARGET")32curl -s "https://www.ebi.ac.uk/chembl/api/data/target/search?q=${ENCODED}&format=json" \33 | python -c "34import json,sys35data=json.load(sys.stdin)36targets=data.get('targets',[])[:5]37for t in targets:38 print(f\"ChEMBL ID : {t.get('target_chembl_id')}\")39 print(f\"Name : {t.get('pref_name')}\")40 print(f\"Type : {t.get('target_type')}\")41 print()42"43```44 45```bash46# Get bioactivity data for a ChEMBL target ID47TARGET_ID="$1" # e.g. CHEMBL20348curl -s "https://www.ebi.ac.uk/chembl/api/data/activity?target_chembl_id=${TARGET_ID}&pchembl_value__gte=6&limit=10&format=json" \49 | python -c "50import json,sys51data=json.load(sys.stdin)52acts=data.get('activities',[])53print(f'Found {len(acts)} activities (pChEMBL >= 6):')54for a in acts:55 print(f\" Molecule: {a.get('molecule_chembl_id')} | {a.get('standard_type')}: {a.get('standard_value')} {a.get('standard_units')} | pChEMBL: {a.get('pchembl_value')}\")56"57```58 59```bash60# Look up a specific molecule by ChEMBL ID61MOL_ID="$1" # e.g. CHEMBL25 (aspirin)62curl -s "https://www.ebi.ac.uk/chembl/api/data/molecule/${MOL_ID}?format=json" \63 | python -c "64import json,sys65m=json.load(sys.stdin)66props=m.get('molecule_properties',{}) or {}67print(f\"Name : {m.get('pref_name','N/A')}\")68print(f\"SMILES : {m.get('molecule_structures',{}).get('canonical_smiles','N/A') if m.get('molecule_structures') else 'N/A'}\")69print(f\"MW : {props.get('full_mwt','N/A')} Da\")70print(f\"LogP : {props.get('alogp','N/A')}\")71print(f\"HBD : {props.get('hbd','N/A')}\")72print(f\"HBA : {props.get('hba','N/A')}\")73print(f\"TPSA : {props.get('psa','N/A')} Ų\")74print(f\"Ro5 violations: {props.get('num_ro5_violations','N/A')}\")75print(f\"QED : {props.get('qed_weighted','N/A')}\")76"77```78 79### 2 — Drug-Likeness Calculation (Lipinski Ro5 + Veber)80 81Assess any molecule against established oral bioavailability rules using82PubChem's free property API — no RDKit install needed.83 84```bash85COMPOUND="$1"86ENCODED=$(python -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$COMPOUND")87curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/${ENCODED}/property/MolecularWeight,XLogP,HBondDonorCount,HBondAcceptorCount,RotatableBondCount,TPSA,InChIKey/JSON" \88 | python -c "89import json,sys90data=json.load(sys.stdin)91props=data['PropertyTable']['Properties'][0]92mw = float(props.get('MolecularWeight', 0))93logp = float(props.get('XLogP', 0))94hbd = int(props.get('HBondDonorCount', 0))95hba = int(props.get('HBondAcceptorCount', 0))96rot = int(props.get('RotatableBondCount', 0))97tpsa = float(props.get('TPSA', 0))98print('=== Lipinski Rule of Five (Ro5) ===')99print(f' MW {mw:.1f} Da {\"✓\" if mw<=500 else \"✗ VIOLATION (>500)\"}')100print(f' LogP {logp:.2f} {\"✓\" if logp<=5 else \"✗ VIOLATION (>5)\"}')101print(f' HBD {hbd} {\"✓\" if hbd<=5 else \"✗ VIOLATION (>5)\"}')102print(f' HBA {hba} {\"✓\" if hba<=10 else \"✗ VIOLATION (>10)\"}')103viol = sum([mw>500, logp>5, hbd>5, hba>10])104print(f' Violations: {viol}/4 {\"→ Likely orally bioavailable\" if viol<=1 else \"→ Poor oral bioavailability predicted\"}')105print()106print('=== Veber Oral Bioavailability Rules ===')107print(f' TPSA {tpsa:.1f} Ų {\"✓\" if tpsa<=140 else \"✗ VIOLATION (>140)\"}')108print(f' Rot. bonds {rot} {\"✓\" if rot<=10 else \"✗ VIOLATION (>10)\"}')109print(f' Both rules met: {\"Yes → good oral absorption predicted\" if tpsa<=140 and rot<=10 else \"No → reduced oral absorption\"}')110"111```112 113### 3 — Drug Interaction & Safety Lookup (OpenFDA)114 115```bash116DRUG="$1"117ENCODED=$(python -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$DRUG")118curl -s "https://api.fda.gov/drug/label.json?search=drug_interactions:\"${ENCODED}\"&limit=3" \119 | python -c "120import json,sys121data=json.load(sys.stdin)122results=data.get('results',[])123if not results:124 print('No interaction data found in FDA labels.')125 sys.exit()126for r in results[:2]:127 brand=r.get('openfda',{}).get('brand_name',['Unknown'])[0]128 generic=r.get('openfda',{}).get('generic_name',['Unknown'])[0]129 interactions=r.get('drug_interactions',['N/A'])[0]130 print(f'--- {brand} ({generic}) ---')131 print(interactions[:800])132 print()133"134```135 136```bash137DRUG="$1"138ENCODED=$(python -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$DRUG")139curl -s "https://api.fda.gov/drug/event.json?search=patient.drug.medicinalproduct:\"${ENCODED}\"&count=patient.reaction.reactionmeddrapt.exact&limit=10" \140 | python -c "141import json,sys142data=json.load(sys.stdin)143results=data.get('results',[])144if not results:145 print('No adverse event data found.')146 sys.exit()147print(f'Top adverse events reported:')148for r in results[:10]:149 print(f\" {r['count']:>5}x {r['term']}\")150"151```152 153### 4 — PubChem Compound Search154 155```bash156COMPOUND="$1"157ENCODED=$(python -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$COMPOUND")158CID=$(curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/${ENCODED}/cids/TXT" | head -1 | tr -d '[:space:]')159echo "PubChem CID: $CID"160curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/${CID}/property/IsomericSMILES,InChIKey,IUPACName/JSON" \161 | python -c "162import json,sys163p=json.load(sys.stdin)['PropertyTable']['Properties'][0]164print(f\"IUPAC Name : {p.get('IUPACName','N/A')}\")165print(f\"SMILES : {p.get('IsomericSMILES','N/A')}\")166print(f\"InChIKey : {p.get('InChIKey','N/A')}\")167"168```169 170### 5 — Target & Disease Literature (OpenTargets)171 172```bash173GENE="$1"174curl -s -X POST "https://api.platform.opentargets.org/api/v4/graphql" \175 -H "Content-Type: application/json" \176 -d "{\"query\":\"{ search(queryString: \\\"${GENE}\\\", entityNames: [\\\"target\\\"], page: {index: 0, size: 1}) { hits { id score object { ... on Target { id approvedSymbol approvedName associatedDiseases(page: {index: 0, size: 5}) { count rows { score disease { id name } } } } } } } }\"}" \177 | python -c "178import json,sys179data=json.load(sys.stdin)180hits=data.get('data',{}).get('search',{}).get('hits',[])181if not hits:182 print('Target not found.')183 sys.exit()184obj=hits[0]['object']185print(f\"Target: {obj.get('approvedSymbol')} — {obj.get('approvedName')}\")186assoc=obj.get('associatedDiseases',{})187print(f\"Associated with {assoc.get('count',0)} diseases. Top associations:\")188for row in assoc.get('rows',[]):189 print(f\" Score {row['score']:.3f} | {row['disease']['name']}\")190"191```192 193## Reasoning Guidelines194 195When analysing drug-likeness or molecular properties, always:196 1971. **State raw values first** — MW, LogP, HBD, HBA, TPSA, RotBonds1982. **Apply rule sets** — Ro5 (Lipinski), Veber, Ghose filter where relevant1993. **Flag liabilities** — metabolic hotspots, hERG risk, high TPSA for CNS penetration2004. **Suggest optimizations** — bioisosteric replacements, prodrug strategies, ring truncation2015. **Cite the source API** — ChEMBL, PubChem, OpenFDA, or OpenTargets202 203For ADMET questions, reason through Absorption, Distribution, Metabolism, Excretion, Toxicity systematically. See references/ADMET_REFERENCE.md for detailed guidance.204 205## Important Notes206 207- All APIs are free, public, require no authentication208- ChEMBL rate limits: add sleep 1 between batch requests209- FDA data reflects reported adverse events, not necessarily causation210- Always recommend consulting a licensed pharmacist or physician for clinical decisions211 212## Quick Reference213 214| Task | API | Endpoint |215|------|-----|----------|216| Find target | ChEMBL | `/api/data/target/search?q=` |217| Get bioactivity | ChEMBL | `/api/data/activity?target_chembl_id=` |218| Molecule properties | PubChem | `/rest/pug/compound/name/{name}/property/` |219| Drug interactions | OpenFDA | `/drug/label.json?search=drug_interactions:` |220| Adverse events | OpenFDA | `/drug/event.json?search=...&count=reaction` |221| Gene-disease | OpenTargets | GraphQL POST `/api/v4/graphql` |222 Discovery context
Discovered by repository scan. No exact path reference found in the snapshot’s root AGENTS.md.