Skip to content
Joseph Crispell edited this page Nov 18, 2020 · 9 revisions

Can't get homoplasyFinder package install because of Rcpp

Recently come across a problem with the Rcpp package. This package allows R and C (a different more powerful programming language) to communicate. A recent update to this package means when you're installing homoplasyFinder it will try and update Rcpp. I was getting the following error:

Cannot remove prior installation of package 'Rcpp'

To fix it you need to locate this package folder on your computer, remove the folder, and re-install the package.

You can use .libPaths() to find out where your R packages are installed.

Ideally you should remove the Rcpp package and any other packages that rely on it (such as ape). Then you can re-install all the packages you deleted by typing:

install.package("packageName")

Can't get rJava to install

rJava is an R package that is used to access HomoplasyFinder's java code. It is quite a temperamental R package. If you have problems getting my package to work try:

  1. Updating your Java jdk to >10.0.1 (http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html)
  2. Delete Java jdk from previous versions
  3. Reconfigure R to use new Java version, by running this in the terminal:
R CMD javareconf
  1. Re-install rJava from source using:
install.packages("rJava", type = "source")
  1. Run the following code in terminal (for OSX):
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib

Some useful help information:

If all the above fails, don't lose hope :-). You don't need rJava installed, you can run HomoplasyFinder using the runHomoplasyFinderJarTool(). runHomoplasyFinderJarTool() runs the Java application directly and therefore doesn't require rJava.


Java heap space error

If you running HomoplasyFinder on a really large dataset and you run into a heap space error like this:

java.lang.OutOfMemoryError: Java heap space

A heap space error occurs when HomoplasyFinder uses more memory than was assigned to it. You'll need to change the maximum heap size limit using the -Xmx argument. In the command line use:

java -Xmx4000m -jar HomoplasyFinder.jar

to change it to 4GB. If you're in R, you'll need to restart your session and add the following at the top of your script before loading any packages:

options(java.parameters = "-Xmx4000m")

Handling polytomies

Polytomies in a phylogeny are where an internal node in a phylogeny has more than two sub-nodes. HomoplasyFinder is designed to run with a fully resolved bifurcating phylogentic trees, where all internal nodes have two sub-nodes. If polytomies are present in the phylogeny, the following diagram illustrates how HomoplasyFinder handles them: polytomies

Clone this wiki locally