Monday, June 25, 2012

Install UCSC Genome Browser

Introduction:

How to install a minimal installation of UCSC Genome Browser on Centos6 x86_64 with in a custom directory.

Steps:

- Install apache and mysql:
 yum install httpd mysql-server mysql
- Start services:
service httpd start
service mysqld start
chkconfig httpd on
chkconfig mysqld oni
- Configure Apache:
cd /var/www
mkdir html
mkdir cgi-bin
Create a config file like: /etc/httpd/conf.d/ucsc_genomebrowser.conf:
#
# UCSC GENOME BROWSER
#

<Directory "/var/www/ucsc-genomebrowser/html">
     Order Allow,Deny
     Allow from all
</Directory>

<Directory "/var/www/ucsc-genomebrowser/cgi-bin">
     AllowOverride None
     Options None
     Order allow,deny
     Allow from all
</Directory>

XBitHack on
<Directory "/var/www/ucsc-genomebrowser/html">
     Options +Includes
</Directory>

ScriptAlias /genomebrowser/cgi-bin /var/www/ucsc-genomebrowser/cgi-bin
Alias /genomebrowser /var/www/ucsc-genomebrowser/html
Alias /style /var/www/ucsc-genomebrowser/html/style
Reload Apache: service httpd restart
- Preparing the system:
Execute and add to /etc/profile:
    export WEBROOT=/var/www/ucsc-genomebrowser/html
    export CGI_BIN=/var/www/ucsc-genomebrowser/cgi-bin
    export MYSQLDATA=/var/lib/mysql
cd /usr/local/
mkdir apache
cd apache/
ln -s /var/www/ucsc-genomebrowser/html/ htdocs
yum install openssl
cd /usr/lib64
ln -s libcrypto.so.10 libcrypto.so.6
ln -s libssl.so.10 libssl.so.6
- Getting web files:
rsync -avzP rsync://hgdownload.cse.ucsc.edu/cgi-bin/ $CGI_BIN
rsync -avzP rsync://hgdownload.cse.ucsc.edu/htdocs/ $WEBROOT/
mkdir  /gbdb
cd /gbdb
mkdir -p hg19/nib
cd hg19/nib
rsync -avzP --delete --max-delete=20 rsync://hgdownload.cse.ucsc.edu/gbdb/hg19/hg19.2bit .
cd  /gbdb/hg19/
ln -s nib/hg19.2bit
chcon -R unconfined_u:object_r:httpd_sys_script_exec_t:s0 /gbdb
chown -R apache.apache /gbdb/

- Set up the Database:
  - hgcentral DB:
wget http://hgdownload.cse.ucsc.edu/admin/hgcentral.sql
mysql> create database hgcentral
mysql --[mysqlaccessoptions] hgcentral < hgcentral.sql
   - hgFixed DB:
mysql --[mysqlaccessoptions] -e "create database hgFixed"
  - hg19 DB:
mysql> CREATE DATABASE hg19
cd /var/lib/mysql/hg19
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/grp* .
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/trackDb* .
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/hgFindSpec* .
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/chromInfo* .
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gold* .
rsync -avP rsync://hgdownload.cse.ucsc.edu/mysql/hg19/gap* .

- BD Permisions:

GRANT SELECT, CREATE TEMPORARY TABLES
  ON hgcentral.*
  TO readonly@localhost
  IDENTIFIED BY 'access';

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER
  ON hgcentral.*
  TO readwrite@localhost
  IDENTIFIED BY 'update';
 
GRANT SELECT, CREATE TEMPORARY TABLES
  ON hg19.*
  TO readonly@localhost
  IDENTIFIED BY 'access';

GRANT SELECT, CREATE TEMPORARY TABLES
  ON hgFixed.*
  TO readonly@localhost
  IDENTIFIED BY 'access';

 - Getting config file:
wget http://genome-test.cse.ucsc.edu/~kent/src/unzipped/product/ex.hg.conf
mv ex.hg.conf /var/www/ucsc-genomebrowser/cgi-bin/hg.conf
chmod 600 /var/www/ucsc-genomebrowser/cgi-bin/hg.conf
chown apache.apache /var/www/ucsc-genomebrowser/cgi-bin/hg.conf
chcon unconfined_u:object_r:httpd_sys_script_exec_t:s0 /var/www/ucsc-genomebrowser/cgi-bin/hg.conf

- Configuring:
Change users and passwords (readonly/access and readwrite/update)
[...]
defaultGenome=hg19
[...]

-Trash:
mkdir /var/www/ucsc-genomebrowser/trash
chown apache:apache /var/www/ucsc-genomebrowser/trash


REFERENCES:

http://genome.ucsc.edu/admin/mirror.html
http://bergmanlab.smith.man.ac.uk/?p=1111
http://genomewiki.ucsc.edu/index.php/Browser_Installation
http://genomewiki.ucsc.edu/index.php/Minimal_Browser_Installation

No comments:

Post a Comment