Tuesday, July 13, 2010

DAS2-genopub

==Installing the GenoPub DAS2 Server==

=== Modes ===
There are two ways to configure the GenoViz Genometry DAS2 server:
* Classic mode: The annotations are organized into a directory structure on the file system.
* GenoPub mode: The annotations are managed by the GenoPub (Genomic Annotation Publisher), which stores information about each annotation in a database. A web-based tool allows annotations to be easily added, described, and organized. Through the tool, users and groups are managed and annotation security is specified. Access to annotations is brokered by the DAS2 server so that only authorized users can gain access to these resources.

Here are instructions for installing the DAS2 server in GenoPub mode. Any java servlet container will work. Here we show how to do this with Tomcat. Likewise most relational databases can be appropriately configured. In this demonstration we are using MySQL. Lastly, these web apps were developed and run on Windows but since the majority of bioinformatics web servers use Linux, we use Red Hat Enterprise 5 in this tutorial.


=== System Requirements ===
* Java 6+, 64-bit recommended (http://java.sun.com/)
* Apache Tomcat 5.5+ (http://apache.tomcat.org/)
* MySQL database server (http://mysql.com)
* MySQL jdbc driver (http://mysql.com, download the mysql-connector-java-5.1.7.zip)
* Web accessible Linux, MacOSX, or Windows server with > 4G of RAM. This demo uses Red Hat Enterprize 5.



== Step 1: Check your java version ==
* Check that your java version is 6+ or 1.6+ by typing 'java -version' on the command line
* Download and install a new java if needed, http://java.sun.com/
* In MacOSX modify which java to use with the /Applications/Utilities/Java\ Preferences app


== Step 2: Install and Configure Tomcat 5.5+ ==
* Make a new user called tomcat
* Login as tomcat
* Download and unzip Tomcat 5.5+ in the tomcat user's home directory, see http://tomcat.apache.org/download-55.cgi
* Add environmental variables to the tomcat user's ~/.bashrc file using a text editor


#example for tomcat 5.5.25
export CATALINA_HOME=/home/tomcat/apache-tomcat-5.5.25
export JAVA_HOME=/usr
export JRE_HOME=/usr
#increase the memory available to tomcat, set to 4G or more if you have it, note 32bit machines can only use 2G
export CATALINA_OPTS=-Xmx4096m


* Load the variables into your current shell (e.g. ' source ~/.bashrc ')
* Download the MySQL JDBC driver (MySQL Connector/J) from http://dev.mysql.com/downloads/connector/j/ . Uncompress the zip file (mysql-connector-java-5.xxx.zip) and place the ~/mysql-connector-java-xxx/mysql-connector-java-5.xxx-bin.jar into your ~/apache-tomcat-5.xxx/common/lib directory. This is needed for java apps to connect to a MySQL database.
* Punch holes for port 8080 through any firewalls surrounding your computer
* Enable the tomcat shell scripts to be executed (e.g. ' chmod -R 755 ~/apache-tomcat-5.xxx/bin/ ')
* Launch tomcat using the ~/apache-tomcat-5.xxx/bin/startup.sh script
* Verify that tomcat is visible by calling tomcat from a web browser http://yourComputersIP:8080/ (e.g. http://localhost:8080/). Ask someone off site to check it too.
* Check the server log ~/apache-tomcat-5.xxx/logs/catalina.out for errors
* Shut down tomcat using the ~/apache-tomcat-5.xxx/bin/shutdown.sh script


== Step 3: Install the the GenoViz GenoPub DAS/2 Web app ==
* Download the latest das2server-genopub.zip archive from http://sourceforge.net/projects/genoviz/files/
** To build from the GenoViz project, change the '' to true in the genoviz/common.xml file and use ant to run the clean, all, release-das2server targets in the genoviz/build.xml file. The das2server-genopub.zip will be placed in the genoviz/dist/release directory.
* Unzip the das2server-genopub.zip archive in the tomcat user's home directory
* Move the ~/das2server-genopub/das2genopub directory into ~/apache-tomcat-5.xxx/webapps directory


== Step 4: Install and Configure MySQL ==
* MySQL 5+ (http://dev.mysql.com) comes as a standard install option in RedHat, if needed use yum as root to install MySQL


#To install mysql on RedHat Enterprise 5 and set the root password
su root
yum install mysql-server mysql
/etc/init.d/mysqld start
mysqladmin -u root password some_password
mysql -u root -p


* Start the MySQL daemon '/etc/init.d/mysqld start'
* Login as root 'mysql -u root -p'
* Create a database user account called 'genopub'. Here is an example mysql command:


mysql> CREATE USER 'genopub'@'localhost' IDENTIFIED BY 'some_password';
mysql> GRANT ALL PRIVILEGES ON genopub.* TO 'genopub'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'genopub'@'%' IDENTIFIED BY 'some_password';
mysql> GRANT ALL PRIVILEGES ON genopub.* TO 'genopub'@'%' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;


* Logout of the root mysql account and login to mysql as the genopub user, 'mysql -u genopub -p'
* In mysql, run the ~/das2server-genopub/genopub.sql script to create the genopub database 'mysql> source ~/das2server-genopub/genopub.sql;'


== Step 5: Configure the GenoViz GenoPub DAS/2 Web app ==
* Modify the '~/apache-tomcat-5.xxx/webapps/das2genopub/WEB-INF/web.xml' doc in a text editor
** Change the '/path/to/das2genopub/genopubdata/' to the full path directory name where you want to store your data (e.g. '/home/tomcat/GenoPubData' )
** Create that data directory. Note it should not be the same directory used to store data from the classic mode DAS/2 server.
** Change the 'admin@example.com' to point to a trusted admin
** Change the 'http://www.example.com:8080/das2genopub/genome' replacing 'www.example.com:8080' with the URL for your machine. This is the same one you used to verify your tomcat installation.

* Modify the ~/apache-tomcat-5.xxx/webapps/das2genopub/META-INF/context.xml doc in a text editor
** Set the docBase in to the relative path of the webapp application. (e.g. )
** Set the 'your_genopub_db_password_here' in to the genopub user password you assigned in MySQL.

* (Optional) Create a 'index.html' doc describing your server and place it in the '~/apache-tomcat-5.xxx/webapps/das2genopub/' directory. This will be hot linked in some applications.
* (Optional) Likewise, add a favicon.ico to the '~/apache-tomcat-5.xxx/webapps/das2genopub/' directory representing your organization. This will be displayed in apps alongside your genopub server name.


== Step 6: Launch it! ==
* Be sure the mysql daemon is running...
* Start up tomcat...
* Launch the GenoPub tool: http://yourhost:8080/das2genopub/genopub . To programmatically access this sever using DAS/2 the URL is http://yourhost:8080/das2genopub/genome .
* Login with the username 'admin' and the password 'admin'. Click the 'Change password' link on the top right of the screen and change the admin password. Click on the Users and Groups link and add yourself as a user. If you are an admin, click the 'Admin' radio button. Create a group. Add yourself. Quit your browser and try the URL again as yourself to make sure you can login.
* Add some data. Note you need to belong to a group to be able to set the visibility permissions.
* Click the 'Reload DAS/2 Server' link to add your new data to the server


== Step 7: Register Your Das/2 Server ==
* Register your http://yourhost:8080/das2genopub/genome URL, otherwise no one will know about your most excellent data. Note only datasets you designate as public will be visable to non authenticated users.
* Currently, the [http://www.dasregistry.org DasRegistry] does not support DAS/2 services. As a temporary work around, download the 'genopubRegistry.xml' file from the [http://genoviz.svn.sourceforge.net/viewvc/genoviz/trunk/genopub_server/resources/ GenoViz Project], add an entry, and email it back to the [mailto:genoviz-devel@lists.sourceforge.net GenoViz developers] . If you have access to the GenoViz SVN, modify it directly.


== Step 8: Visualize your data in IGB ==
* The [[Software:IGB | Integrated Genome Browser]] is fully DAS/2 and DAS/1 compliant and a good application for visualizing your genomic data.
* Launch IGB using the web start links : [http://bioserver.hci.utah.edu/IGB/igb_beta_1G.jnlp IGB (1GB)] or [http://bioserver.hci.utah.edu/IGB/igb_beta_3G.jnlp IGB (3GB)]
* Under the 'Data Access' tab, click the 'Configure...' button and add your server:
** Server URL 'http://yourhost:8080/das2genopub/genome' '''NOTE''' the last word, it's genome '''NOT''' genopub
** Server name 'YourOrg'
** Server type 'DAS2'
** Login 'your genopub login name'
** Password 'your genopub password'
* Click the 'Add' button, a confirmatory message should appear
* Under the 'Data Access' tab, select a Species and a Genome Version where your data resides


Please send comments to the [http://sourceforge.net/tracker/?group_id=129420&atid=714744 GenoViz Bug Tracker (Category GenoPub)] if you encounter install issues or needed corrections.

No comments:

Post a Comment