A mobile interface to the Registry of Standard Biological Parts

Recently I developed a simple mobile interface to the Registry of Standard Biological Parts – the database that is currently the focal point for parts-based synthetic biology. I’ve called this mobile interface mPartsRegistry and I thought it would be worth outlining it’s features and sharing some notes about the project, in case someone else finds it useful.

mPartsRegistry is a simple interface to the Registry of Standard Biological Parts aimed at mobile smartphone browsers. It’s powered by the Parts Registry API, which provides a simple RESTful interface to key metadata about parts in the database. It features:

  • A simple interface tailored for mobile WebKit browsers (Android browser, mobile Safari, probably others). Web-based, zero-installation required.
  • Basic search of the Registry by part name.
  • “Favorite parts” to locally bookmark parts on your device.
  • Provides basic metadata associated with parts, including size, description, authors, DNA sequence, categories and availability.
  • Freely available and recyclable source code, released under the MIT License (fork it on GitHub).

The idea for a mobile interface to the Registry came out of a moment in the wet lab, where I was supervising the Monash iGEM team, and someone asked “How many basepairs is that part again ?”. I’ve found most ideas for smartphone apps in the lab a little contrived; nothing more than an excuse to jump on the Android or iOS app bandwagon, with limited practical utility. This was a situation where I could genuinely see a use for a simple mobile interface to look up some reference information, so I thought I’d create it.

The goal is not to completely replicate the functionality of the Registry (at this stage the API would not allow that anyhow), but to provide simple mobile-friendly interface to quickly look up important data about a Biobrick(tm) parts in a laboratory setting, where accessing a desktop computer is often less convenient. In this context, you generally know the part name (eg B0034) that is written on a tube, but would like to quickly lookup some details.

The project consists of two main parts: the web frontend, build using jQTouch and Django templates hosted on Google App Engine, and the parser backend (partsregistry.py) that deals with directly querying the Registry API.

The application uses BeautifulSoup on the server side to parse the XML served by the Registry’s API. This parser may be useful as a generic Python interface to the Registry API for other projects, although it is not yet feature complete. Why parse the XML on the server rather than the client ? The Registry API does not offer JSONP callbacks, making direct client-to-API queries by a web app served from another domain tricky (Same Origin Policy, yadda yadda). While this probably could have been done in straight clientside Javascript if I’d used some type of cross-domain AJAX hack, parsing on the server side also opens the possibility in the future to ‘value-add’ to the data in some way, potentially incorporating extra data not served directly by the Registry API, before it’s sent to the client.

Google App Engine works as a cheap hosting solution for a low traffic app like this, which is likely to stay within the free quotas. Also, GAE supports Python, and I like Python. jQTouch makes for a reasonable cross-platform mobile web interface, since it is optimized for WebKit-based browsers. While officially jQTouch supports iPhone/iPod Touch and doesn’t have official Android support, in my hands it works well enough on Android (and in fact displayed some minor bugs on Mobile Safari that were not evident on Android). Typically when using jQTouch you are expected to load multiple ‘pages’ all into several div-sections, lumped into a single HTML document. jQTouch then does the Javascript+CSS magic to render fast page switching, which actually working within a single HTML document. Since the main action of this app is to ‘search’, we don’t yet know what the results page will be, so this nice feature of jQTouch is barely used.

Searching for the same part all the time can get annoying, so mPartsRegistry provides a simple ‘bookmarking’ feature where a list of favorite parts can be managed and stored on the device. This is implemented via HTML5 localStorage – if there was demand then this could easily be turned into server side storage, but I doubt it’s necessary. In the future, it might make sense to pre-cache the metadata for any of these “favorite parts” so that the fast page switching features in jQTouch can be used to full advantage.

Currently, the interface does not show information about sequence features, subparts and twins, however I plan to implement these at some point. The Registry API currently does not provide information about samples, literature references or lab groups, but once these are enabled I plan to support this metadata within mPartsRegistry too.

Okay, that’s all kids .. and remember .. take off your gloves before using your smartphone in the lab !

The Great Australian Internet Blackout WordPress Plugin

Normally I stick to posts about science and technology on this blog. Like most Australians, I vote in elections, try to remain informed, but otherwise stay away from getting involved in politics. However, occasionally certain things become important enough issues that they need to be advertised more widely.

