The Advanced Workflows analysis workflows work by collecting the data selected in the Analyze tab and launching one of the R workflows provided by sending it to an Rserve instance.
Although you can install R system-wide it is usual to create a specific Rserve instance for tranSMART, running under the same username as tranSMART (e.g. tomcat7). Rserve defaults to port 6311 on the same host, but this is configurable in Config.groovy.
When tranSMART is released the developers provide a set of Makefile targets to install the appropriate version of R.
Installing with transmart-data
Fetch transmart-data for the latest release (if not already done to install the database)
curl http://library.transmartfoundation.org/release/release16_3_0_artifacts/transmart-data-release-16.3.zipunzip transmart-data-release-16.3.zipmv transmart-data-release-16.3 transmart-data
The files to edit is changes are needed post-release are:
- R/Makefile the main make file with the R version
- R/cran-pkg.R packages to download from CRAN
- R/other-pkg.R other packages including QDNAseq with a fixed version number
make -C R R
make -C R install_packages
Check for error messages. If in doubt, a repeat of the install_packages step is safe. It checks for any remaining packages required.
The current state of R requires Rserve to be installed by hand from the developer repository:
Create a startup script
#!/bin/bashunset DISPLAYR_HOME=/path/to/transmart-data/R/root/lib/R \ LD_LIBRARY_PATH=/path/to/transmart-data/R/root/lib/R/lib \ /path/to/transmart-data/R/root/lib/R/bin/Rserve \
>> /path/to-tomcat/dir/rout.log 2>&1
Then launch this script with sudo --user=tomcat7 (or tomcat8) whichever user tomcat is running under.
Unfortunately, there is no foolproof way to do this. Problems we have encountered in the past include:
- The CRAN mirror may cease to exist. We have twice found this problem with servers in the Netherlands (where the R installation scripts were first developed). We now point to a server at Imperial College London where other developers were based.
- Some of the packages used by the Advanced Workflows cause particular problems, for example the QDNAseq package form BioConductor only has one version available, and you have to use the version number in the request.
- Packages may only be supported in specific releases of R so you may have to increase the R version number to support the most recent package versions.
- Packages may not yet be available for the latest R version
- R packages may have dependencies that require earlier versions of other packages
- Earlier versions of packages may not be supported by the version of R you specify.
- Error messages from Rserve may not be saved. The installation includes setting up system services for various operating system flavours but these do not keep a log file. You can launch Rserve directly and redirect standard output and standard error to a log file to save some logging messages and most importantly any error messages.
- Installing R packages from source also depends on various libraries being pre-installed on the system. You have to check for error messages warning of missing libraries and install them by hand then rerun the makefile.
- R may still now work. With tranSMART 16.3 we upgraded to R 3.5.1, which includes Rserve 1.7.3. However, Rserve then crashes with a fatal error in many cases. The solution is to install a later version of Rserve. As the CRAN servers only have versions up to 1.7.3 Rserve must be installed from the development site (rforge) while this problem continues.
When an R package installation fails with a message, for example failed to link to "lssl", you need to install the development version of the matching library. On Ubuntu this is likely to be:
sudo apt install libssl-dev
In a few cases this is more complicated and you may have to search for an appropriate library. The Axiomedix support team email@example.com is very happy to help.
The libraries found to be needed for Ubuntu18 were:
- and in this case only available from:
- sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
- sudo apt-get update
- and in this case only available from:
- Rserve 1.8.6 (installed in R) to replace the non-working 1.7.3 from CRAN