BASIC INSTALL PROCEDURE ======================= This documentation is personnal but may be used to make a more general installation of galaxy The steps used to install galaxy (quick ...): 1. Get latest galaxy version ~$ hg clone https://bitbucket.org/galaxy/galaxy-dist/ ~$ cd galaxy-dist ~$ hg update stable 2. Install required python eggs and start galaxy on localhost:8080 ~$ sh run.sh 3. Custom start (background control) ~$ sh run.sh --daemon ~$ sh run.sh [start|stop|restart|status] ADVANCED INSTALL PROCEDURE ========================== NOTE : apache2 is the proxy server used in this procedure NOTE : all RewriteRule must be done at the end of the galaxy apache configuration file Run galaxy in a virtual host --------------------------- For this to work, user must be sudoer. Galaxy must be installed with the basic procedure first I'm going to create a virtual host on localhost for galaxy. This virtual host will be named galaxy.local, so each time I 'll type http://galaxy.local in a web browser, this will be redirected to galaxy. The next steps requires sudoer : 1. Add domain name to your DNS in /etc/hots ~$ gksudo gedit /etc/hosts add this line : 127.0.0.1 galaxy.local 2. Create site root in /var/www/ ~$ sudo mkdir /var/www/galaxy.local I've named it galaxy local, but any name is possible 3. Configure virtual host in /etc/apache2/sites-available/ Create the file /etc/apache2/sites-available/galaxy.local, which will be an apache2 configuration file, and copy those line in it ServerAdmin webmaster@localhost # serve name as defined in /etc/hosts ServerName galaxy.local # where the site is located DocumentRoot /var/www/galaxy.local Options +Includes +FollowSymLinks RewriteEngine on # Redirect all request to this virtual host to galaxy (installed on localhost:8080) RewriteRule ^(.*) http://localhost:8080$1 [P] 4. Add/remove this virtual host to available sites ~$ sudo a2ensite galaxy.local or ~$ sudo a2dissite galaxy.local 5. Restart apache server ~$ sudo service apache2 reload User authentication ------------------- There are multiple used authentication methods available. User must be sudoer. * Basic authentication '''''''''''''''''''''' 1. Create password for a user in a password file ~$ htpasswd -c /home/inabihoudin/workspaces/Galaxy/password ibou New password: ibou 2. Edit /etc/apache2/sites-available/galaxy.local and make it look like this ServerAdmin webmaster@localhost # serve name as defined in /etc/hosts ServerName galaxy.local # where the site is located DocumentRoot /var/www/galaxy.local Options +Includes +FollowSymLinks RewriteEngine on # BASIC authentication AuthType Basic AuthName Galaxy # Change this path to the path of auth fille generated by htpassword AuthUserFile /home/inabihoudin/workspaces/Galaxy/password Require valid-user # Take the $REMOTE_USER environment variable and set it as a header in the proxy request. RewriteCond %{IS_SUBREQ} ^false$ RewriteCond %{LA-U:REMOTE_USER} (.+) # replace any char by -, and set env RU with previous REMOTE_USER RewriteRule . - [E=RU:%1] RequestHeader set REMOTE_USER %{RU}e # Redirect all request to this virtual host to galaxy (installed on localhost:8080) RewriteRule ^(.*) http://localhost:8080$1 [P] 3. In universe_wsgi.ini : - set 'use_remote_user = True' - set 'remote_user_maildomain = example.com' If the use_remote_user is set to True, you must set a defeault remote_user_maildomain 4. Restart apache2 and galaxy ~$ sudo service apache2 reload ~$ sh run.sh restart NOTE : do not forget to change the path for AuthUserFile directive * LDAP authentication ''''''''''''''''''''' TODO !!!!!! # Enable ldap authentication, requires apache module 'mod_authnz_ldap' AuthType Basic AuthName "Please use your genotoul ldap to identicate to galaxy" AuthBasicProvider ldap AuthLDAPURL "ldap://ldap-genotoul.toulouse.inra.fr:389/ou=genopole,ou=toulouse,o=inra,c=fr?uid?sub?(objectClass=person)" AuthzLDAPAuthoritative off Require valid-user # Set the REMOTE_USER header to the contents of the LDAP query response's "uid" attribute RequestHeader set REMOTE_USER %{AUTHENTICATE_uid}e .... RewriteRule ^/static/style/(.*) /home/inabihoudin/workspaces/Galaxy/galaxy-dist/static/june_2007_style/blue/$1 [L] RewriteRule ^/static/(.*) /home/inabihoudin/workspaces/Galaxy/galaxy-dist/static/$1 [L] RewriteRule ^/favicon.ico /home/inabihoudin/workspaces/Galaxy/galaxy-dist/static/favicon.ico [L] RewriteRule ^/robots.txt /home/inabihoudin/workspaces/Galaxy/galaxy-dist/static/robots.txt [L] RewriteRule ^(.*) http://localhost:8080$1 [P] Display application : IGV ------------------------- * Setting up ''''''''''''' NOTE : You need to have mod_xsendfile (apache module : https://tn123.org/mod_xsendfile/ wget de mod_xsendfile-0.12.tar.gz tar -xvzf mod_xsendfile-0.12.tar.gz yum install httpd-devel apxs -cia mod_xsendfile.c /usr/lib64/httpd/modules/mod_xsendfile-0.12 1. If not done already, edit galaxy apache configuration file and add those lines in location bloc # .... # other apache directive # ..... XSendFile on XSendFilePath / This should be added to the existing block if you already have one, and adjusted accordingly if you're serving Galaxy from a subdirectory. Note: If you use a version of mod_xsendfile older than 0.10, use "XSendFileAllowAbove on" instead of "XSendFilePath /" 2. Setup IGV as a Display Application in Galaxy. Add the following to the bam datatype in datatypes_conf.xml file: This is done already in the new code ... 3. Setup Apache to allow unauthenticated access to the bam files. This is a small security hole, but is necessary since IGV cannot authenticate to Galaxy. To do this I adding the following LoctionMatch section to the httpd.conf file. RequestHeader set REMOTE_USER igv_display@example.org Satisfy Any Order deny,allow Allow from all 4. set apache_xsendfile = True in the [app:main] section of universe_wsgi.ini and restart Galaxy. 5. Restart apache server * Add a custom genome file to igv and galaxy '''''''''''''''''''''''''''''''''''''''''''' 1. Open IGV and add your genome with 'Genomes > Create .genome file'. It is very important to remember the 'uniq identifier' 2. Edit the file galaxy-dist/tool-data/shared/igv/igv_build_sites.txt and add the uniq_identifier to the list of dbkey and ivg_build_name for both 'web_link_main' and 'local_default'. For example if your uniq_identifier is 'contigs', the file becomes like this #site_id site_name site_url dbkey ivg_build_name web_link_main web current http://www.broadinstitute.org/igv/projects/current/igv.php hg19,hg_g1k_v37,hg18,....,ppatens_1.2,D.discoideum,contigs hg19,b37,hg18,...,ppatens_1.2,D.discoideum,contigs local_default local http://localhost:60151/load hg19,hg_g1k_v37,hg18,....,ppatens_1.2,D.discoideum,contigs hg19,b37,hg18,...,ppatens_1.2,D.discoideum,contigs NOTE : the line starting with 'web_link_main ...' will allow you to use the web version of IGV NOTE : the line starting with 'local_default ...' will allow you to use a local version of IGV 3. Edit the file galaxy-dist/tool-data/shared/ucsc/builds.txt and add a new line with the uniq_identifier and a description. For example if your uniq_identifier is 'contigs', the new line can be : contigs Contigs not in public (contigs) 4. Restart Galaxy * Using igv with your genome '''''''''''''''''''''''''''' 1. Upload or reate a BAM file. Be carefull that the genome you've used must be the same as the one you've added to IGV in the previous step !!!! 2. Edit the property of the bam dataset (click on the pencil) and change the Database/Build to the one you've added in the previous steps. A new link with 'display with IGV web current local' will show up in the dataset box. 3. If you chose the local option, be sure to have IGV alreaedy running localy. If you chose the web current option, you must open it with the Java Web Start program (which should be in /usr/bin/javaws)