Ember JS web application used for browsing the Open PHACTS Discovery Platform
JavaScript HTML Python Ruby CSS
Latest commit fb2d077 Nov 30, 2015 1 @stain stain higher resolution ops-logo
.. and with cleaner colours

made using Gimp
Failed to load latest commit information.


Open PHACTS Explorer 2 DOI


The Open PHACTS Explorer is an HTML5 & CSS3 application for chemical information discovery and browsing. It is used to search for chemical compound and target information using a web search interface. It uses Ruby on Rails, Ember JS and OPS.JS. The Explorer uses the Open PHACTS Linked Data API.

Docker image

The experimental Docker image openphacts/explorer2 can be used to run the explorer2 on any Linux host with Docker:

docker pull openphacts/explorer2
docker run -p 3000:3000 -e RAILS_ENV=development -it openphacts/explorer2 

This will start Explorer2 on http://localhost:3000/

FIXME: The autocomplete data for the search is not loaded.

The environment variables that can be set, together with their defaults:

-e RAILS_ENV=production
-e API_URL=https://beta.openphacts.org/1.5
-e API_APP_ID=161aeb7d
-e API_APP_KEY=cffc292726627ffc50ece1dccd15aeaf


Ruby 1.9.3+, Ruby on Rails 3.2.x, Ember JS, Bootstrap CSS/JS


  • ruby -v to check your Ruby version and install if required.
    • You may want to use rvm to handle multiple versions of ruby
  • bundle install
  • Copy config/database.yml_example to config/database.yml and uncomment/configure your database of choice
  • Copy config/environments/development.rb_example to config/environments/development.rb
    • (and production/test)
  • Register to get your application keys.
  • Copy config/app_settings.yml_example to config/app_settings.yml
    • change the url, app_id and app_key app keys and API url to the appropriate values.
  • rake db:create:all
  • rake db:migrate
    • add RAILS_ENV="production" or RAILS_ENV="test" to migrate those environments, by default it wil be development
  • rake assets:precompile if running in production environment
    • If running webrick in production then change config.serve_static_assets = false to config.serve_static_assets = true in config/environments/production.rb
  • rails s

Now navigate your browser to http://localhost:3000/

Deploying on a sub-uri

In the environment file ie development.rb and/or production.rb, add/uncomment the following:

#config.relative_url_root = "/my_app"
#config.assets.prefix = "/my_app/assets"

Change the paths to whatever is appropriate to your sub-uri. You must end the config.assets.prefix with /assets or the images will not be loaded correctly.
You can have multiple level sub-uris eg /my_app/version1.
It is recommended to clear out the cache ie rm tmp/cache when adding a sub-uri and also anything in public/assets (or public/assets/your-sub-uri) before you start the server to ensure the glyphicons are loaded correctly.
There is a handlebars helper called getImage which should be used instead of <img> tags when showing an image in the html.


There are now too many compounds to do the autocomplete by reading a text file from disk and searching it line by line so you need to load the compounds into the database using the following steps.

  • wget -o filestore/compounds.txt.bz2 http://data.openphacts.org/1.4/explorer2/compounds.txt.bz2
  • bunzip2 filestore/compounds.txt.bz2
  • Run rake explorer:load_all_assets. To load in to production db prepend with RAILS_ENV=production

    • Or start a rails console (rails c) and enter the following commands to add compound models to the database

      file = File.new(File.join(Rails.root, "filestore", "compounds.txt"), "r")
      file.each_line do |line|
      c = Compound.new
      c.label = line.chomp

    It will probably take the console a few hours to get through them all (there are now over 1 million!).

    Do the same for targets.txt and organisms.txt which are already in filestore/.


The Ember JS side of things uses the Qunit test framework with Karma for automation. The javascript test files are within app/assets/javascripts/tests. We recommend looking at the Ember testing guides but here is some setup info. The Karma test runner setup files are contained in the directory test/karma. The js to load and browsers to test are defined in karma.conf.js. To install Karma you will need Node JS (stop, come back, it's not that hard). Then you need to run npm install which installs the dependencies listed in the package.json file. These dependencies will be installed local to the karma directory so you will probably need to set up a path to find them export PATH="./node_modules/.bin:$PATH". You will also need Karma's command line interface npm install -g karma-cli. Then to run the tests do karma start.


The Explorer uses an embedded version of the Ketcher compound drawing tool by GGA Software Services.


The Explorer '2' source code is released under the MIT License. See licence.txt for more details.