Copyright©2012 Aileen Day
James Jack from Accelrys has developed a great example of using ChemSpider web services to add ChemSpider search functionality with the structure drawing tool Accelrys Draw.
It is now possible, with a new add-in to perform advanced searches on ChemSpider with the Accelrys Draw program itself, searching by text, structure searches (exact, similarity and substructure), elements (those present and those absent), intrinsic and predicted properties, and LASSO activities. All of the ChemSpider information about the compounds returned in the search can be viewed and their structure(s) loaded back into the main Accelrys Draw window for further editing.
If you’re interested in finding out more about this add-in or obtaining it then see James’ blog post about the add-in. He has also posted a video demonstrating its use:
Technical details for developers
James has modularised his code so as to separate out a .Net Client API to the ChemSpider Search web service that can be used from *any* .Net application without the need for additional assemblies (other than standard .Net) and requires minimal code. This makes it easy to add the same ChemSpider search functionality to other Accelrys products (e.g. Symyx Notebook).
In addition, he has released this ChemSpiderSearchClient code so that it is available to other ChemSpider users who would like to integrate ChemSpider web services with their code in similar ways.
The “ChemSpiderClient” solution should be opened with Visual Studio. It contains two projects – “ChemSpiderClient” is the main library project (which contains the ChemSpider API code) and “ChemSpider ClientTest(No Draw)” is a simple interface to run the library code (set this as the start up project to debug the project). “ChemSpiderClient.cs” in “ChemSpiderClient” is the main code file that calls the ChemSpider webservices. Best practice for performing ChemSpider searches is observed – first launching a search to retrieve a transaction ID for the search, intermittently searching for the status of the search using the GetAsyncSearchStatus operation of Search.asmx and when the status of the search is “ResultReady” and then retrieving the resulting ChemSpider Ids. If the reference to Symyx.CustomUIControls from the ChemSpider Client is missing then add a reference to Symyx.CustomUIControls.dll in the top-level folder of the zip file.
Please note that a token is needed to access the ChemSpider webservices and by default the code is supplied without one specified, so that you need to input your own token value – the app.config file of “ChemSpider ClientTest(No Draw)” should be edited to enter a valid token that will be used by default. If this isn’t done, the user will need to supply a token when running the search via a pop-up box. To obtain a token, please complete the registration process – when you are registered the Security Token is listed on your Profile page.