How can I get all drug related data using 'dbparser' for my own dataset?

Hello, I have to parse data from drugbank database. So, I found, I can parse drugbank dataset using dbparser.

I have found guidelines here. So, when I am running the code given on the pages, I found very little data. For example, only 398 rows for drug interaction. I think it must be very bigger than the resultant one.

Code is given from here

# Load dbparser package
library(dbparser)
# Create SQLite database connection
database_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# DrugBank database sample name
biotech <- "drugbank_record_biotech.xml"
# Use DrugBank sample database in the library
read_drugbank_xml_db(system.file("extdata", biotech, package = "dbparser"))
# Parse all available drug tibbles
run_all_parsers(save_table = TRUE, database_connection = database_connection)
# List saved tables
DBI::dbListTables(database_connection)
# Close SQLite connection
DBI::dbDisconnect(database_connection)

Now, I would like to know, is there anyway, I can parse my own dataset (which one is downloaded from drugbak using this package? The question might be silly, but I will grateful if you show me any path for parsing the dataset.

Any kind of suggestion is appreciable.

2 Likes

Hi @Akib62. I’ve pinged the dbparser maintainer on twitter asking them to answer here.

1 Like

Hello @Akib62,
Thanks for using dbparser :slight_smile:. Kindly find the answers below:

  • The data is little after running the above example as they are just an example data that exists in the package and not DrugBank database.
  • To use your downloaded dataset from DrugBank, please follow these steps:
    • Use the specific location and name of your database say “c:/mydata/drugbank.xml”
    • Then run the following command read_drugbank_xml_db("c:/mydata/drugbank.xml")
    • Then use any parser you would like.
  • For more information kindly review this tutorial DrugBank Database XML Parser • rOpenSci: dbparser

Thank you and happy Friday :slight_smile:

1 Like

Hello @Mohammed_Ali @stefanie

Thank you very much for your kind responses. Yes, the problem is solved. Now, I can extract information from my own drugbank XML dataset.

However, I think the drug_salts() parser has some bugs (I am not sure). Because, as per the documentation, this parser must return 11 variables but I am getting only 8 variables.

drugbank-id,name,unii,cas-number,inchikey,average-mass,monoisotopic-mass,parent_key

The most important info SMILES is missing. I badly need the SMILES structures. Could you tell me, I can solve the issues?

Thank you very much, for your support.

1 Like

Hello @Akib62,
The extera 3 variables can be retrieved using the non free version of DrugBank database.
However, the good new is that SMILES, among other properties, can be retrieved using drug_calc_prop parser.
Here is the detailed documentation about these properties Drug Calculated Properties — Calculated_Properties_Drug • dbdataset
In general, I recommend you to use this documentation Function reference • rOpenSci: dbparser for parsers returned datasets details as dbdataset package is a data packaged from parsing DrugBank using dbparser.
I hope that will help.
Best Regards,

2 Likes

Thank you. Problem solved.