tooluniverse-adverse-event-detection
Detect and analyze adverse drug event signals using FDA FAERS reports, drug labels, and disproportionality statistics (PRR, ROR, IC). Generates quantitative safety signal scores (0-100) with evidence grading. Use for post-market surveillance, pharmacovigilance, drug safety assessment, regulatory sub
By mims-harvard · 355 installs
npx skills add mims-harvard/tooluniverse --skill tooluniverse-adverse-event-detection
Source repository · Upstream listing
COMPUTE, DON'T DESCRIBE
When analysis requires computation (statistics, data processing, scoring, enrichment), write and run Python code via Bash. Don't describe what you would do — execute it and report actual results. Use ToolUniverse tools to retrieve data, then Python (pandas, scipy, statsmodels, matplotlib) to analyze it.
Adverse Drug Event Signal Detection & Analysis
Automated pipeline for detecting, quantifying, and contextualizing adverse drug event signals using FAERS disproportionality analysis, FDA label mining, mechanism based prediction, and literature evidence. Produces a quantitative Safety Signal Score (0 100) for regulatory and clinical decision making.
KEY PRINCIPLES :
1. Signal quantification first Every adverse event must have PRR/ROR/IC with confidence intervals
2. Serious events priority Deaths, hospitalizations, life threatening events always analyzed first
3. Multi source triangulation FAERS + FDA labels + OpenTargets + DrugBank + literature
4. Context aware assessment Distinguish drug specific vs class wide vs confounding signals
5. Report first approach Create report file FIRST, update progressively
6. Evidence grading mandatory T1 (regulatory/boxed warning) through T4 (computational)
7. English first queries Always use English drug names in tool calls, respond in user's language
REASONING STRATEGY — Start Here :
Start with the signal: What adverse event was reported more than expected? (PRR = 2.0, N = 3, lower CI 1.0 is the threshold). Then ask three questions in order:
1. Biologically plausible? Given the drug's mechanism of action and targets, does this adverse event make sense? An off target kinase inhibitor causing cardiac events is plausible; a topical agent causing systemic toxicity needs more scrutiny. LOOK UP DON'T GUESS — use OpenTargets get drug mechanisms of action by chemblId and drugbank get targets by drug name or drugbank id to check targets before asserting plausibility.
2. Timing consistent? Acute reactions (within hours/days) suggest immune or direct pharmacologic mechanism. Delayed reactions (weeks/months) suggest cumulative toxicity or idiosyncratic response. Check FAERS time to onset distribution.
3. Could confounders explain it? Patients taking this drug likely have the underlying disease — compare against background rate in that population, not the general population. Class wide signals (appearing for all drugs in the class) suggest mechanism based rather than molecule specific toxicity.
Causality Assessment — Naranjo Algorithm Reasoning :
When determining whether an adverse event is drug caused (not just associated), apply these steps systematically. LOOK UP DON'T GUESS — search FAERS and FDA labels for each criterion:
1. Prior reports? Are there previous conclusive reports of this reaction? Check FDA label ( FDA get adverse reactions by drug name ) and literature ( PubMed search articles ). Yes = +1.
2. Temporal relationship? Did the AE appear after drug administration? Onset within expected pharmacokinetic window (1 5 half lives) = +2. Use FAERS stratify by demographics for time to onset data.
3. Dechallenge? Did the AE improve when the drug was stopped? Positive dechallenge = +1. Look for rechallenge/dechallenge case reports in literature.
4. Rechallenge? Did the AE reappear when the drug was restarted? Positive rechallenge = +2 (strongest single piece of evidence for causality).
5. Alternative causes? Could the underlying disease, concomitant drugs, or other factors explain the AE? Check drugbank get drug interactions by drug name or id for interacting drugs.
6. Dose response? Did the reaction worsen with higher doses or improve with lower doses? Dose dependent AEs suggest on target toxicity.
7. Drug level confirmation? Was the drug detected in body fluids at toxic concentrations?
Score: Definite ( =9), Probable (5 8), Possible (1 4), Doubtful (<=0).
Even without individual patient data, you can estimate causality from aggregate FAERS signals + label evidence + mechanistic plausibility.
Reference files (in this directory):
PHASE DETAILS.md Detailed tool calls, code examples, and output templates per phase
REPORT TEMPLATE.md Full report template and completeness checklist
TOOL REFERENCE.md Tool parameter reference and fallback chains
QUICK START.md Quick examples and common drug names
When to Use
Apply when user asks:
"What are the safety signals for [drug]?"
"Detect adverse events for [drug]"
"Is [drug] associated with [adverse event]?"
"What are the FAERS signals for [drug]?"
"Compare safety of [drug A] vs [drug B] for [adverse event]"
"What are the serious adverse events for [drug]?"
"Are there emerging safety signals for [drug]?"
"Post market surveillance report for [drug]"
"Pharmacovigilance signal detection for [drug]"
Differentiation from tooluniverse pharmacovigilance : This skill focuses specifically on signal detection and quantification using disproportionality analysis (PRR, ROR, IC) with statistical rigor, produces a quantitative Safety Signal Score (0 100) , and performs comparative safety analysis across drug classes.
Workflow Overview
Phase Summaries
Phase 0: Input Parsing & Drug Disambiguation
Resolve drug name to ChEMBL ID, DrugBank ID. Get mechanism of action, blackbox warning status, targets, and approved indications.
Tools : OpenTargets get drug chembId by generic name , OpenTargets get drug mechanisms of action by chemblId , OpenTargets get drug blackbox status by chembl ID , drugbank get safety by drug name or drugbank id , drugbank get targets by drug name or drugbank id , OpenTargets get drug indications by chemblId
Phase 1: FAERS Adverse Event Profiling
Query FAERS for top adverse events, seriousness distribution, outcomes, demographics, and death related events. Filter serious events by type (death, hospitalization, life threatening). Get MedDRA hierarchy rollup.
Tools : FAERS count reactions by drug event , FAERS count seriousness by drug event , FAERS count outcomes by drug event , FAERS count patient age distribution , FAERS count death related by drug , FAERS count reportercountry by drug event , FAERS filter serious events , FAERS rollup meddra hierarchy
Phase 2: Disproportionality Analysis (Signal Detection)
CRITICAL PHASE . For each top adverse event (at least 15 20), calculate PRR, ROR, IC with 95% CI. Classify signal strength. Stratify strong signals by demographics.
Tools : FAERS calculate disproportionality , FAERS stratify by demographics
MedDRA term level note : FAERS count reactions by drug event filters by MedDRA Lowest Level Term ( reactionmeddraverse ) while FAERS calculate disproportionality uses Preferred Terms. Case counts can differ dramatically — always use disproportionality analysis as the primary signal metric, not raw counts.
Signal criteria : PRR = 2.0 AND lower CI 1.0 AND N = 3
Strength : Strong (PRR = 5), Moderate (PRR 3 5), Weak (PRR 2 3)
See PHASE DETAILS.md for full signal classification table
Phase 3: FDA Label Safety Information
Extract boxed warnings, contraindications, warnings/precautions, adverse reactions, drug interactions, and special population info. Note: {error: {code: "NOT FOUND"}} is normal when a section does not exist.
Tools : FDA get boxed warning info by drug name , FDA get contraindications by drug name , FDA get warnings by drug name , FDA get adverse reactions by drug name , FDA get drug interactions by drug name , FDA get pregnancy or breastfeeding info by drug name , FDA get geriatric use info by drug name , FDA get pediatric use info by drug name , FDA get pharmacogenomics info by drug name
Phase 4: Mechanism Based Adverse Event Context
Get target safety profile, OpenTargets adverse events, ADMET toxicity predictions (if SMILES available), and drug warnings.
Tools : OpenTargets get target safety profile by ensemblID , OpenTargets get drug adverse events by chemblId , ADMETAI predict toxicity , ADMETAI predict CYP interactions , OpenTargets get drug warnings by chemblId
Phase 5: Comparative Safety Analysis
Head to head comparison with class members using FAERS compare drugs . Aggregate class AEs. Identify class wide vs drug specific signals.
Tools : FAERS compare drugs , FAERS count additive adverse reactions , FAERS count additive seriousness classification
Phase 6: Drug Drug Interactions & Risk Factors
Extract DDIs from FDA label, DrugBank, and DailyMed. Query PharmGKB for pharmacogenomic risk factors and dosing guidelines. Check FDA PGx biomarkers.
Tools : FDA get drug interactions by drug name , drugbank get drug interactions by drug name or id , DailyMed parse drug interactions , PharmGKB search drugs , PharmGKB get drug details , PharmGKB get dosing guidelines , fda pharmacogenomic biomarkers
Phase 7: Literature Evidence
Search PubMed, OpenAlex, and EuropePMC for safety studies, case reports, and preprints.
Tools : PubMed search articles , openalex search works , EuropePMC search articles
Phase 8: Risk Assessment & Safety Signal Score
Calculate Safety Signal Score (0 100) from four components: FAERS signal strength (0 35), serious AEs (0 30), FDA label warnings (0 25), literature evidence (0 10). Grade each signal T1 T4. See PHASE DETAILS.md for scoring rubric.
Phase 9: Report Synthesis
Generate comprehensive markdown report with executive summary, all phase outputs, monitoring recommendations, risk mitigation strategies, patient counseling points, and completeness checklist. See REPORT TEMPLATE.md for full template.
Edge Cases
No FAERS reports : Skip Phases 1 2; rely on FDA label, mechanism predictions, literature
Generic vs Brand name : Try both in FAERS; use OpenTargets get drug chembId by generic name to resolve
Drug combinations : Use FAERS count additive adverse reactions for aggregate class analysis
Confounding by indication : Compare AE profile to the disease being treated; note limitation in report
Drugs with boxed warnings : Score component automatically 25/25 for label warnings; prioritize boxed warning events