akbertram / RBioFormats

:books: R interface to the Bio-Formats library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

First, make sure you have JDK 1.7 or higher installed. To install RBioFormats use the biocLite installation script in order to resolve the dependency on the Bioconductor package EBImage.

source("https://bioconductor.org/biocLite.R")
biocLite("aoles/RBioFormats") # You might need to first run `install.packages("devtools")`

Mac OS X

Mac OS comes with a legacy Apple Java 6. In order to use RBioFormats, you will need to update your Java installation to a newer version provided by Oracle.

  1. Install Oracle JDK.

  2. Update R Java configuration by executing from the command line (you might have to run it as a super user by prepending sudo depending on your installation).

R CMD javareconf
  1. Re-install rJava from sources in order to properly link to the non-system Java installation.
install.packages("rJava", type="source")

You can verify your configuration by running the following commands. This should return the Java version string corresponding to the one downloaded and installed in step 1.

library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
## [1] "1.8.0_112-b16" 

Documentation

For example use, see the package vignette.

FAQ

See my answers on Stack Overflow.

Caveats

The java.lang.OutOfMemoryError error

If you get the java.lang.OutOfMemoryError: Java heap space error, try increasing the maximum heap size by supplying the -Xmx parameter before the Java Virtual Machine is initialized. For example, use

options( java.parameters = "-Xmx4g" )
library( "RBioFormats" )

to override the default setting and assign 4 gigabytes of heap space to the Java environment.

Use with BiocParallel

Each R process needs a separate JVM instance. For this, load the package in the parallelized function, e.g.,

bplapply (files, function(f) {
  library(RBioFormats)
  ...
})

Build with Renjin

Run mvn install to build and test with Renjin

Run renjin:repl to open a Renjin REPL with the package on the classpath.

About

:books: R interface to the Bio-Formats library


Languages

Language:R 64.1%Language:Java 35.9%