Monday, November 26, 2012

Scribl is Neat!

Speaking of Twitter, one thing I've found it highly valuable for is discovering new tools and ideas in the bioinformatics space.  It's not a replacement for all my other methods, but I've discovered things I otherwise would have missed.  A great case in point is Scribl, which I discovered over the holiday period and vowed to try out this morning.  WOW!
Scribl is a JavaScript library for creating genome browsers and similar genomic visualizations.  I had previously been doing these in SVG, using a custom library built atop the Perl SVG libraries.  I could have also built atop GD, but I originally wanted the tooltip functions that SVG offered, though I never really got them to work well..  The rub with this approach is that the Perl libraries are very low level, so I had to build the higher levels myself.  Nothing wrong with that, but it's great to have high-level stuff built for you.  Also, SVG is an elegant standard, but not well-supported outside browsers -- so to drop in a PowerPoint for example I was always screen-capturing Yes, there is an SVG plug-in for PowerPoint, but unless you ensure it is installed on every machine your slide deck might be displayed on, you're asking for trouble.  HTML5 is well known to be the standard Steve Jobs insisted on for iOS, with his famous slam on the competing Adobe Flash; the idea of being tablet & smartphone ready is yet one more feather in Scribl's cap.

What's particularly beautiful about Scribl is that the library comes with multiple examples, and bit looking at these I was able to convert one of my SVG generators to a very similar HTML5 generator in just a few hours of work this morning, despite the handicap of having no HTML5 experience and not writing JavaScript since the mid-90s.  There's a little functionality of the old viewer I haven't yet transferred, but I got a nice ruler bar, tooltips and zooming from the example.  Zoom doesn't quite work in my version; something to slug away on later this week.

Scribl provides many high-level functions, such as drawing typical 'pointed bar' ORF markers, laying out your display into a series of tracks, etc.  I haven't even dug yet into the example that displays a BAM file!  Drag-and-drop, conversion to PNG, parsing a Genbank file -- all built-in!

No comments: