Sep 23, 2025

Public workspaceSignal Detection and Analysis of FAERS Data for Drug Safety Surveillance using R

  • junxia cao1,
  • Na Yang1,
  • Cheng Huang2
  • 1Guizhou Nursing Vocational College;
  • 2The Affiliated Hospital of Guizhou Medical University
  • GZHL
Icon indicating open access to content
QR code linking to this content
Protocol Citationjunxia cao, Na Yang, Cheng Huang 2025. Signal Detection and Analysis of FAERS Data for Drug Safety Surveillance using R. protocols.io https://dx.doi.org/10.17504/protocols.io.rm7vz97e4gx1/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: September 23, 2025
Last Modified: September 23, 2025
Protocol Integer ID: 227950
Keywords: FAERS database, Signal mining, Adverse drug events, drug safety surveillance, analysis of faers data, faers data, signal detection, data source
Abstract
This repository contains the code and protocols for reproducing the analysis detailed in our study. It documents the data sources, processing steps, and analytical methodologies to ensure transparency and reproducibility
Guidelines
1.Objective & Principle: This guide aims to identify potential adverse event signals for target drugs from FAERS data through disproportionality analysis.
2.Prerequisites: Users should be familiar with the basics of R and skilled in cleaning and analyzing quarterly FAERS ASCII data.
3.Critical Note: Data deduplication is one of the most crucial steps in the FAERS analysis workflow.
4.Key Parameter: Signal detection thresholds (e.g., the lower limit of the 95% CI for the ROR) must be evaluated and adjusted on a case-by-case basis.
5.The codebase includes components that depend on faersR, which is not open-source and is protected by copyright,The package has been validated in prior research for FAERS data mining, as demonstrated in Lu BW, ed al. Sci Rep. 2025 May 16;15(1):17070. doi: 10.1038/s41598-025-01527-9. PMID: 40379814; PMCID: PMC12084613.
Troubleshooting
Before start
1.This code repository contains the complete data analysis code for detecting adverse reaction signals associated with a specific class of drugs from the US FDA Adverse Event Reporting System (FAERS) data.
3.Statistical analyses were performed using R software(version 4.4.0), and used ggplot2 for forest plot visualization.
Signal Detection and Analysis of FAERS Data for Drug Safety Surveillance using R
# 1.Install faershelp
devtools::install_github('faerszj/faershelp')
# 2.Install faersR
faershelp::install_faersR('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')
#3.Install ggplot2
install.packages("ggplot2")
#4.Run faersR
library("faersR")
#5.Set the working path
setwd("F:/FAERS/cinacalcet")
#6.Find the target terms cinacalcet|sensipar
cinacalcet <- dic_drug("cinacalcet|sensipar",file = "tableS1")
#7.Find the year of cinacalcet
yearQ(cinacalcet)
#8. Extracted from the first quarter of 2004 to the first quarter of 2025
filt_yearQ('2004Q1','2004Q2','2004Q3','2004Q4',
           '2005Q1','2005Q2','2005Q3','2005Q4',
           '2006Q1','2006Q2','2006Q3','2006Q4',
           '2007Q1','2007Q2','2007Q3','2007Q4',
           '2008Q1','2008Q2','2008Q3','2008Q4',
           '2009Q1','2009Q2','2009Q3','2009Q4',
           '2010Q1','2010Q2','2010Q3','2010Q4',
           '2011Q1','2011Q2','2011Q3','2011Q4',
           '2012Q1','2012Q2','2012Q3','2012Q4',
           '2013Q1','2013Q2','2013Q3','2013Q4',
           '2014Q1','2014Q2','2014Q3','2014Q4',
           '2015Q1','2015Q2','2015Q3','2015Q4',
           '2016Q1','2016Q2','2016Q3','2016Q4',
           '2017Q1','2017Q2','2017Q3','2017Q4',
           '2018Q1','2018Q2','2018Q3','2018Q4',
           '2019Q1','2019Q2','2019Q3','2019Q4',
           '2020Q1','2020Q2','2020Q3','2020Q4',
           '2021Q1','2021Q2','2021Q3','2021Q4',
           '2022Q1','2022Q2','2022Q3','2022Q4',
           '2023Q1','2023Q2','2023Q3','2023Q4',
           '2024Q1','2024Q2','2024Q3','2024Q4',
           '2025Q1')
#9.Extract adverse event reports with Cinacalcet as the primary suspect (PS)
filt_drug.role(primary.suspect = T)
#10.Assign SC
sc <- screen(cinacalcet)
#11. The flow diagram ot the data cleaning and analysis process
flowchart(sc,drawio = "figure 1")
#12.Recode age groups
sc <- rec_age.yr(sc,"<18",
">=18,<45::18-44",
">=45,<60::45-59",
">=60,<75::60-74",
">=75,<90::75-89",
">=90")
#13.Recode TTO
sc <- rec_tto(sc = sc,"<7",">=7,<28",">=28,<60",">=60")
#14.Characteristics of AE reports associated with cinacalcet
AER_tab(sc,reporter_country.min = 100,indication.min = 100,file = "table3")
#15.The signal strength of AEs of cinacalcet at the SOC level
sig_soc(sc,rank.ROR = T,ROR.3 = -1,file = "tableS3")
#16.Adjust p-values using the False Discovery Rate (FDR) method to obtain p.adj
p.adj <- p.adjust(p.value, method = "fdr")
#17.PT table containing four algorithms and dual p-values
sig_pt(sc,rank.ROR = T,top = 500,sort.soc = T,p.value = T,p.adj = T,file = "table4")
Protocol references
Lu BW, Li JC, Wen MT, Luo D, Guo YQ, Li G. Safety comparisons among different subcutaneous anticoagulants for venous thromboembolism using FDA adverse event reporting system. Sci Rep. 2025;15(1):17070. Published 2025 May 16. doi:10.1038/s41598-025-01527-9
Acknowledgements
We would like to thank the U.S. Food and Drug Administration’s Adverse Event Reporting System (FAERS) for providing the publicly available data used in this study. We also extend our gratitude to all individuals involved in collecting and maintaining the FAERS database, whose efforts made this research possible. We sincerely thank Jing Zhang for providing the faersR analysis tool and for their technical support.Furthermore, we would like to express our gratitude to “www.xiantao.love” for providing technical support/analytical tools, which significantly contributed to this research.