Updated Chemcaster Admin Interface

The Chemcaster admin interface has been updated to improve ease of use. In particular, page style has been unified across all screens. Additional improvements in the near term will focus on fully implementing all page features and providing in-place documentation to the Chemcaster Web API.

Chemcaster is the cheminformatics Web services platform for creating chemistry-oriented websites without installing or maintining cheminformatics software. Chemcaster consists of a browser-based administrative interface and a Web API based on a REST architecture.

To create a free account during the testing period, please request an invitation code.

Creating New Structures Using the Chemcaster API

Chemcaster is a new service designed for creating chemistry-focused websites without cheminformatics software.

One of Chemcaster's central services is the Registry. A Registry is a collection of structures with business rules that determine when and how a structure can be added.

After creating a Registry using the browser-based admin tool, Structures can be added via the Chemcaster Web API. The process consists of:

  • Creating an XML file containing the elements "<structure>" and "<name>". Fill <structure> with a V2000 molfile and <name> with a valid name for the structure.
  • Issuing an HTTP POST request to https:chemcaster.com/registries/{id}/structures, where {id} is your Registry's identifier.

The XML Payload

As a specific example, to add a pyridine structure to a Registry with ID 223, we could first save the following XML file as "pyridine.xml" in our working directory:

<?xml version="1.0" encoding="UTF-8"?>
<structure>
  <molfile>[NO NAME]
  CHEMWRIT          2D
Created with ChemWriter - http://metamolecular.com/chemwriter
  6  6  0  0  0  0  0  0  0  0  0 V2000
   -1.2400    1.0200    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3740    0.5200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.4921    1.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.4921    2.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3740    2.5200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2400    2.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4  5  1  0  0  0  0
  5  6  2  0  0  0  0
  6  1  1  0  0  0  0
M  END</molfile>
  <name>pyridine</name>
</structure>

The POST Request

Next, we could issue a POST request using cURL:

$ curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -F upload=@pyridine.xml -u you@example.com:password https://chemcaster.com/registries/223/structures

The Response

If successful, the POST request will return a response, the body of which will contain another XML document with details of the Structure we just registered:

<?xml version="1.0" encoding="UTF-8"?>
<structure>
  <inchi>InChI=1S/C5H5N/c1-2-4-6-5-3-1/h1-5H</inchi>
  <molfile>[NO NAME]
  CHEMWRIT          2D
Created with ChemWriter - http://metamolecular.com/chemwriter
  6  6  0  0  0  0  0  0  0  0  0 V2000
   -1.2400    1.0200    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3740    0.5200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.4921    1.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.4921    2.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.3740    2.5200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2400    2.0200    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4  5  1  0  0  0  0
  5  6  2  0  0  0  0
  6  1  1  0  0  0  0
M  END</molfile>
  <name>pyridine</name>
  <registry-id type="integer">1</registry-id>
  <id>pyridine</id>
</structure>

The new structure is now available at https://chemcaster.com/registries/223/pyridine.

Conclusions

Chemcaster's Registry service simplifies the management of collections of chemical structures. Using nothing more than standard RESTful HTTP, it's possible to programmatically manipulate collections of structures for use in your own Web applications.

Smooth ChemWriter Deployment

When using any browser plugin technology, it is important to respond appropriately when the underlying plugin is either not installed or unavailable. This post summarizes the resources available to help ensure your ChemWriter deployments go off without a hitch.

Detecting Java

There are a number of ways to detect Java on a client's browser. One of the simplest and most effective is to use fallback content for the <object> tag. This content gets rendered in the event that a client lacks a plugin capable of responding to the surrounding <object> tag.

Displaying the Applet

JavaScript libraries can make applet deployment much more convenient and less error prone. For your convenience, we offer tips on ChemWriter deployment best practices.

Helping Your Users When Things Go Wrong

Even with fallback content, your users may be uncertain how to proceed. To address this issue, it is very helpful for your site to offer system-specific instructions for enabling Java. The ChemWriter site does this through the gateway link http://chemwriter.com/java. Depending on your browser, you'll be directed to one of four pages:

Conclusions

ChemWriter can be effectively deployed across a diverse array of systems by following some simple guidelines. Using fallback content, properly detecting Java, and offering system-specific help when Java is not available can go a long way to ensuring the best possible user experience.

Chemcaster: Collections Are Now Registries

The Chemcaster REST Web API has been updated to better reflect the concepts being modeled. A "Collection" is now called a "Registry," or in other words, a collection of compounds with business rules applied to it. We plan to roll out more features for customizing these business rules in the months ahead.

As an example, the new URL pattern for accessing a structure called 'benzene' in Registry 8472 is:

/registries/8472/benzene

Similarly, a 200x200 PNG can be obtained by GETting:

/registries/8472/benzene.png

Likewise, a new Query can be performed by POSTing to:

/registries/8472/queries

ChemWriter Featured in Java One Presentation from Sun

At the recent JavaOne 2009 conference, Jeff Hoffman, Jindrich Dinga, and Karen Stanley discussed ways to create effective user experiences with Java. ChemWriter and its deployment demonstration are highlighted (see slides 83-87). We're grateful for the mention and continue to look for way to improve ChemWriter's user experience.