SketchEl2 as an Electron app (web runtime on the desktop)

sketchel2Some recent developments in porting core cheminformatics functionality to the web have been released as an open source project called WebMolKit (see GitHub) which has its own built in sketcher. A logical followup to this is to package up the functionality as a desktop app, using the Electron wrapper.

Many years ago I created an open source project called SketchEl, which was motivated by the absence of any decent molecule editing software that ran on Linux. This personal itch was scratched by creating a relatively straightforward tool using Java and its Swing toolkit, which provided a reasonable user experience (by the standards of the time) on Linux, Unix & Windows. Progress marches on, and new platforms have come and gone, each with their own platform compatibility issues. Various development frameworks claiming to be cross platform all have their issues, and are generally a moving target: for a long time there weren’t any really good options. But things have finally changed now that the web runtime has matured into something capable of running quality software – and beyond the value of being able to host sophisticated tools on a web page, there are similarly exciting developments for bringing this functionality to the desktop.

Enter Electron: it’s entirely possible that you may already be using it on the desktop and didn’t notice that the application is built with the same tools that run the client part of the web, wrapped in a stripped-down version of the Chrome browser. And that’s where SketchEl2 joins in: the original desktop application is still useful, but the framework is showing its age, and the sourcecode has suffered from neglect. Although a few holdouts may disagree, Java is not the platform of the future for the desktop (that ship sailed a long time ago). There are currently two real choices: go native and accept the burden of multiple codebases, or figure out how to get the web runtime to do your bidding.

The last option is off to a reasonable start. Wrapping the sketcher functionality of WebMolKit into the Electron framework, and working with all of the Node.js extensions to what normally lives in a browser, is rather hacky – and not to mention new (in a bad way). The good news is that all this stuff can be treated as glue, to stick together the core UI and algorithms that make up the bulk of the cross platform codebase.

So far the application can offer the sketcher functionality, and a few menu options, like opening molecules in new windows. With a few more extensions for OS interaction (e.g. save as, cutting & pasting, etc.) and a bit of work to figure out how to package it up for convenient deployment on the three major platforms, this project should be ready for an alpha preview.

Advertisements

One thought on “SketchEl2 as an Electron app (web runtime on the desktop)

  1. This is a really great idea. Not just that there aren’t many 2D sketchers, but it’s a nice concept in revitalizing desktop cheminformatics IMHO.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s