Quick-start Developer’s guide¶
Here we will introduce how to setup Apollo on your server. In general, there are two modes of deploying Apollo.
There is “development mode” where the application is launched in a temporary server (automatically) and there is
“production mode”, which will typically require an external separate database and tomcat server where you can deploy the
This guide will cover the “development mode” scenario which should be easy to start. To setup in a production environment, please see the setup guide.
Java / JDK¶
You have to install Java and the Java Development Kit (JDK) 8 or higher to run Apollo. Both the Oracle and OpenJDK versions have been tested.
Node.js / NPM¶
You will need to install node.js, which includes NPM (the node package manager) to build Apollo.
nvm is highly recommended for installing and managing multiple version of Node. Node v6 and up should work, but we recommend Node v8 or better.
Grails / Groovy / Gradle (optional)¶
Installing Grails (application framework), Groovy (development language), or Gradle (build environment) is not required (they will install themselves), but it is suggested for doing development.
This is most easily done by using SDKMAN (formerly GVM) which can automatically setup grails for you.
curl -s http://get.sdkman.io | bash
sdk install grails 2.5.5
sdk install gradle 2.11
sdk install groovy
Get the code¶
Alternatively you can check it out from git directly as follows:
git clone https://github.com/GMOD/Apollo.git Apollo
git checkout <XYZ>- optional, where XYZ is the tagged version you want from here: https://github.com/GMOD/Apollo/releases
Verify install requirements¶
We can now perform a quick-start of the application in “development mode” with this command:
The JBrowse and perl pre-requisites will be installed during this step, and if there is a success, then a temporary
server will be automatically launched at
Note: You can also supply a port number e.g.
apollo run-local 8085 if there are conflicts on port 8080.
Also note: if there are any errors at this step, check the setup.log file for errors. You can refer to the troubleshooting guide and often it just means the pre-requisites or perl modules failed.
Also also note: the “development mode” uses an in-memory H2 database for storing data by default. The setup guide will show you how to configure custom database settings.
Running the code¶
There are several distinct parts of the code.
- Apollo client plugin (JS: dojo, jquery, etc.) in client directory
- Server (Grails 2.5.5: Groovy and Java) in grails-app, src, web components and tests.
- Side-panel code / wrapper code (GWT 2.8: Java). Code is java and/or XML in src/gwt.
- Tools / scripts in the examples and tools: Groovy, perl, bash
- JBrowse (JS: dojo, jquery, etc.)
In general, the command
./apollo run-local will build and run the client and the server code. Subsequent runs that do not change the GWT code can use
./apollo run-app. Changes to domain objects or adding controller methods may make stopping and restarting the server necessary, but most other changes will compile without having to restart the server.
./apollo test runs the grails unit and integration tests.
Updating the web-service doc can be done with
Running the code for the making client plugin changes¶
After starting the server run
./apollo watchman which should automatically copy any files that have been modified from the client directory to the running instance.
If for some reason this is not working then make sure that your network development tab, in your browser console, has disabled caching. You can also run the command
gradle copy-resources-dev manually each time instead if the files don’t seem to be getting copied.
Running the code for GWT changes¶
To use the GWT dev server run
gradle devmode in a separate terminal. This will bring up a separate GWT dev-mode code server that will compile subsequent changes to the src/gwt code after reloading the page.
If errors seem to be a little obtuse using the dev compilation, you might try running
./apollo compile to get more detail.
Running the code for JBrowse changes¶
If you are testing making changes directly to JBrowse within Apollo, the following steps should work:
- Clone the version of jbrowse you want into a directory called
jbrowse-downloadas the root level.
./apollo run-localto run the server
- In a separate terminal run
gradle copy-resources-devto copy over your changes to the server.
Create server documentation¶
Using an IDE like IntelliJ, NetBeans, Eclipse etc. is highly recommended in conjunction with Grails 2.5.X documentation. Additionally, you can generate documentation using grails:
Server documentation (for groovy) should be available at
Setting up the application¶
Setup a production server¶
To setup in a production environment, please see the setup guide. To setup (as opposed to a development server as above), you must properly configure a servlet container like Tomcat or Jetty with sufficient memory.
Adding data to Apollo¶
After we have a server setup, we will want to add a new organism to the panel. If you are a new user, you will want to setup this data with the jbrowse pre-processing scripts. You can see the data loading guide for more details, but essentially, you will want to load a reference genome and an annotations file at a minimum:
bin/prepare-refseqs.pl --fasta yourgenome.fasta --out /opt/apollo/data bin/flatfile-to-json.pl --gff yourannotations.gff --type mRNA \ --trackLabel AnnotationsGff --out /opt/apollo/data
Login to the web interface¶
After you access your application at http://localhost:8080/apollo/ then you will be prompted for login information
Figure 1. “Register First Admin User” screen allows you to create a new admin user.
Figure 2. Navigate to the “Organism tab” and select “Create new organism”. Then enter the new information for your organism. Importantly, the data directory refers to a directory that has been prepared with the JBrowse data loading scripts from the command line. See the data loading section for details.
Figure 3. Open up the new organism from the drop down tab on the annotator panel.