I'm working on my project with Java and I was having trouble finding ways to incorporate the database I want into my code. I can figure out how to generate the right inputs, but I'm confused as to how I query the database in the first place. The modules we learned about used Javascript, but not Java. How might I go about coding in functionality that lets me access databases?
In module eight, we learned how to format URLs for sites like PubChem in order to look up specific pieces of information about a compound. For my project I need to look up dissociation constants online in order to use in my program. As it stands right now, I'm having to use a less robust database to search for dissociation constants. I would like to use PubChem for this search, but I don't know how to format the URL to access that information. The compounds have dissociation constants on the PubChem page, but I don't know how to access it via the PUG REST interface.
Hi, Ben,
PUG-REST does not support programmatic access to pKa or pKb values. Instead, you need to use another protocol called PUG-REST-View, which allow you to access all data presented in the Compound Summary page for a particular compound.
For example, the Compound Summary page of CID 91757643 can be accessed via the URL:
<a href="https://pubchem.ncbi.nlm.nih.gov/compound/91757643">https://pubchem.ncbi.nlm.nih.gov/compound/91757643</a>
And all the data presented in this Compound Summary page can be programatically accessed via the PUG-REST-View:
<a href="https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/91757643/JSON">https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/91757643/JSON</a>
Note that this PUG-REST-View request will give you *ALL* information on the Summary page, so you need to write a short program to extract dissociation constants from the downloaded data. Does you or your colleague have basic programming knowledge?
In my previous message, I happened to use the URL beginning with "<a href="https://testpubchem">https://testpubchem</a>..." (not "<a href="https://pubchem">https://pubchem</a>..."), which is for our test server. I've fixed the URL (in the previous message) to the correct one.
By the way, you can actually download a "part" of the data displayed on the Compound Summary page through the PUG-REST-View (also called PUG-View), by suffixing the URL with an optional parameter for a particular section. For example,
<a href="https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/91757643/JSON?heading=Dissociation%20Constants">https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/91757643/JSON?heading=Dissociation%20Constants</a>
This will allow you to download the "Dissociation Constants" part of the data, but you still need to parse the data.
Comments 4
Utilizing Databases with Java
How to access dissociation constants/(pKa & pKb) on PubChem
Need to use PUG-REST-View instead of PUG-REST
Correction and addition