Thursday, June 27, 2013

Install WashU Epigenome Browser mirror at a fresh Ubuntu server


The official blog for WashU Epigenome Browser: http://washugb.blogspot.com/
The official release for source code of WashU Epigenome Browser: here
The main site for WashU Epigenome Browser: http://epigenomegateway.wustl.edu/
Please also see this post from the author of WashU Epigenome Browser for installation instructions.


Assume we have a fresh Ubuntu system and want to install the WashU Epigenome Browser mirror, here comes the steps. (It was pretty straightforward, and it's a minimal installation for human hg19 with default tracks, occupy ~10Gb disk space, full installation requires at least 3Tb space)

Note:  the default tracks come from the Roadmap Epigenomics Project.
          the annotation tracks come from public database UCSC Genome Browser and Ensemble.

0, before start


assume we put the browser source file at /opt/washugb
assume we put the tracks files at /opt/washugb_data

also need to make some temporary folder:
sudo mkdir /var/www/trash
sudo ln -s /var/www/trash/ /usr/lib/
sudo mkdir /var/www/browser/t
sudo chown www-data /var/www/trash/ /var/www/browser/t

and we have a IP address of 192.168.253.178, as shown below

$ ifconfig
em1       Link encap:Ethernet  HWaddr d4:ae:52:7e:46:56
          inet addr:192.168.253.178  Bcast:192.168.253.255  Mask:255.255.255.0
          inet6 addr: fe80::d6ae:52ff:fe7e:4656/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33938042 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31788428 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000


1, get web, database module and R installed


sudo apt-get install apache2 
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
# will prompt for typing for root password for mysql
sudo apt-get install r-base

2, get the source code for WashU Epigenome Browser and decompress


cd /opt/washugb
wget http://epgg-test.wustl.edu/mirror_support/subtleKnife.v20.mirror.tar.gz
tar zxvf subtleKnife.v20.mirror.tar.gz


Note: this version of source code was modified from the official release v20, the version included customized UCSC Kent source code, samtools and tabix source code, re-distributed under their own licenses. The WashU Epigenome Browser C source code, JavaScript  html and css files should be used free only for personal or academic use, commercial users should contact the Epigenome Browser Team at WashU.

3, compile the source


edit the file subtleKnife.c before compile, 

#define Mysqluser "root"
#define Mysqlpswd "password"

replace your right username and password
then type:

make

three binary file subtleKnife svg bwquery will generated in current folder, copy them to the cgi-bin folder of your webserver Apache  as below

4, move/copy the cgi binary programs and html, javascript, style sheet to corresponding locations


sudo cp subtleKnife svg bwquery /usr/lib/cgi-bin/
sudo mkdir /var/www/browser
sudo cp *.js *.html *.css /var/www/browser
sudo cp -r images/ /var/www/browser/

5, get the track files for a minimal installation for hg19


go to /opt/washugb_data folder, make a hg19 and seq directory
cd /opt/washugb_data
mkdir hg19 seq

open url http://epgg-test.wustl.edu/mirror_support/
download all the files under hg19 to the hg19 foler, all the files under seq to seq folder

6, manipulate the database


Go to the config directory of the source, create a database called WashUGb, and load the sql file dbTable.sql to the database: (you need type the password for mysql root, defined in step1 when you install database modules)

add WashUGb and hg19 database
cd /opt/washugb/config
mysql -u root -p -e "create database WashUGb;"
cat dbTable.sql | mysql -u root -p WashUGb
mysql -u root -p -e "create database hg19;"
cat sessionUtils.sql | mysql -u root -p hg19

go to hg19 folder, download tracks files and load track configuration
cd /opt/washugb/config/hg19
wget http://epgg-test.wustl.edu/mirror_support/hg19_epgg_anno.sql.gz
gunzip -c hg19_epgg_anno.sql.gz | mysql -u root -p hg19
cat makeDb.minimal.sql | mysql -u root -p hg19 --local-infile=1

Note: you need to edit the makeDb.minimal.sql file if you didn't put your tracks files at the /opt/washugb_data folder. (those two lines):

"/opt/washugb_data/hg19/",
"/opt/washugb_data/seq/hg19.gz",


7, the browser should be accessed now


Open any web browser (Google Chrome, FireFox, Safari, Opera, IE >=10), point to the http://192.168.253.178/browser, the browser should work now.

(below was a screenshot using IE10 visiting the new installed mirror)





No comments:

Post a Comment