As you may know, the Australian Federal Government is attempting to censor the Internet within Australia by forcing ISPs to block a list of websites. This proposed internet filter will not be optional; it will effect all Australians, and the blocklist will compiled by a small group of people. The list of blocked sites will remain secret, so the Australian public will find it difficult to determine if this power is being abused. It will not prevent the spread of illegal material, which is typically shared via peer-to-peer networks that will not be blocked by the internet filter. If it is not already self evident why this approach to internet censorship is both an ineffective, a waste of resources and a potential threat to the freedom of information flow required for a healthy democracy, you can read more at the Great Australian Internet Blackout site and the Electronic Frontiers Australia site.

The Great Australian Internet Blackout is a combined online and offline demonstration against this imposed online censorship. For one week – January 25-29th – Aussie websites will “black out” to inform an even wider audience about the threat of imposed censorship.

This is what it looks like right now. I'm guessing that on January 25th something exciting will appear inside that popup box !

This is what it looks like right now. I'm guessing that on January 25th something exciting (or educational) will appear inside that popup box !

Continue reading

Occyd : tagging for locations

Occyd Map View (search results)

Those who have been watching may have noticed I quietly started developing an Android application in the last month or so. It’s still super-buggy and far from feature complete, but I thought it was time to announce it here (“release early, release often”). It’s not ready for real users yet, but developers may like to take a little look.

Continue reading

QR-code bookmarklets

A quick post to share some bookmarklets I made.

I’ve found QR-code “2D barcodes” really handy when playing with my Android phone.

qrcode

Sometimes, I have a web page open on my desktop PC, and I want to quickly load it in the Android Chrome browser to see what it looks like. Rather than re-typing it with my thumbs, the Barcode Scanner application allows me to scan a QR-code from the screen of my computer, and if the decoded text contains a URL, open it in the Android browser.

These two bookmarklets turn the URL of the current page that is open in your browser into a scannable QR-code:

Google Charts API based bookmarklet: Drag this link –>Current URL to QR-code to your bookmarks toolbar.

The code is:
javascript:location.href='http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl='+escape(location.href);

Alternatively, I made a Kaywa QR-code generator version. Drag this link –>Current URL to QR-code to your bookmarks toolbar.

The code is:
javascript:location.href='http://qrcode.kaywa.com/img.php?s=8&d='+escape(location.href);

They both do the same thing, so you probably only want one. Only tested on Firefox.

(Update:  seemed WordPress ate the javascript in the bookmarklet links … should be okay now)

A Greasemonkey script: Library Ezproxy Forwarder

Update: I’m typically using Google Chrome or Chromium these days, so it’s unlikely I’ll update this script in the future. For a similar extension for Chrome, try the EZProxy Redirect extension.

Many University libraries use some server software called Ezproxy to do authentication and arbitrate access to full-text online journal subscriptions. Essentially, Ezproxy uses some URL mangling, rewriting all hyperlinks, to pass traffic via the proxy (rather than using a conventional browser proxy setting). For example, http://www.sciencemag.org/cgi/content/full/313/5785/314 is changed to http://www.sciencemag.org.ezproxy.lib.unimelb.edu.au/cgi/content/full/313/5785/314 . If the user is not logged in to the proxy (ie has no fresh & valid cookie), a login screen is given before being forwarded to the journal site.

This plugin helps mangle URLs to add the proxy domain to outgoing links from various journal sites as well as NCBI PubMed (eg, like .ezproxy.lib.unimelb.edu.au), meaning that the user doesn’t actively have to go to their library site to follow “ezproxy-fied” links. It makes getting full-text articles via the institutional library proxy a more seamless experience (assuming that your library subscribes to the journal).

The plugin contains a list of journal and publisher sites at which it is active, plus some “special case” code for making sure only fulltext links outgoing from NCBI PubMed are handled. You can add your own journal sites as needed.

The user needs to edit the variable proxyname to make the script use their institutions EZproxy … I can’t really help you with that part, since I only know that my workplace (The University of Melbourne) uses .ezproxy.lib.unimelb.edu.au .. beyond that, you are on your own 🙂 !

I’ve uploaded the Library Ezproxy Forwarder script to Userscripts.org