Skip to contents

Subset a DrugBank dvobject by a vector of DrugBank IDs

Usage

subset_drugbank_dvobject(dvobject, drug_ids)

Arguments

dvobject

The dvobject from `parseDrugBank()`.

drug_ids

A character vector of `drugbank_id` values to keep.

Value

A new, smaller dvobject with the same structure and attributes.

Details

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.

Examples

if (FALSE) { # \dontrun{
library(dbparser)
one_drug <- subset_drugbank_dvobject(dvobject = dbdataset::drugbank,
                                     drug_ids = "DB00001")
} # }