Installation (2012-11-18)

From wubrowse wiki
Revision as of 22:48, 11 April 2015 by Dli (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Setting up a browser sandbox on a splendid Dell T5600 with freshly installed Ubuntu 12.04.1 LTS desktop

$ uname -a
Linux burrow 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012 i686 i686 i386 GNU/Linux


$ sudo apt-get install mysql-server
# enter root password

$ sudo apt-get install vim r-base apache2 libmysqlclient-dev libmysqld-dev dia gimp openssh-server

$ mkdir /usr/lib/bin
$ mkdir /var/www/trash
$ ln -s /var/www/trash /usr/lib/trash


get entire source "subtleKnife.v??.tgz" of most current version
$ mkdir ~/subtleKnife
$ tar zxvf ../subtleKnife.v12.tgz


use Kent Source Tree for bigwig support. However you can skip this step by using bedGraph/tabix instead of bigWig
$ wget http://hgdownload.cse.ucsc.edu/admin/jksrc.zip
$ cat >> ~/.bashrc
MACHTYPE=i386
MYSQLINC=/usr/include/mysql
MYSQLLIBS='/usr/lib/i386-linux-gnu/libmysqlclient.a -lz'
USE_BAM=0
export MACHTYPE MYSQLINC MYSQLLIBS
^D
$ source ~/.bashrc

$ cd ~/kent/src
$ make libs
$ cd utils
$ mkdir bwquery
$ cd bwquery/
$ cp ~/subtleKnife/bwquery/* .
$ make
# binary "bwquery" is generated
$ mv bwquery /usr/lib/bin/


get latest tabix (tabix-0.2.6)
$ cd /srv/epg
$ tar xvf tabix-0.2.6.tar
$ cd tabix-0.2.6
$ cp index.c index.c.bak
$ cp ~/subtleKnife/tabix/index.c.0.2.6 index.c
$ make

build browser CGI binary
$ cd ~/subtleKnife/
$ gcc -O -g  -Wall -Wformat -Wimplicit -Wreturn-type -Wuninitialized -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOLOR32 -Wall -Wformat -Wimplicit -Wreturn-type -I/srv/epg/tabix-0.2.6 -I/usr/include/mysql -o subtleKnife.o -c subtleKnife.c
$ gcc -O -g  -Wall -Wformat -Wimplicit -Wreturn-type -Wuninitialized -o subtleKnife subtleKnife.o -pthread /usr/lib/i386-linux-gnu/libmysqlclient.a -L/srv/epg/tabix-0.2.6 -ltabix -lz -lm -lpthread -ldl
# these commands are written in "make.sh", however a "makefile" isn't available yet...
# binary "subtleKnife" is generated
$ mv subtleKnife /usr/lib/cgi-bin

setup browser client-side stuff
$ cd ~/subtleKnife
$ cp -R frontpage/* /var/www/
$ mkdir /var/www/browser
ln -s /home/xzhou/subtleKnife/index.html /var/www/browser/index.html
ln -s /home/xzhou/subtleKnife/base.js /var/www/browser/base.js
ln -s /home/xzhou/subtleKnife/personality.js /var/www/browser/personality.js
ln -s /home/xzhou/subtleKnife/style.css /var/www/browser/style.css
ln -s /home/xzhou/subtleKnife/sukn.js /var/www/browser/sukn.js
ln -s /home/xzhou/subtleKnife/images/ /var/www/browser/images

generate dump file on production server (you don't need to do this...)
$ mysqldump -uxxx -p hg19heatmap --opt --ignore-table=hg19.session --ignore-table=hg19.genesetRuntime | gzip -c > /var/www/sql/hg19.sql.gz

Go to http://epigenomegateway.wustl.edu/sql/ to download the mysql dump file that belong to the genome you're using to recover the database.

following is the command to recover hg19 genome (database name is "hg19")
# on the server
mysql> create database WashUGb;
$ cd ~/subtleKnife/config
$ cat dbTable.sql |mysql -uxxx -p WashUGb

# download it to my local computer
mysql> create database hg19;
$ wget http://epigenomegateway.wustl.edu/sql/hg19.sql.gz
$ gunzip hg19.sql.gz -c |mysql -uxxx -p hg19

note: the database recovered in this way contains all information that we've built and made available on production server, e.g. the track2Detail and other tables.
you can certainly erase them and write it with your own tracks and configuration by following the procedures below

$ cd hg19/
$ cat makeDb.sql ../sessionUtils.sql |mysql -uxxx -p hg19