FAERS Analysis Pipeline

flowchart TD A[("📦 Raw FAERS XML Data\n(2004Q1 - 2025Q4)")]:::source subgraph P0["ETL & Data Normalization"] direction TB A1["faers_etl.py\nPython stream-parsing"] A2["Drug Standardization\nCustom Fuzzy Matching"] A3["faers_clean.sql\nNormalize dates/ages/labels"] A4["Cross-Sender Deduplication\nClinical Fingerprint matching"] A5[("Final Analytical View\nv_analysis")] end subgraph P1["Phase 1 · Descriptive Profiling"] direction TB B0["faers_profiling.R"] B1[Demographic Distribution\nAge & Sex insights] B2[Global Severity Baseline\nHospitalization vs. Death] B3[Top Senders & Substances\nSanofi/AbbVie dominance] B4[Geographic Mapping\nGlobal Choropleth] end subgraph P2["Phase 2 · Signal Detection"] direction TB C0["faers_indication_filter.R"] C1["Confounding Control\nreaction = indication filtering"] C2["Frequentist: PRR, ROR, χ²\n(EMA standards)"] C3["Bayesian: IC & IC₀₂₅\n(WHO-UMC BCPNN)"] C4["Signal Criteria:\nPRR ≥ 2, χ² ≥ 4\nN ≥ 3, IC₀₂₅ > 0"] end subgraph P3["Phase 3 · Visualization"] direction TB E0["faers_visualizations.R"] E1["Interactive Volcano Plots\nIC₀₂₅ vs. Log₁₀ χ²"] E2["Signal Intensity Heatmap\nAssociation strength (IC₀₂₅)"] E3[Interactive HTML Widgets\nvia Plotly & htmlwidgets] end subgraph P4["Phase 4 · Deep-Dive: GLP-1 Agonists"] direction TB F0["faers_glp1_analysis.R\nfaers_glp1_interactive.R"] F1["GI Safety Profile\nNausea, Vomiting, Gastroparesis"] F2["Cohort Comparison\nDiabetes vs. Weight Management"] F3["Interactive Forest Plots\nDrug-by-drug signal stability"] F4["Sub-population Heatmap\n(Gender, Age, Indication)"] end A --> P0 A1 --> A2 --> A3 --> A4 --> A5 P0 --> P1 B0 --> B1 --> B2 --> B3 --> B4 P1 --> P2 C0 --> C1 --> C2 --> C3 --> C4 P2 --> P3 E0 --> E1 & E2 --> E3 P3 --> P4 F0 --> F1 --> F2 --> F3 & F4 classDef source fill:#f6f8fa,stroke:#0969da,stroke-width:2px,color:#0969da classDef p0 fill:#f6f8fa,stroke:#6e7781,color:#24292f classDef p1 fill:#ebf3fa,stroke:#4682b4,color:#24292f classDef p2 fill:#fff0eb,stroke:#ffa07a,color:#24292f classDef p3 fill:#f6f8fa,stroke:#6e7781,color:#24292f classDef p4 fill:#f0f8ff,stroke:#5cacee,color:#24292f class A source class A1,A2,A3,A4,A5 p0 class B0,B1,B2,B3,B4 p1 class C0,C1,C2,C3,C4 p2 class E0,E1,E2,E3 p3 class F0,F1,F2,F3,F4 p4