Skip to content

How to install a phylogenetic tree pattern matching service

Jean-François edited this page Feb 2, 2021 · 31 revisions

First of all, download the whole package in your working directory:

git clone https://github.com/SouthGreenPlatform/rap-green.git

Step 1: java pattern matching daemon installation and configuration

The pattern matching daemon is a Java process that load the phylogenetic tree collection in RAM, and interact with the tree pattern editor using a client-server protocol, taking in charge the combinatory part of the method. So, the daemon should be installed in a server with enough RAM (count 3-5 Go for 1,000,000 terminal genes). The daemon server should be visible from the web server that will host the www facilites, and a logical port should be opened.

  • Compile the RapGreen java package (mostly tested in Java 8, but compatible with newer of older versions):

cd rap-green

javac rapgreen/*.java

Note that you can choose to directly use the bin/RecDaemon.jar executable archive file if you have the same JDK version used to compile this available version, which is JDK8.

  • Prepare your files, one must contain the phylogenetic tree collection, and one must contain the species tree labeled with internal and terminal taxa.

    • The phylogenetic tree collection contains one tree per line, composed with the family identifier (any unique label) and the tree in NHX format. NHX zone must hold a :S= for the species at the leaves, and a D=Y/N for duplication/speciation nodes (duplication, yes or no). An example is provided in: rap-green/example_files/phylo_tree_collection_example.nwk
    • The species tree is a simple Newick file, containing species names as labels. An example is provided in: rap-green/example_files/species_tree_example.nwk
  • Then, you can start the daemon. If you compiled your own version, use this command line:

    nohup java -cp /[...]/rap-green rapgreen/ReconciliationDatabaseDaemon -standard myDatabase species_tree_example.nwk phylo_tree_collection_example.nwk &

    And if you use the .jar provided file:

    nohup java -jar /[...]/RecDaemon.jar -standard myDatabase species_tree_example.nwk phylo_tree_collection_example.nwk &

    Please replace the [...] by the corresponding path, depending your working directories. The option -xmxXXXXm should be added with "XXXX" replaced by a number of MO for the RAM. If your tree collection is big (several ten of thousands), 8000MO or 16000MO could be required.

Step 2: installation of the tree pattern editor

  • From your GitHub instance, copy the whole www/treepattern/ directory on your webserver, in a web accessible location.

  • Create the configuration file with the command: cp config_draft.php config.php . Then, edit the file, at least giving the server address where the daemon is running. It could be set to localhost or to a distant computing infrastructure IP address. The port should correspond to the daemon running parameter (1666 by default).

  • Create the CSS file with the command: cp treepattern_draft.css treepattern.css . that you can edit at will to change the look and feel.

Step 3 : installation of the tree visualizator

  • From your GitHub instance, copy the whole www/treedisplay/ directory on your webserver, in a web accessible location.

  • Create the configuration file with the command: cp config_draft.php config.php . You could then edit several parameters (for example the address linked to the leaves), but it is not mandatory.

  • Edit again the configuration file: config.php file in the treepattern directory, and set the $treedisplayaddress to the http.s address you installed the treedisplay interface.

  • Create the CSS file with the command: cp treedisplay_draft.css treedisplay.css . that you can edit at will to change the look and feel.

At this step, you should be able to search for patterns, starting from the treepattern web address.