Skip to contents

Prerequisite - installing rJava

Since TASSEL is written primarily in Java, a Java JDK will need to be installed on your machine. Additionally, for R to communicate with Java, the R package rJava will need to be installed. In order to use rTASSEL, ensure that you have:

  • A JDK (Java Development Kit \(\geq\) 8) installed on your system.
  • Your system environment variable JAVA_HOME is configured appropriately and points to your JDK of choice. This will usually be included in your PATH environment variable as well. Options and system environmental variables that are available from R can be seen with Sys.getenv() and more specifically Sys.getenv("JAVA_HOME").

NOTE: If you are using a UNIX system (e.g. Ubuntu) and are experiencing issues, you may need to reconfigure R with Java. To perform this, open a terminal and enter the command:

R CMD javareconf

You may need to have root privileges when performing this so you may need to add sudo to the prior command.

If you need additional steps on how to perform these actions, detailed information can be found using the following links, depending on your OS:

Install from GitHub

Building with vignettes

After you have rJava up and running on your machine, install rTASSEL by installing the source code from our GitHub repository using the devtools package. Here, we show how you can install the package and build vignettes locally:

if (!require("devtools")) install.packages("devtools")
devtools::install_github(
    repo = "maize-genetics/rTASSEL",
    ref = "master",
    build_vignettes = TRUE,
    dependencies = TRUE
)

The dependencies = TRUE parameter will have to be set if you do not have the suggested packages described in the DESCRIPTION file of this package.

Building without vignettes

If you wish to not build vignettes, the prior method can be simplified as shown below:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("maize-genetics/rTASSEL")

Loading rTASSEL

After source code has been compiled, the package can be loaded using:

## Welcome to rTASSEL (version 0.9.27)
##  • Consider starting a TASSEL log file (see ?startLogger())

Or, if you want to use a function without violating your environment you can use rTASSEL::<function>, where <function> is an rTASSEL function.

Running from Docker

If you wish to run a containerized version of rTASSEL, we also have a Docker image available. This can be retrieved from DockerHub using the following command:

docker pull maizegenetics/rtassel:latest

With the terminal

Once downloaded, you can run rTASSEL from a terminal window:

docker run --rm -ti maizegenetics/rtassel R

With RStudio Server

This image also contains an RStudio Server instance. To run this, you will need to publish the container’s port(s) to the host (-p). For example:

docker run --rm -ti -p 8787:8787 maizegenetics/rtassel

From here, you can go to localhost:8787 on a web browser and enter a:

  • Username (by default, this will be rstudio)
  • Password (this will be a randomly generated password displayed in the terminal output)

Prior issues and possible resolutions

Problems installing rJava on macOS with M1 CPU architecture

If you are running into issues with installing rJava using the newer Mac chip architecture, Oracle JDK currently (as of writing this) does not work. Consider an alternative JDK source such as OpenJDK or Azul JDK.

More detailed information about a possible workaround can be found in this Stack Overflow post.

Problems installing if you have both 32- and 64-bit architecture installed for R

If you are using a machine that has both architectures installed for R, you might run into problems pulling code using devtools. If this is the case, one solution would be to add the parameter --no-multiarch option in INSTALL_opts. This will force building the package for your currently running R version:

devtools::install_github(
    repo = "maize-genetics/rTASSEL",
    ref = "master",
    build_vignettes = FALSE,
    INSTALL_opts = "--no-multiarch"
)

Problems with rJava if you have upgraded Java

On macOS: if you previously had rJava working through RStudio, then you upgraded your Java and it now longer works, try the following:

At the command line type:

R CMD javareconf

Then check for a left over symbolic link via:

ls -ltr /usr/local/lib/libjvm.dylib

If the link exists, remove it, then create it fresh via these commands:

rm /usr/local/lib/libjvm.dylib
sudo ln -s $(/usr/libexec/java_home)/lib/server/libjvm.dylib /usr/local/lib

You should now be able to enter RStudio and setup rJava.