Developer Docs
From RoadRunnerWiki
Please send questions or comments regarding Roadrunner development to Steve Mathias (smathias at poblano dot health dot unm dot edu).
Contents |
Roadrunner Database
The Roadrunner database is implemented in [http://www.postgresql.org PostgreSQL], a robust and sophisticated open-source object-relational database management system. The Roadrunner database utilizes the CHORD cartridge from gNova to integrate chemical structures with data. CHORD is Chemical Objects in a Relational Database and includes functionality to make unique SMILES strings, compute fingerprints, perform sub-structure matching and similarity searching, etc. CHORD integrates OpenEye's OEChem, a complete, fast and powerful function library. Both CHORD and OEChem must be licensed (free for academic groups) from their suppliers.
ERDs of the public (non-CHORD) schema of the Roadrunner database are
shown in the following figures.
A detailed description of the public (non-CHORD) schema of the Roadrunner database is available here.
The DDL file to create a roadrunner database and populates it with necessary seed data is SQL/create.sql.
Database Schema Version Notes
v2.0
Big change to Substance/Compound model. Also, salts and solvents included in compound table.
v2.0.1
Added comment column to plate_access and well_access
v2.1
Added permission table
v2.2
Added tables/indexes to support prototype Post-HTS analysis.
v2.3
Changes to assay that were reverted.
v2.4
More Post-HTS analysis changes
v2.5-v2.8
Changes to support Assay Upload and Assay Aggregator functionality.
v3.0
Added description fields to assay_def for common assay data fields.
Complete re-working of dose-response assay support:
- Remove dose-response fields from assay_def:
- cutoff_type
- cutoff
- Remove dose-response fields from assay:
- ec50
- hillslope
- squared
- num_values
- source
- Remove dose-response fields from composite_assay:
- mean_ec50
- sd_ec50
- hillslope_range
- r_squared_range
- num_values
- Remove dose-response fields from assay_aggregator
- ec50_min
- ec50_max
- hillslope_min
- hillslope_max
- r_squared_min
- r_squared_max
- Create new dose-response tables:
- assay_dr
- composite_assay_dr
- assay_aggregator_dr
v3.1
Added sample table
Roadrunner Web Application
The Roadrunner web application is implemented in PHP using my own perversion of the Model-View-Controller paradigm (which is vastly simpler than the various MVC frameworks around). There is one main application page (htdocs/index.php) which is actually the only page ever directly loaded. The essential logic of this page is shown here:
<?php require_once 'config.inc.php'; $action = $_REQUEST['action']; // Get the request action $ctrlr = ControllerFactory::create($action); // Instantiate controller $ctrlr->execute(); // Execute model/logic $ctrlr->display(); // Display the page ?>
Essentially, index.php is called with an action parameter and the factory class instantiates an appropriate controller object based on the action parameter. That's the controller part.
Next, the controller's execute() method is called and this executes whatever application logic is required to carry out the given action. That's the model part.
Finally, the the controller's display() method is called and this generates the page content that is sent back to the browser. Smarty templates are used in the generation of most pages. The Smarty templates are all located in the webapp/templates directory. That's the view part.
And that's about it.
All database interaction is handled via a Data Access Object implemented by the class lib/DBAdaptor.class.php.
Documentation for all the PHP classes involved is available here.
Installation
This section describes how to go about setting up the Roadrunner database and web application.
Prerequisites
Roadrunner depends on many different software packages, all of which must be installed and properly configured for Roadrunner to work correctly. The various prerequisites are described below with brief installation instructions. For more detailed instructions, see the packages' home pages or the installation instructions that are distributed with the code.
Apache/PHP
Postgresql
OEChem
The following OpenEye distributions are needed:
OpenEye-toolkits ogham lexichem babel smack
Download the OpenEye tarballs from http://www.eyesopen.com/download/. Be sure to download the binary package appropriate for your architecture. Chose an installation directory and unpack the tarballs:
$ cd /home/app $ tar xzf OpenEye-toolkits-1.4.2-redhat-9.0-g++3.2-i586.tar.gz
Set the environment variables OE_DIR to the installation directory (/home/app/openeye in the above example) and OE_LICENSE to your OpenEye license file, respectively.
$ export OE_DIR=/home/app/openeye $ export OE_LICENSE=/home/app/openeye/LICENSE
gNova CHORD
Download the the current gNova CHORD tarball from http://www.gnova.com/
> cd /home/app/gnova > tar xzf gnova-1.0.1.tgz > cd v1.0.1 > sh makelib > cp gnova.so /home/app/pgsql/lib # or to wherever your postgres lib is
Smarty
Download latest tarball from http://smarty.php.net/download.php
> tar xvzf ~/downloads/Smarty-2.6.14.tar.gz > mkdir /usr/local/lib/php/Smarty > cp -r Smarty-2.6.14/libs/* /usr/local/lib/php/Smarty
ChemAxon MarvinView
Download Marvin Applets from http://www.chemaxon.com/products.html#Marvin
> cd <APACHE_DOCUMENT_ROOT>/roadrunner > tar xzf ~/downloads/marvin-all-4.0.6.tar.gz
Perl Modules
Many separate Perl modules are required by the scripts that run Post-HTS analysis and the data loading scripts (see next section). These include:
- DBI
- DBD::Pg
- Log::Log4perl
- XML::Twig
- DB_File
- Time::Duration
The easiest way to install these is using the CPAN module, although you typically need root privileges to install using CPAN. For example, to install the DBI bundle:
>perl -MCPAN -e "install Bundle::DBI"
Another way:
>perl -MCPAN -e shell
cpan>install Bundle::DBI
The first time you use the CPAN module, you will be required to go through a series of configuration steps prior to installing any other modules.
Getting the Code
A tarball distribution is not yet available as Roadrunner is still in the early stages of development. If you are interested in obtaining the code in that format, please contact Steve Mathias. Currently, the only way to otain the code is a checkout from the Subversion repository:
$ cd /home/app $ svn checkout svn://jalapeno.health.unm.edu/roadrunner/trunk roadrunner
Set RR_ROOT
The rest of the installation instructions below refer to the directory where rodarunner was downloaded as the environment variable $RR_ROOT
$ export RR_ROOT=/home/app/roadrunner
Database Installation and Setup
[postgres]$ createdb roadrunner [postgres]$ cd $RR_ROOT/SQL [postgres]$ psql roadrunner roadrunner=> \i create.sql
A few edits of create.sql will be required. Specifically, you may need to:
- change the paths to the CHORD files
- insert the appropriate values for your CHORD and OEChem licenses into gnova.system
- change the path to plpgsql.so
- grant permissions to the appropriate users
</pre>
Compile OEChem Programs
$ cd $RR_ROOT/OEChem $ make all $ make -f Makefile.depict mol2gif
Web Application Installation and Setup
Change to the DocRoot of your Apache installation (typically /usr/local/apache/htdocs), copy the roadrunner htdocs directory and create directories required by Smarty:
[www]$ cd /usr/local/apache/htdocs [www]$ cp -r $RR_ROOT/htdocs roadrunner [www]$ cd roadrunner [www]$ mkdir cache [www]$ mkdir logs [www]$ mkdir templates_c [www]$ mkdir scratch [www]$ chgrp www cache logs templates_c scratch [www]$ chmod 770 cache logs templates_c scratch
The cache, logs, template_c and scratch directories need to be writable by the owner of the apache processes (typically nobody). The details of how to accomplish this will depend on your particular setup.
Edit the config.inc.php file. This file defines database connection parameters, locations of the Roadrunner code, and locations of the Smarty directories.
Add the following to your httpd.conf and restart Apache:
# # Roadrunner Config # <Directory "/usr/local/apache/htdocs/roadrunner"> AddHandler cgi-script .cgi Options +ExecCGI DirectoryIndex index.php index.html </Directory>
Perl Modules/Scripts
This section describes various data loading and utility scripts associated with Roadrunner and the modules on which they depend.
Modules
Scripts
The scripts listed below can be used to load various data sources into a Roadrunner database.
- scripts/loadPubChemMLSMR.pl loads the MLSMR compound data from PubChem SDF files and the web.
- scripts/loadPubChemBioAssays.pl loads PubChem BioAssay descriptions and data.
- scripts/loadABSDF.pl loads SDF as exported from AcrivityBase.

