Drugs Databases Parser

Parses drug and gene databases from their downloaded files: the 'DrugBank' XML database < https://go.drugbank.com/>, the 'OnSIDES' and 'TWOSIDES' adverse drug event databases, Human Phenotype Ontology ('HPO') gene-phenotype associations, the 'HGNC' gene nomenclature files, Health Canada's Drug Product Database ('DPD') data extract, and the 'openFDA' 'Drugs@FDA' and 'NDC' directory downloads. The parsed tables are returned in an 'R' object called 'dvobject', which records the source release, licence and file hashes.


dbparser

CRAN_Status_Badge JOSSPaper rOpenSciPeer-Reviewed DOI codecov metacrandownloads CII BestPractices Lifecycle:stable

Overview

dbparser is an rOpenSci peer-reviewed R package that parses and integrates major pharmacological databases into standardized, analysis-ready R objects called dvobjects (drugverse objects).

Pharmacological databases use incompatible formats and structures, forcing researchers to write custom parsing scripts — a process that consumes 60–80% of analysis time. dbparser eliminates this bottleneck with unified parsing functions, chainable merge operations, and a consistent output structure that enables reproducible, cross-database analyses.

With recent updates, dbparser has evolved into an integration engine, allowing you to merge mechanistic data (DrugBank) with real-world phenotypic data (OnSIDES) and drug-drug interaction risks (TWOSIDES).

Installation

# From CRAN (stable)
install.packages("dbparser")

# From GitHub (development)
# install.packages("pak")
pak::pak("ropensci/dbparser")

Supported Databases

Parser Source Reads Tables returned Licence of the source data Since
parseDrugBank() DrugBank The full database XML, or the zip it comes in drugs; with options also salts, products, references, cett not stated 2.0.0
parseOnSIDES() OnSIDES A folder with product_label.csv, product_adverse_effect.csv, product_to_rxnorm.csv, vocab_meddra_adverse_effect.csv, vocab_rxnorm_ingredient.csv, vocab_rxnorm_product.csv, vocab_rxnorm_ingredient_to_product.csv, optionally high_confidence.csv One table per file: product_label, product_adverse_effect, product_to_rxnorm, vocab_meddra_adverse_effect, vocab_rxnorm_ingredient, vocab_rxnorm_product, vocab_rxnorm_ingredient_to_product, optionally high_confidence CC-BY-4.0 2.2.1
parseTWOSIDES() TWOSIDES TWOSIDES.csv.gz drug_drug_interactions not stated 2.2.1
parseHPO() Human Phenotype Ontology, as distributed by Harmonizome gene_attribute_edges.txt, plain or gzip-compressed associations, genes, phenotypes CC-BY-NC-SA-4.0 2.3.0
parseHGNC() HGNC hgnc_complete_set.txt, optionally withdrawn.txt gene, gene_name, withdrawn CC0-1.0 2.3.0
parseHealthCanadaDPD() Health Canada Drug Product Database allfiles.zip, allfiles_ap.zip, allfiles_ia.zip, allfiles_dr.zip (or their unzipped folders) and inactive.zip drug_product, active_ingredients, companies, form, packaging, pharmaceutical_std, route, schedule, status, therapeutic_class, veterinary_species, biosimilars, inactive_products OGL-Canada-2.0 2.3.0
parseOpenFDA() openFDA drug-drugsfda-0001-of-0001.json.zip, drug-ndc-0001-of-0001.json.zip (or the unzipped JSON) drugsfda_application, drugsfda_product, drugsfda_active_ingredient, drugsfda_submission, drugsfda_submission_property_type, drugsfda_application_doc, drugsfda_openfda, ndc_product, ndc_active_ingredient, ndc_route, ndc_pharm_class, ndc_packaging, ndc_openfda CC0-1.0 2.3.0

Each source keeps its own licence; check its terms before use. “Not stated” means the source’s own pages give no licence for the data; every parsed object records the source’s licence, terms page and requested citation (see get_source_metadata()).

The DrugBank XML is downloaded from DrugBank with a free account; versions 5.1.0 through 5.1.12 have been tested. If you find errors with any DrugBank version, please submit an issue.

Tutorials: Getting started, and the worked examples on DrugBank, integrated pharmacovigilance and HPO target phenotypes.

Quick Start

Parse a Single Database

library(dbparser)

# Parse DrugBank
drugbank_db <- parseDrugBank("data/drugbank.xml")

# Parse OnSIDES
onsides_db <- parseOnSIDES("data/onsides/")

# Parse TWOSIDES
twosides_db <- parseTWOSIDES("data/TWOSIDES.csv.gz")

Integration Pipeline

The power of dbparser lies in its ability to chain parsers and mergers together. Here is how you can build a complete pharmacovigilance dataset:

library(dbparser)
library(dplyr)

# 1. Parse the raw databases
drugbank_db <- parseDrugBank("data/drugbank.xml")
onsides_db  <- parseOnSIDES("data/onsides/")
twosides_db <- parseTWOSIDES("data/TWOSIDES.csv.gz")

# 2. Build the Integrated Knowledge Graph
#    DrugBank serves as the hub. Chain the merges.
final_db <- drugbank_db %>%
  merge_drugbank_onsides(onsides_db) %>%
  merge_drugbank_twosides(twosides_db)

# 3. Analyze Results
head(final_db$integrated_data$drug_drug_interactions)

For a detailed case study, see the Integrated Pharmacovigilance Vignette.

The dvobject Structure

Every parser returns a dvobject: a named list of tibbles (DrugBank’s are nested in lists by section), with a source_metadata record of the source’s release, licence and file hashes. The tables and columns each parser returns are listed in dvobject structures by parser.

Commercial support and extensions

dbparser is free and open source, and it stays that way: every parser for an open database is part of this package.

It is maintained by Interstellar, which also offers:

  • dbparser Pro: loads licensed sources (for example DrugBank, under your own licence) and your private data into PostgreSQL, matches products and ingredients across sources, with scheduled refresh, release-to-release comparison and validation reports.
  • Services: data integration, custom sources, analysis apps and training for life-science teams.
  • DrugVerse Scope: one sourced evidence page for any drug or target, built on dbparser.

Questions or early access: info@interstellar-egypt.com

dbparser (free, open source) dbparser Pro
Parsers: DrugBank XML (from your own download), OnSIDES, TWOSIDES, HPO, HGNC, Health Canada DPD, openFDA (Drugs@FDA, NDC) (more coming). Each source keeps its own licence. ✓ ✓
dvobject format with source, release, licence and checksum metadata ✓ ✓
Merge DrugBank with OnSIDES, TWOSIDES and HPO, and subset parsed DrugBank and OnSIDES datasets ✓ ✓
Documentation, vignettes and examples ✓ ✓
Community help on GitHub Discussions ✓ ✓
Cross-source matching: products, ingredients and salt forms joined across DrugBank, Health Canada, FDA and other registers ✓
Licensed sources (for example DrugBank, under your own licence) and your private data loaded into PostgreSQL, with a licence gate per deployment ✓
Your private data joined to public sources ✓
Scheduled refresh when a source releases ✓
Release-to-release comparison ✓
Validation reports ✓
DrugVerse Scope integration ✓
Setup help and priority support ✓

Used in published research

  • Hammoud Z, et al. (2025). Multipath2.0: extending multilayer reproducible pathway models with omics data. Computer Methods and Programs in Biomedicine Update. doi:10.1016/j.cmpbup.2025.100189
  • Su Y, et al. (2024). Multi-ancestry proteome-phenome-wide Mendelian randomization offers a comprehensive protein-disease atlas. medRxiv (preprint). doi:10.1101/2024.10.17.24315553
  • Rischke S, et al. (2023). Machine learning identifies right index finger tenderness as key signal of DAS28-CRP based psoriatic arthritis activity. Scientific Reports. doi:10.1038/s41598-023-49574-4
  • Namiot ED, et al. (2023). The international clinical trials registry platform (ICTRP): data integrity and the trends in clinical trials, diseases, and drugs. Frontiers in Pharmacology. doi:10.3389/fphar.2023.1228148
  • Parolo S, et al. (2023). Single-cell-led drug repurposing for Alzheimer’s disease. Scientific Reports. doi:10.1038/s41598-023-27420-x
  • Schubert NMA, et al. (2022). Transcriptome-guided identification of drugs for repurposing to treat age-related hearing loss. Biomolecules. doi:10.3390/biom12040498
  • Mercatelli D, et al. (2022). Detection of pan-cancer surface protein biomarkers via a network-based approach on transcriptomics data. Briefings in Bioinformatics. doi:10.1093/bib/bbac400
  • Yang C, et al. (2021). Mapping the landscape of synthetic lethal interactions in liver cancer. Theranostics. doi:10.7150/thno.63416
  • Pérez-Moraga R, et al. (2021). A COVID-19 drug repurposing strategy through quantitative homological similarities using a topological data analysis-based framework. Pharmaceutics. doi:10.3390/pharmaceutics13040488
  • Hammoud Z, Kramer F (2020). Mulath: an R package to generate integrated reproducible pathway models. Biology. doi:10.3390/biology9120483

dbparser is listed in the CRAN Epidemiology Task View and described in our JOSS paper.

Ecosystem

Package Description Links
dbdataset Pre-parsed DrugBank datasets ready for analysis GitHub
covid19dbcand COVID-19 drug candidate datasets GitHub
periscope2 Shiny framework for interactive dashboards CRAN

Citation

If you use dbparser in published research, please cite our JOSS paper:

Ali et al., (2026). dbparser: An R Package for Parsing and Integrating
Pharmacological Databases. Journal of Open Source Software, 11(118),
9950, https://doi.org/10.21105/joss.09950
citation("dbparser")

If you find dbparser useful, consider ⭐ starring the GitHub repository and sharing it with colleagues.

Contributing

We welcome contributions! Please review our Contributing Guide.

Please note that the dbparser project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ropensci_footer

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("dbparser")

2.3.0 by Mohammed Ali, 2 days ago


https://docs.ropensci.org/dbparser/, https://github.com/ropensci/dbparser, https://interstellar-egypt.com


Report a bug at https://github.com/ropensci/dbparser/issues


Browse source code at https://github.com/cran/dbparser


Authors: Mohammed Ali [aut, cre] , Ali Ezzat [aut] , Hao Zhu [rev] , Emma Mendelsohn [rev] , Interstellar [cph, fnd] (Interstellar for Consultation Services , URL: https://interstellar-egypt.com)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports data.table, dplyr, jsonlite, progress, purrr, tibble, tools, utils, XML

Suggests canvasXpress, knitr, rmarkdown, testthat, tidyr


See at CRAN