Sharing public data with MolSync

MolSync v1.1.1 is now available on the AppStore, and it comes with a subtle little menu option that is available when browsing your Public folder:

Sharing a molecule from the public folder.

Selecting this menu option composes a special URL and launches it with the mobile browser:

A public molecule, ready for sharing.

If you are a user of Dropbox, you may know that each account has a special folder – /Public – which makes its contents available to anyone for downloading, as long as they formulate the URL correctly. MolSync takes advantage of this feature when you select the Open in Browser menu item, by combining it with an experimental feature provided by the website, which has some complex and fairly convoluted machinery to present your data on the web.

For some examples, try these links:

Each of these links display some kind of chemical data. If you click on them all, you will notice that caffeine.el and caffeine.mol are the same, because they are both molecule formats, as are datasheet.ds and datasheet.sdf, which are both datasheet formats, representing the same chemical content.

At a glance, this might look like several rather ordinary web pages that happen to contain embedded images of chemical data. But this is not the half of it. Firstly, the content is completely dynamic, and secondly, it is chemically aware, both on the client and serverside. The process of generating a page goes something like this:

  • a JavaScript-heavy web page is loaded up, and asks the server to furnish it with the appropriate data
  • the server ( downloads the chemical data from the public Dropbox folder, or fetches it from a cache
  • the web page receives a properly parsed-out version of the data, and uses it to construct a display
  • each graphical component, i.e. molecules and reactions, is rendered by asking the server to help out by handling the layout (atoms, bonds, reaction arrows, that sort of thing), and then the web page renders the content using vector graphics

One of the key points here is that each of the molecule images is a vector graphic, not a bitmap. That means if you zoom in the page to any resolution, it does not get grainy or blurry; similarly if you decide to print the page or turn it into a PDF, it retains its sharpness.

The part where the major value proposition shows up is when you click on the Download button:

In the above examples, the dialog box is offering to let you download a collection of reactions, in any available format. The list of formats varies depending on the data. In this case, there are two cheminformatics formats: DataSheet XML, which is the native format of MMDS and any other software produced by Molecular Materials Informatics, and MDL RDF is the industry standard format for sharing collections of reaction data. Three graphics formats are available: ZIP files: either with PNG or SVG content, one file for each graphical object, in this case reactions, and HTML, with graphical objects represented as embedded SVG diagrams. When downloading content for individual molecules or reactions, the graphics options are more straightforward, e.g. a single PNG or SVG file.

Downloading source data in a cheminformatics format will perform the conversion on the fly. The same applies to graphics, which means there is an opportunity for you – the downloader – to decide on parameters for rendering the graphics. You can choose the colour scheme, rather than having it chosen for you, which tends to vary depending on the objective, e.g. preparing graphics for a website often looks better in colour; preparing graphics for a published manuscript is usually done in black’n’white; or, if you want to put a molecule diagram on a PowerPoint slide that has a dark background, white-on-black or colour-on-black is the way to go.

While for SVG graphics the resolution does not particularly matter, since vector graphics are resizable, the pixel count is critical for generating bitmapped PNG output. For generating graphics for web placement, the lowest possible resolution should be used, to save on bandwidth, and to account for the fact that a lot of web browsers use a terrible resizing algorithm. For publishing bitmapped graphics, you need to crank up the resolution to something equivalent to at least 300 dpi, otherwise your manuscript will look bad when it rolls off the press.

So the MolSync app data sharing via is a handy way of making chemical information available, dynamically, so that anyone can view it, and obtain the content in a variety of different formats, with the ability to tweak parameters. There are also a number of convenient little icons at the top of the page:

These are the social media sharing buttons. Since the URL is fixed – as long as you leave the original content in the same place on your Dropbox public folder – it is appropriate to share the URL with whomever you wish, so tweeting, facebooking, etc., is all fair game.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s