Tuesday, January 24, 2012

WebSharper Goes Green: Staph Genome Viz

I have been thoroughly enjoying our latest project at IntelliFactory. Me and Loïc Denuzière, the creator of FPish, are working together for the U Nebraska Medical Center on genetic visualization with HTML5/WebSharper/F#. The organism of interest is Staphylococcus aureus. We have built an interactive chart showing its genome coding sequences and a few thousand transposon insertions performed in the UNMC labs.

You are welcome to play with the latest prototype.

It has been fun to do some graphics and modular arithmetic. We used Raphael to draw SVG, this has worked quite well for us, especially after we "fixed" the Raphael API a little bit for easier use from F# in the latest WebSharper binding. I also am just starting to realize how much I missed in highschool biology.

F# may have a great future in bioinformatics. Type providers easily consuming various data sources, .NET providing decent performance for numerical algorithms, and WebSharper or Silverlight giving a browser-accessible UI.. The only limit is your imagination.

In one of the discussions we had, Loïc made an interesting comment. He said that unlike working in the financial sector, applying F# to bioinformatics is not just interesting, but also useful. And though I have not been an Occupy protester, I cannot help but agree. Realizing that your work may help medical research is definitely a great motivator.

If you are tempted to work with us, please do apply: we are hiring. Interns are especially welcome.


  1. Hi Anton, I was wondering when designing extensions for WebSharper if you were trying to match the js library's signature to allow someone who knows the library and/or read it's documentation to have an easier time with the extension or if you generally attempt to make it friendly in the context of F# and perhaps a functional style.

    I obviously would prefer the later because I suck at web.

  2. Hi David,

    This is an excellent question!

    I would definitely prefer F#-style bindings as well.

    Most of our bindings, however, tend to be much closer to JavaScript in style. The reason is that it takes much less time to provide a bare-bones JavaScript-style binding than a proper F#-style binding, and we are just short of time to properly maintain good F#-style bindings for all extensions (it is a continuous process as they keep getting updated). Some bindings are even completely or partially machine-generated by parsing JavaScript and documentation files.

    Doing the bindings is not very pleasant work. A lot of JavaScript APIs we have to deal with are quite terrible, informal, inconsistent and hard to provide types for.

    It would be lovely to have a formal JavaScript API description standard that could be consumed by tools like WebSharper and GWT to provide typed bindings, and shift the maintenance burden to the JavaScript library developers.