Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b14c319
Increment version number to 2.0.3.9000
agenius-mohammed-ali Apr 20, 2024
d1ba888
#177, updated package version
MohammedFCIS Sep 16, 2025
5b7c945
#177,added data.table dependency and exported new parser
MohammedFCIS Sep 28, 2025
6a7ca57
#177, added new onside parser
MohammedFCIS Sep 28, 2025
705d820
#177, refactored "add_database_info" to be more generic
MohammedFCIS Sep 28, 2025
2d15fee
#177, added dvobject metainfo for onside
MohammedFCIS Sep 28, 2025
65e72eb
#177, added dvobject metainfo for onside
MohammedFCIS Sep 28, 2025
358dd4c
Merge branch 'OnSIDES-database' of https://github.com/ropensci/dbpars…
MohammedFCIS Sep 28, 2025
52e925f
#177, add merge drugbank and onsides databases function
MohammedFCIS Oct 5, 2025
7c47d46
#177, updated show dvobject meta data function
MohammedFCIS Oct 5, 2025
21926e2
- Fixed unit tests
MohammedFCIS Oct 5, 2025
5250420
#177, added missed imports
MohammedFCIS Oct 6, 2025
2b87ca5
#177, fixed global variables issue
MohammedFCIS Oct 6, 2025
a82577f
#177, fixed function param documentation
MohammedFCIS Oct 6, 2025
beb2039
#177, imported null operator from purrr and fixed CMD warning
MohammedFCIS Oct 8, 2025
929e677
#177, Added util functions and docs
MohammedFCIS Nov 25, 2025
a9a2ecd
#177, add drugbank subset function unit tests and added few fixes
agenius-mohammed-ali Nov 30, 2025
fa3561d
- Added object metadata
agenius-mohammed-ali Nov 30, 2025
8b1136f
#177, Added subset dvobject metadata unit tests
agenius-mohammed-ali Nov 30, 2025
cc13331
#177, added onside subset function
agenius-mohammed-ali Nov 30, 2025
056ab75
#177, add onside subset function unit test
agenius-mohammed-ali Nov 30, 2025
03a3c39
#177, fixed issues and added unit tests
agenius-mohammed-ali Nov 30, 2025
5f3d210
#177, Added drugbank onside tutorial
agenius-mohammed-ali Dec 6, 2025
0970d71
#177, updated add_database_info documentation
agenius-mohammed-ali Dec 8, 2025
ab29013
#177, fixed CMD notes
agenius-mohammed-ali Dec 8, 2025
b95f329
Merge pull request #178 from ropensci/OnSIDES-database
MohammedFCIS Dec 9, 2025
2708444
#176, Added two sides parser
agenius-mohammed-ali Dec 14, 2025
c3f953a
#176, updated package version
agenius-mohammed-ali Dec 14, 2025
68d6904
#176, removed unneeded imports
agenius-mohammed-ali Dec 14, 2025
971644c
#176, implemented merge_drugbank_onsides method
agenius-mohammed-ali Dec 25, 2025
3f126ac
#176, Fixed Metadata info for second database
agenius-mohammed-ali Dec 25, 2025
22494be
#176, updated onside merger to support pip operation
agenius-mohammed-ali Dec 25, 2025
e56cd80
#176, fixed documentation
agenius-mohammed-ali Dec 25, 2025
c973c16
#176, Added twosides raw data
agenius-mohammed-ali Dec 25, 2025
34e58d6
- Added twosides unit tests, #176
agenius-mohammed-ali Dec 25, 2025
1f305ab
#176, added twosides unit tests
agenius-mohammed-ali Dec 26, 2025
7badf89
- Fixed documentation, #176
agenius-mohammed-ali Dec 26, 2025
9b62a57
- Fixed CMD check warning, #176
agenius-mohammed-ali Dec 26, 2025
1fd1f54
- Added twosides documentation
agenius-mohammed-ali Dec 26, 2025
a515008
Merge pull request #184 from ropensci/twosides-database2
MohammedFCIS Dec 26, 2025
e6ad222
- Updated readme, #185
agenius-mohammed-ali Dec 27, 2025
6f8b661
- Updated NEWS, #185
agenius-mohammed-ali Dec 27, 2025
c69840c
- Added dbparser vignettes, #185
agenius-mohammed-ali Dec 27, 2025
6ccb2c5
- Enhanced dbparser vignettes, #185
agenius-mohammed-ali Dec 27, 2025
d442b1d
- Updated package version, #186
agenius-mohammed-ali Dec 27, 2025
dee750e
#186, update package website
agenius-mohammed-ali Dec 27, 2025
ed84a60
#186, update package website
agenius-mohammed-ali Dec 27, 2025
02d3822
#186, updated word list
agenius-mohammed-ali Dec 27, 2025
d79fcdf
#186, updated cran comments
agenius-mohammed-ali Dec 27, 2025
6d66e57
#186, updated cran comments
agenius-mohammed-ali Dec 27, 2025
1bdc0a3
#186, Added package paper
agenius-mohammed-ali Dec 27, 2025
a3b929b
Merge branch 'cran_prep_v2.2.0' of github.com:ropensci/dbparser into …
agenius-mohammed-ali Dec 27, 2025
0e87e87
Merge pull request #187 from ropensci/cran_prep_v2.2.0
MohammedFCIS Dec 27, 2025
40d1bb7
#186, added package paper to the ignore list
agenius-mohammed-ali Dec 27, 2025
04fd300
- Added drafting pdf action
agenius-mohammed-ali Dec 27, 2025
ce9d253
- Updated action to be on dev
agenius-mohammed-ali Dec 27, 2025
293360f
- Updated paper
agenius-mohammed-ali Dec 27, 2025
f566407
- fixed yaml file
agenius-mohammed-ali Dec 27, 2025
30714d8
trigger pdf action
agenius-mohammed-ali Dec 27, 2025
274657f
- Updated my job in the paper
agenius-mohammed-ali Dec 27, 2025
5be01a5
- Fixed merging twosides issue
agenius-mohammed-ali Dec 30, 2025
594069b
Merge pull request #189 from ropensci/CETTPolyOtherParser-bug
MohammedFCIS Dec 30, 2025
33c4e95
- Fixed url issue
agenius-mohammed-ali Jan 8, 2026
d075c0c
- Updated fix branch from master branch
agenius-mohammed-ali Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
^doc$
^Meta$
^CRAN-SUBMISSION$
^paper\.md$
^paper\.bib$
28 changes: 28 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Draft PDF
on:
push:
paths:
- paper.md
- paper.bib

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper.md
- name: Upload
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper.pdf
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dbparser
Title: Drugs Databases Parser
Version: 2.0.3
Version: 2.2.1
Authors@R:
c(
person("Mohammed", "Ali", email = "moh_fcis@yahoo.com", role = c("aut", "cre")),
Expand All @@ -12,13 +12,15 @@ Description: This tool is for parsing public drug databases such as 'DrugBank' X
License: MIT + file LICENSE
Encoding: UTF-8
Imports:
data.table,
dplyr,
progress,
purrr,
tibble,
tools,
utils,
XML
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
Suggests:
canvasXpress,
knitr,
Expand Down
18 changes: 18 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Generated by roxygen2: do not edit by hand

export(add_database_info)
export(cett_nodes_options)
export(drug_node_options)
export(merge_drugbank_onsides)
export(merge_drugbank_twosides)
export(parseDrugBank)
export(parseOnSIDES)
export(parseTWOSIDES)
export(references_node_options)
export(show_dvobject_metadata)
export(subset_drugbank_dvobject)
export(subset_onsides_dvobject)
import(dplyr)
importFrom(XML,xmlApply)
importFrom(XML,xmlChildren)
Expand All @@ -16,7 +23,17 @@ importFrom(XML,xmlSize)
importFrom(XML,xmlToDataFrame)
importFrom(XML,xmlToList)
importFrom(XML,xmlValue)
importFrom(data.table,fread)
importFrom(dplyr,.data)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(progress,progress_bar)
importFrom(purrr,"%||%")
importFrom(purrr,'%>%')
importFrom(purrr,is_empty)
importFrom(purrr,is_null)
Expand All @@ -26,5 +43,6 @@ importFrom(tibble,as_tibble)
importFrom(tibble,as_tibble_row)
importFrom(tibble,tibble)
importFrom(tibble,tibble_row)
importFrom(utils,object.size)
importFrom(utils,stack)
importFrom(utils,unzip)
55 changes: 55 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# dbparser

# dbparser 2.2.1

This is a major feature release focused on expanding `dbparser`'s capabilities into real-world pharmacovigilance and drug-drug interaction analysis. The integration engine has been formalized around a "Hub and Spoke" model, with DrugBank acting as the central hub.

## NEW FEATURES

* **New Parser: `parseOnSIDES()`**
* Parses the relational CSV files from the OnSIDES database, a modern resource for adverse drug events extracted from FDA labels.
* Returns a `dvobject` containing the 7 core relational tables and an optional `high_confidence` summary table.

* **New Parser: `parseTWOSIDES()`**
* Parses the TWOSIDES database, the leading resource for drug-drug interaction (DDI) adverse event signals from real-world data.
* Returns a `dvobject` containing the `drug_drug_interactions` table.
* The parser correctly handles known column name misspellings in the source data (e.g., `drug_1_rxnorn_id`).

* **New Integration Function: `merge_drugbank_onsides()`**
* Merges a DrugBank `dvobject` with an OnSIDES `dvobject`.
* Automatically creates an enriched `integrated_data` list, linking OnSIDES data to DrugBank IDs via RxNorm CUIs.
* The function is **chainable**, meaning it can be used in a `%>%` pipeline after other merge functions.

* **New Integration Function: `merge_drugbank_twosides()`**
* Merges a DrugBank `dvobject` with a TWOSIDES `dvobject`.
* Performs a "double join" to enrich both drugs in an interaction pair with their DrugBank IDs and names.
* Uses a robust "union" logic to keep interactions even if only one of the two drugs is present in the input DrugBank object.
* The function is also **chainable**.
* **Subset a DrugBank dvobject function: `subset_drugbank_dvobject()`**
* Intelligently filters a DrugBank dvobject to retain only the data associated with a specified list of drugbank_ids. It correctly handles the deep,
multi-level nested structure of the entire object, including the complex relationships within the `cett` list.
* **Subset an OnSIDES dvobject function: `subset_onsides_dvobject()`**
* Intelligently filters an OnSIDES dvobject by cascading filters through the
relational tables, ensuring the final subset is self-consistent.
* **Adding metadata to existing `dvobject` objects using function: `add_database_info()`**
* **Major enhancements to function `show_dvobject_metadata()`**
* Displays information about passed dbobject object including basic info,
database metadata, and all data.frames contained within nested lists.

* Run `vignette("dbparser_2_2", package = "dbparser")` for more info

## DOCUMENTATION

* **New Vignette: "Integrated Pharmacovigilance"**
* A comprehensive new tutorial demonstrating a full, three-way integration of DrugBank, OnSIDES, and TWOSIDES.
* Includes a complete scientific case study analyzing single-drug vs. polypharmacy risks.
* Introduces a reproducible example workflow using a pre-computed RDS data object hosted externally to keep the package lightweight.
* Run `vignette("drugbank_nside", package = "dbparser")` for more info
* Updated existing vignette and package Readme with enhanced examples

## BUG FIXES & MINOR IMPROVEMENTS

* Several minor fixes are done

---

# dbparser 2.0.3

## Enhancements
Expand Down
8 changes: 7 additions & 1 deletion R/drugbank_parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ parseDrugBank <- function(db_path,
message("Completed loading DrugBank DB into memory")
message("...........................................")
pkg_env$root <- XML::xmlRoot(parsed_db)
dvobject <- add_drugbank_info(dvobject = dvobject)
dvobject <- add_database_info(dvobject = dvobject,
db_version = XML::xmlGetAttr(
node = pkg_env$root,
name = "version"),
db_exported_date = XML::xmlGetAttr(
node = pkg_env$root,
name = "exported-on"))
message("parsing drugs elements")

dvobject[["drugs"]] <- parse_drug_nodes(drug_options)
Expand Down
Loading
Loading