GithubHelp home page GithubHelp logo

kalamri2 / faerslib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chapatidb/faerslib

0.0 0.0 0.0 10 KB

Python tools for working with data from the FDA Adverse Event Reporting System.

Python 100.00%

faerslib's Introduction

FDA Adverse Event Reporting System (FAERS)

This package provides tools for working with data from the FDA Adverse Event Reporting System.

Installation

1. Install drugstandards package using PIP

sudo pip install faers

2. Installing drugstandards from source

# Download this github repository and enter the following

cd faers
sudo python setup.py install

Usage

To learn how to create the FDA Adverse Event Database check here.

Setup

# Import the module
import faers

# Initialize class and establish connection to FAERS database.
# This will create an object containing records from the UNITED STATES
# for all available years. Due to the size of the database this could take some
# time. 
f = faers.FAERS("faers.db")

# Create object using records from Japan and year 2012.
f = faers.FAERS("faers.db", countries="japan", years=2012)

# Create objects using records from United States, Japan and years 2010, 2011, 2012.
f = faers.FAERS("faers.db", countries=["japan", "united states"], years = [2010, 2011, 2012])

Utility functions

# Find associated events by drug.  Returns a list sorted by frequency.
f.associated_events("metoprolol")

# Find associated drugs by event.  Returns a list sorted by frequency.
f.associated_drugs("progressive multifocal leukoencephalopathy")

# Find drug counts.  Returns a list of drug names sorted by frequency.
f.drug_counts()

# Find event counts.  Returns a list of events sorted by frequency.
f.event_counts()

# Find events containing a phrase.  Returns a list of events containing the phrase.
f.find_like_events("fatigue")

# Find drug names by matching phrase.  Returns a list of drug names
# who's names match a given pattern/phrase.
f.find_like_drugs("pril")

Data Mining Algorithms

Proportional Reporting Ratio
# Compute Proportional Reporting Ratio (PRR) for a drug-event pair.
# Returns the PRR as well as 95% CI
f.prr("metoprolol", "nausea")

## The prr method will standardize drug terms so that following two are equivalent
# Generic name
f.prr("metformin", "nausea")

# Brand name
f.prr("glucophage", "nausea")

# Misspellings
f.prr("glucophag", "nausea")

# Compute PRR for all events given a drug name.
f.mine_prr_by_drug("natalizumab")

# Compute PRR for all drugs given an event.
f.mine_prr_by_event("progressive multifocal leukoencephalopathy")
Reporting Odds Ratio (ROR)
# Compute the Reporting Odds Ratio (ROR) for a given drug-event pair.
# Returns the ROR as well as 95% CI.
f.ror("natalizumab", "progressive multifocal leukoencephalopathy")
Multi-item Gamma Poisson Shrinker (MGPS)
# Compute the Multi-item Gamma Poisson Shrinker (MGPS) for a given drug-event pair.
f.mgps("natalizumab", "progressive multifocal leukoencephalopathy")

Questions/issues/contact

[email protected]

faerslib's People

Contributors

mlbernauer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.