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.
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.4
-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.
bundle installconfig/database.yml_example to config/database.yml and uncomment/configure your database of choiceconfig/environments/development.rb_example to config/environments/development.rb
config/app_settings.yml_example to config/app_settings.yml
url, app_id and app_key app keys and API url to the appropriate values.rake db:create:allrake db:migrate
RAILS_ENV="production" or RAILS_ENV="test" to migrate those environments, by default it wil be developmentrake assets:precompile if running in production environment
config.serve_static_assets = false to config.serve_static_assets = true in config/environments/production.rbrails sNow navigate your browser to http://localhost:3000/
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
c.save
end
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.
Content type
Image
Digest
sha256:dc4609d12…
Size
208 MB
Last updated
almost 11 years ago
docker pull stain/explorer2-dev