Giter Site home page Giter Site logo

drugstandards's Introduction

Drug Standards

This package provides tools for standardizing drug names into a single format. For example; Benadryl and diphenhydramine refer to the same chemical entity. In certain tasks, such as mining the FDA Adverse Event Reporting System database, it is useful to standardize all drug names (i.e. convert all instances of Benadryl to diphenhydramine) in order to compute various statistics. This package uses a database of drug synonyms and brand names to return the generic name for a drug. To handle misspellings the standardize function will return the generic name for the most similar match based on Jaro-Winkler similarity. A threshold can be set in order to specify the minimal similarity required to be considered a match.

Installation

1. Install drugstandards package using PIP

sudo pip install drugstandards

2. Installing drugstandards from source

# Download this github repository and enter the following
cd drugstandards
sudo python setup.py install

Usage

1. Import the module

import drugstandards as drugs

2. Standardize a single, correctly spelled drug name to generic.

# Note that this function is NOT case-sensitive.
drugs.standardize(["lopressor"])

3. Standardize a single brand name to generic.

drugs.standardize(["Benadryl"])

4. Standardize misspelled names to generic.

drugs.standardize(["Benadril", "lopresor"])

5. Return generic name for terms that have a Jaro-Winkler similarity greater than 0.9

# Will return None if no match is found.

drugs.standardize(["Benadril"], thresh=0.9)

6. Add drug mapping to drug dictionary

# If a mapping does not exist you may create your own by updating the drug-dictionary.
# For example, we may be interested in mapping the term "MULTI-VITAMIN" to "VITAMIN"
drugs.add_drug_mapping({"MULTI-VITAMIN":"VITAMIN"})

# We can also create many updates simultaneously
drugs.add_drug_mapping({"MULTI-VITAMIN":"VITAMIN", "TYLENOL EXTRA STRENGTH": "ACETAMINOPHEN"})

Questions/issues/contact

[email protected]

Citing

DOI

drugstandards'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.