Tuesday, February 01, 2011

DIY: Running R from within Bioclipse

Important: this blog post is about a development version of Bioclipse, not about the stable 2.4 series. See also Gilleain's comment for this post.

Arvid has done an excellent job in setting up Hudson for Bioclipse, which is not so trivial as for Maven projects. With the R functionality I blogged about earlier today moved to the bioclipse.statistics repository, things are automatically build when new patches hit the repository. And Hudson doesn't just compile the code, it also exports binaries. The main Bioclipse products build can be downloaded here (Windows, Linux, OS/X; if you need more, please let use know). And, all the additional features got automatically uploaded to individual update sites, very much like Maven projects getting pushed to a Maven repository.

So, here's an Bioclipse-R install guide for the adventurous (i.e. Christian, Rajarshi and Rebecca, perhaps Juuso :). I will describe it from a Debian GNU/Linux perspective.

First, make sure you have R and rJava installed. I strongly recommend the versions from sid/unstable (2.12 and 0.8-8), which are more stable here than those from testing:
$ apt-get install r-base-core/sid r-cran-rjava/sid
Then you download the nightly build of Bioclipse 2.5.x from Hudson, e.g. for my 32bit Linux:
$ cd /tmp
$ wget
$ unzip
$ cd Bioclipse.2.5.0.linux.gtk.x86/
But before we boot Bioclipse, we first need to tell it where to find the R instance, and we need to set two variables for that: R_HOME and java.library.path. The latter is set via the bioclipse.ini file, by adding this line to the end:
The other is an environment variable and can be set with:
$ export R_HOME=//usr/lib/R
Then Bioclipse can be started:
$ ./bioclipse
The first thing to do is install the R Feature. To do this open the Install New Software... dialog from the Help menu, and add (with the Add button) the Bioclipse Statistics update site on Hudson at this Location (copy/paste the Location URL into the below dialog):

When back in the Available Software dialog, select the new update site, and mark the Bioclipse-R Integration feature to be installed:

After the install is completed, which will require a reboot of Bioclipse (why?!?!), you can open the R console by opening a dialog from the Window -> Show View -> Other... menu:

The R Console will then show up as view, as depicted in my earlier post.

Loading of libraries, like running library("rcdk") or library("pls"), crashes the whole thing if you use R and rJava from Debian testing, and silently fails with those from unstable. It's on my agenda.