Module 8: Assignment

Week I activities

 

Activity 1

Choose a chemical and, using the web services presented in this module, obtain as much information as you can about it. Present the collected information in a report indicating, for each piece the complete URL (parameters included) for the query and the response obtained.

 

Activity 2

Make a diagram or schema that summarizes which APIs allows you to convert from one information of a chemical to another. At least, the schema should include the following informations: name, IUPAC name, molecular weight, boiling point, SMILES, unique SMILES, mol file, InChI, formula, 2D molecular drawing...

 

 

Week II activities

 

Activity 3

Adapt one of the example documents annexed to part 8.6 to resolve a CAS RN from a substance name and vice versa.

 

Activity 4

Choose a specific property and design a minimal program (spreadsheet, Basic, JS or Google script) that searches its value for a chemical introduced by the identifier of your choice.

Rating: 
0
No votes yet
Join the conversation.

Comments 8

Alex Williams (not verified) | Tue, 11/17/2015 - 12:46
I am interested in using the Cactus API to pull SMILES from a given molecule name, what would be the best approach to do this in a java environment? I have used XML parsing for other portions of my project, but I am not entirely sure the same thing would work in an HTML document to grab the name.

Jordi Cuadros's picture
Jordi Cuadros | Tue, 11/17/2015 - 15:25
Hi Alex, Information about making HTTP request in Java can be found at <a href="http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html">http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html</a>. In example on using Cactus API to pull SMILES from a name is given in part 8.3 (<a href="http://cactus.nci.nih.gov/chemical/structure/aspirin/smiles">http://cactus.nci.nih.gov/chemical/structure/aspirin/smiles</a>). The response is plain text so there is no need for parsing. Jordi Jordi

Alex Williams (not verified) | Tue, 11/17/2015 - 12:49
Why do some of these web services require tokens? Do they use them in a way to stem from mass downloading of chemical data, or is it simply just a foresight on bandwidth usage?

Jordi Cuadros's picture
Jordi Cuadros | Tue, 11/17/2015 - 15:26
Hi Alex, Tokens are a form of user authentication. I nice explanation of their use can be found at <a href="https://scotch.io/tutorials/the-ins-and-outs-of-token-based-authentication">https://scotch.io/tutorials/the-ins-and-outs-of-token-based-authentication</a>. They allow for an stateless (RESTful) authentication when some services need to be restricted to some users, use of the service wants to be monitored or for-a-fee services are involved. Jordi

Daniel Graham (not verified) | Tue, 11/17/2015 - 14:11
How would one convert from boiling point to any of the other information? Is there an API that allows one to get a list of molecules with a specified BP?

Jordi Cuadros's picture
Jordi Cuadros | Tue, 11/17/2015 - 16:33
Hi Daniel, Although ChemSpider and CHEMnetBASE allow searching by boiling point, these databases don't offer a RESTful web API to make this search. ChemSpider seems to offers a SOAP access to this type of search but I haven't tested it. Alternatives that could work are: - web scrapping Kaye & Laby (table 3.3): <a href="http://www.kayelaby.npl.co.uk/chemistry/3_3/3_3.html">http://www.kayelaby.npl.co.uk/chemistry/3_3/3_3.html</a> - using The Organic Compound Database at <a href="http://www.colby.edu/chemistry/cmp/cmp.html">http://www.colby.edu/chemistry/cmp/cmp.html</a>. Search by boiling point can be automated like <a href="http://www.colby.edu/chemistry/cmp/fd.cgi?BP=320">http://www.colby.edu/chemistry/cmp/fd.cgi?BP=320</a> (Replace the last number for your boiling point in Celsius) Jordi

Bob Hanson's picture
Bob Hanson | Fri, 09/02/2016 - 08:24
- https:// for all US government sites and also ChemSpider - describe use of jQuery $.ajax() to simplify JSON return and introduce asynchronous JavaScript calling

Herman Bergwerf | Fri, 09/02/2016 - 09:07
Do you think it might be a good idea to use a standard API for AJAX? JS has Fetch now (<a href="https://davidwalsh.name/fetch">https://davidwalsh.name/fetch</a>) and apart from being a standard, it also uses a modern and very useful JS feature called Promises (this is for asynchronous programming). I'm not perse against jQuery, but it's considered a slightly outdated by new JS and DOM standards, and it's usually a bad programming practice to include jQuery in your project only for basic utilities like AJAX.

Annotations