Thursday, December 18, 2014

Adverse Effect mining of FDA data Part 1

US Food and Drug Administration (FDA) Adverse Event Reporting System (FAERS, formerly AERS) is a database that contains information on adverse event and medication error reports submitted to the FDA. The database is designed to support the FDA's post-marketing safety surveillance program for drug and therapeutic biologic products. In this issue of my blog i have used 2012 quarter 4 data to visualize adverse reactions and also compare the adverse reactions for a group of drugs (group means by ATC code). There are some very important point to note the data is submitted from countries which mean a drug can have different names (brandnames) . So you can search as "Aspirin" on the database you need to search by all the alternate brandnames of Aspirin on the database. For that I have created a brandname based dataset of all the drugbank data which i will use for this example.

For this datasets used :
  • ATC drug group class data
  • Drug Brandnames data
  • 2012 FDA quarter 4 dataset.
R packages used
  • foreach
  • doParallel
  • rCharts(for visualization)
I used foreach with parallel because it takes a lot of time to query the data frames on a single processor making it parallel reduces a lot of timing. I am using rCharts NVD3 library for the interactive pyramid plots developed by Ramnath Vaidyanathan .  The codes for the work is avaialable at here. To simplify things I made a simple query "Aspirin" on the drug dataframe and used grepl with ignore case and drug_seq=1 ( which indicates primary medication) on lines 51-63(Initial.R script)  since aspirin is categorized  under 3 different classes such as Blood and blood forming organs ,Alimentary tract and metabolism and Nervous system , so i extracted all the drugs from each category and extracted the data from drug dataframe for each drugs and merged the results and visualized it as Interactive pyramid plots below.  I have some further ideas on this calculating some statistics based on class and also further categorizing using Mesh Class creating a Shiny app.

If you want the brandnames data with the ATC code classes leave a comment below with your email id or you can shoot an email.

Class Blood and blood forming organs ( Access the full charts at

Class Nervous System (

Class Alimentary tract and metabolism (

Post a Comment