[OTDev] Fwd: SW Development process...SL update
Rajarshi Guha rajarshi.guha at gmail.comTue Dec 22 16:56:07 CET 2009
- Previous message: [OTDev] Fwd: SW Development process...SL update
- Next message: [OTDev] Fwd: SW Development process...SL update
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
When I implemented a R-based stats web service infrastructure ( http://dx.doi.org/10.1021/ci700188u and http://www.chembiogrid.org/projects/proj_statistics.html) my approach was to have an Rserve instance running somewhere (in our case it was on a remote machine that stored our pre-built models). The web based application (originally Axis based SOAP but I think IU has now provided more RESTful wrappers or implementations) would then send queries to the Rserve instance. As a result of this, we only needed a single Rserve instance running independent of the frontend (which was a web page but could have been anything), rather than multiple instances being started up. You can see the code for this at http://cicc-grid.svn.sourceforge.net/viewvc/cicc-grid/cicc-grid/rws/trunk/ More recently, in support of the Open Notebook Solubility Challenge, I looked at an alternative approach based on mod_python based web applications. In this case, I used the rpy2 Python package to interface to R, to load models and get solubility predictions. A very nice API, and somewhat simpler than my original Rserve based solution, but it does imply that each time the app is run, an R instance is reloaded (I'm not sure that I could share instances between sessions). See http://github.com/rajarshi/rest-ws/tree/master/predict/ for code One other approach, that I haven't explored yet is the use of rapache, which is a DSO for Apache that runs R. In this approach, you'd avoid the start up cost of R instances, since they'd already be running.Furthermore, you could easily serve up pages directly from R code. On Tue, Dec 22, 2009 at 9:35 AM, surajit ray <mr.surajit.ray at gmail.com>wrote: > I am using JRI with the situation that the Java code (for prediction ) is a > desktop aplication which is being initiated by the ./run script in rJava > (within the JRI subfolder). This means that the R engine is being started > by > the script and then the java code is initiated. > > This is ok in working for the desktop application. But since we are going > to > develop an online service - I have to reprogram the code in JSP etc. > However > this means I cannot use the JRI run script (since the code has to be > initiated by tomcat). > > So I would like to start the engine from within the Java Code (JSP). I have > tried this - but this is not recommended by the author of JRI. My attempts > have failed till now. I can forward the exact code and the details of the > errors. > > Cheers > Surajit > > On Tue, Dec 22, 2009 at 2:12 PM, Rajarshi Guha <rajarshi.guha at gmail.com > >wrote: > > > > > On Dec 22, 2009, at 4:32 AM, Egon Willighagen wrote: > > > > > > >>> 5) Unable to make the R part of the code native to java as yet. > > >>> Still > > >>> trying a few things. This hinders our ability to provide the API > > >>> interface. > > >>> > > >> I am aware of at least one Java - R integration, namely The CDK > > >> library > > >> (*http://cdk*.*sourceforge*.*net*/) has R integration since few > > >> years - > > >> it might help if you consult the code there. And AFAIK the author of > > >> CDK-R code is on this list as well, so please do ask specific > > >> questions > > >> on the development mailing list. > > > > > > Not sure if Rajarshi is on the list yet, but he indeed wrote various > > > levels of integration, calling R from a Java environment is one. > > > > > > Have a look at http://www.omegahat.org/RSJava/, which has a section on > > > 'Calling R from Java'. > > > > I'm here :) > > > > Indeed, RSJava is one way to make calls to R from Java. However, the > > preferred solution is to us JRI (which is what the CDK-R bridge uses) > > which has a much more robust interface > > > > ---------------------------------------------------- > > Rajarshi Guha | NIH Chemical Genomics Center > > http://www.rguha.net | http://ncgc.nih.gov > > ---------------------------------------------------- > > A committee is a group that keeps the minutes and loses hours. > > -- Milton Berle > > > > > > _______________________________________________ > > Development mailing list > > Development at opentox.org > > http://www.opentox.org/mailman/listinfo/development > > > > > > -- > Surajit Ray > _______________________________________________ > Development mailing list > Development at opentox.org > http://www.opentox.org/mailman/listinfo/development > -- Rajarshi Guha NIH Chemical Genomics Center
- Previous message: [OTDev] Fwd: SW Development process...SL update
- Next message: [OTDev] Fwd: SW Development process...SL update
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Development mailing list