Sharing data is an essential part of being able to get work done using a phone or tablet. While some apps can be useful as islands of functionality (e.g. Green Solvents or ChemSpider Mobile), sophisticated and multifaceted apps like the Mobile Molecular DataSheet or SAR Table achieve their full potential by being able to pass data back and forth between other apps, services and storage locations.
The iOS mobile operating system is very strict about sandboxing apps, which means that each individual app has its own private area where data is stored, and this data cannot be used by any other apps. This is in contrast to the way traditional way that files work on a normal desktop computer, for which the files belong to you, and can be used by whatever applications you choose. Because mobile devices are app-centric and desktop/laptop computers are file-centric, this can take some getting used to.
Sharing of data is facilitated by a variety of formal mechanisms that are built into iOS, or can be composed from available functionality. For purposes of chemical data interchange, these can be divided into the following categories:
Most of the apps produced by Molecular Materials Informatics make heavy use of sharing functionality. These include the Mobile Molecular DataSheet (MMDS), the Green Lab Notebook (GLN), SAR Table, MolPrime, MolPrime+, Approved Drugs, Living Molecules, TB Mobile, ChemSpider Mobile, SPRESImobile, Reaction101 and Yield101. This article will use MMDS, GLN and MolPrime+ as examples for how sharing works.
File importing can occur from any app that allows a file to be launched using just its designated type, but the most familiar scenario occurs when using the Safari web browser. Whenever the browser encounters a filetype that it does not handle naturally, it makes a list of apps that have declared their ability to handle the file.
For example, when using the CDD Vault service to search for compounds, the resulting hitlist can be downloaded in MDL SDfile format. Because this is one of the chemical file formats recognised by the Mobile Molecular DataSheet (MMDS) app, the downloaded file can be launched into MMDS:
Once the MMDS app is selected as the target, it is then launched, with the downloaded file as the payload. The MMDS app responds by bringing up an import panel, which shows summary information about the imported datasheet, provides the option to view it in detail, and several choices as to where to import it. In this example the collection is imported as a new datasheet, which is becomes part of the app's data: it is stored on the device, and can be viewed and edited just like any other content (i.e. accessing the content no longer requires an internet connection because it has been replicated and owned by the app).
There are many online providers of chemical data who provide content that can be imported into one or more of the apps from Molecular Materials Informatics. For example, the ChemSpider Synthetic Pages service provides many examples of chemical syntheses, and many of them allow the reaction to be downloaded in a form that is partly compatible with cheminformatics tools, such as the Green Lab Notebook app:
Generally speaking, there are 3 kinds of chemical data content that can be imported: molecules, reactions and datasheets, where a datasheet is the term used to describe a collection of molecular structures and data, which may have additional metadata associated with it.
The following kinds of file types can be imported into one or more apps:
It should be noted that the matching is done by file type, rather than what is inside the file. This means that picking an app to be launched with a downloaded file does not guarantee it will do exactly what is expected, and for this reason the import process provides the opportunity to examine the content and approve it before bringing it into the app's private data collection.
The method by which files can be imported from other apps is the same for email attachments, remote file system management apps like Dropbox, and many others.
Sending chemical data as email attachments is a very effective method of collaboration. While relatively crude compared to some of the more modern techniques for collectively working on shared documents, it has several key advantages. For all practical purposes, everyone with internet access has an email account. It is heterogeneous and reliably supported by every internet-capable device, which means that as long as the file attachments follow compatible standards, colleagues can make use of the data on any computer, phone or tablet that has suitable software installed. While email attachments do not have any formal method of revision control, the sender and all recipients of an email message can use their inbox as a timestamped archive, which can also serve as a backup.
Preparing an outgoing email with an attachment is a straightforward process, e.g. using MolPrime+ to send a molecule:
The app automatically includes 3 attachments: the molecular structure encoded with the native SketchEl format, which it uses internally, so it is guaranteed that opening it with any other software from Molecular Materials Informatics, or the SketchEl open source sketcher, will be able to handle it without any information loss. The MDL Molfile version of the structure is also included, since almost every cheminformatics software product can parse a common subset of the format. The third attachment is a graphical image rendition of the structure, which is useful in particular because most mail clients will render ordinary image files inline, so the recipient will be able to see what the structure is without having to use a special viewer.
Another advantage of using email for sharing is that it is bidirectional. Incoming mail with chemical data attachments can be viewed on any mobile device, and if the appropriate apps are installed, the data payloads can be launched in a way that is analogous to downloading content from the browser:
Because outgoing email messages can be initiated with any number of attachments, it is often useful to ask the user which kinds should be included. For example, the Green Lab Notebook offers the following dialog prior to sending a single experiment by email:
A variety of attachment types can be chosen, with only the native format being selected by default. Note that many of these formats are graphical (PNG, SVG, EPS, HTML, Word & Excel), which means that it is also useful to offer a choice of colour scheme, metrics and resolution, the latter being particularly important for bitmapped PNG images. It is generally a good idea to include both the raw data, and some kind of graphical preview.
Copying data to the clipboard is the same on mobile devices as for desktop computers. For the most part, clipboard objects are either blocks of text, or bitmapped images. Molecular structures, or higher order collections like reactions, can easily be stored on the clipboard by using one of several different file formats (e.g. SketchEl molecule, MDL Molfile, XML datasheet, SMILES, etc.).
A molecule can be copied onto the clipboard from a variety of different parts of the user interfaces of various apps. For example, in the molecule-specific popup menu for Mobile Molecular DataSheet:
Once the SketchEl-formatted molecule is on the clipboard, it can be recalled in a variety of scenarios, either within the same app or a different one:
There are some cases where it is useful to use the clipboard as a way of capturing graphical representations, in order to paste the image into another app, which does not necessarily understand chemical data formats. For example, using MMDS to create a picture of a molecule:
There are a number of non-chemistry apps that can make use of images of chemical data, for example pasting the drawing into Evernote:
Chemical data objects can be launched from within chemistry apps, such that the operating system takes over and provides the list of possible destinations. This is exactly the same mechanism by which data can be brought in from the browser or email attachments, though from a workflow point of view, it is going in the opposite direction.
With MolPrime+, this can be done by selecting the corresponding menu icon for a molecule:
As with downloading attachments from the browser, the list of qualifying apps is presented, and selecting one of them causes that app to be launched, with the originating object as the payload.
Passing data between apps is commonly done using the generic mechanism, because the app-to-app connections are automatic: any app that registers as being able to open a particular kind of molecule will automatically be added to the list. It is also possible to address apps specifically. For example, the Approved Drugs app presents several specific app icons in addition to the general purpose open-in feature:
One of the advantages of addressing an app specifically is that it can be made accessible with fewer interaction steps. It is also possible for the current app to determine whether the destination app is installed, and offer to send the user to the iTunes AppStore otherwise. By contrast, using the generic destination app selection method means that if a particularly useful target app is not installed, the user will not find out about it.
The file picker mechanism is an interface that allows files to be pushed or pulled to and from a remote file repository, or some app extension that simulates file handling. Some of this functionality overlaps with other data sharing methods, but the key difference is that the exporting and importing process is initiated from within the app of interest, rather than launched from elsewhere. By default, all iOS 8 devices are ready to go with the one default plugin for the file picker, which is iCloud Drive. Exporting a molecular datasheet to iCloud is shown below:
Things get more interesting if other services are installed via certain apps. For example, if the Dropbox app is installed, this is presented as an alternative destination, and provides its own file hierarchy navigator:
In this way chemical data objects can be uploaded to iCloud, Dropbox and any other installed service. The iCloud and Dropbox services in particular allow files to be seemlessly edited across multiple devices, as well as providing group sharing options.
Importing documents follows a similar sequence of navigation the hierarchy to locate the file of interest:
When a chemical datafile is identified, downloaded and parsed, it is treated with the standard importing sequence. In this case, the MMDS app is offering to include the molecule in an existing datasheet, or create a new one.
While the iCloud service can operate as a remotely synched file hierarchy, similar to Dropbox and several other independent services, it also has the ability to reserve designated private areas, which multiple instances of an app can use to share common files. This is useful for people who have more than one iOS device (e.g. an iPhone and an iPad), and want to have the same documents on each, so that the devices can be used interchangeably.
The Green Lab Notebook supports this feature, and makes it particularly simple: within the main menu, the icon at the top right of each of the experiment blocks indicates the status:
The first icon indicates that the experiment datasheet is private stored in the app's own local stash, while the second icon indicates that it is stored in the iCloud folder, which means that it is being synchronised between devices. Tapping on the icon toggles the status, i.e. moves it back and forth between the local and online storage forms. The status of iCloud synchronising can also be viewed in a panel, which also presents the opportunity to import experiments, which is a necessary step for linking a document that was created on a different device:
The sharing methods described up until this point are used for private or selective distribution. Sometimes the objective of sharing is not to disclose a chemical data document to several people, but rather make it available for the entire internet to use. Achieving this requires a centralised location to which the data can be uploaded, so that the content can be shared by publicising a URL.
While the internet abounds with ways to publicly share content of various sorts, the sharing of chemical data has particular needs, since it consists of highly structured information and graphical diagrams derived from that information. The best way to share data is to store it in the original format, which could be accomplished via any sharing site that stores text or binary data, but this is unhelpful to the user of such data, because it would appear as a collection of cryptic symbols. It seems much more intuitive to share the graphical picture of the chemical data, since anybody can see what it is, but doing this means that the original data is lost, i.e. it is not possible to import a picture of a molecule and edit it as a molecule.
The molsync.com service addresses this particular issue specifically. It allows chemical data to be uploaded (molecules, reactions and datasheets). The result of the upload is a unique URL that can then be shared by any means. The data is stored in its raw machine readable form, and then converted into a visual representation whenever somebody browses to the link. The raw data can be accessed by software, or it can be dynamically converted to a variety of different formats using the web user interface.
Uploading a molecule or datasheet with the Mobile Molecular DataSheet (MMDS), among others, is a simple matter of selecting the menu icon, then confirming the upload:
Once the upload is complete, the URL is shown. The upload process is completely anonymous, and once the data has been transmitted, it becomes available to anyone with the link. The link can be viewed on the device by tapping on it:
The molsync.com web page behaves the same way on a mobile device or a regular desktop browser. When used passively it simply displays the data, but clicking the Download button brings up a menu of format translations and graphics preparation.
There are a number of use cases where it is desirable to directly share chemical data using a social network. This is a two step process, the first of them being to upload the data to molsync.com as described above, and the second being to transmit the resulting URL. Currently a number of apps support Twitter integration in this way. For example, MolPrime+ can be used to emit a tweet:
Note that in order for this to work, a Twitter account needs to have been configured via the Settings panel, and the app needs to have been granted permission to use it (which is a simple matter of agreeing by pressing a button the first time it is accessed). Because the social media integration is built into the operating system, the configuration process is relatively streamlined: the interface is the same for all apps using the service.
The sharing methods described up to this point have been of the bidirectional or user-initiated variety. There are, however, a number of useful public services that are available for sharing their chemical data with you. One of the prominent examples is the integrated ability to search a variety of chemical databases, which is built into the Mobile Molecular DataSheet (MMDS), SAR Table and MolPrime+.
The search process can be initiated using familiar functionality, such as name search, exact structure, substructure or similarity:
By default, the search federates results from ChemSpider, PubChem and ChEBI. Since substructure and similarity searches can take some time to complete, and the back-end service is busy merging duplicates, the progress indicator is shown as a growing collection of molecules which are shown in haphazard form as they come in. Once the search is complete, a more gracefully presented list of search results is made available:
The results from a search are treated in the same way as importing a new datasheet.
The iOS mobile operating system provides many different ways to pass data around, where it be from one app to another, between devices, to or from the open internet, between specific collaborators or via specialised file sharing services. Being able to import, export and share data is essential to being able to use mobile apps for productive work, and this is especially true of a scientific field like chemistry. The apps from Molecular Materials Informatics leverage these sharing capabilities as much as possible in order to maximise their utility.