Next version of JABA
[jabaws.git] / website / manual.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
2 <html xmlns="http://www.w3.org/1999/xhtml">\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\r
5 <title>Java Bioinformatics Analyses Web Services (JABAWS) manual</title>\r
6 <link href="ws.css" rel="stylesheet" type="text/css" media="screen,  projection, handheld, tv" />\r
7 <link rel="stylesheet" type="text/css" media="print" href="print.css"/>\r
8 \r
9 <script type="text/javascript" src="prototype-1.6.0.3.js"></script>\r
10 </head>\r
11 <body>\r
12 <div id="page">\r
13 <div id="banner">\r
14 <h2><span class="headeru">JA</span>va <span class="headeru">B</span>ioinformatics <span class="headeru">A</span>nalyses <span class="headeru">W</span>eb <span class="headeru">S</span>ervices</h2>\r
15 </div><!-- banner end-->\r
16 <div id="wrapper">\r
17 <div id="panel">\r
18         <a href="index.html">Home</a>\r
19         <a class="selected" href="manual.html">Manual</a>\r
20         <a href="howto.html">How To</a>\r
21         <a href="download.html">Download</a>\r
22         <a href="http://www.jalview.org">Jalview</a>\r
23 </div>\r
24 <!-- panel end-->\r
25 <div id="content">\r
26 \r
27 \r
28 <h2>JABAWS Manual</h2>\r
29 <h4>JABAWS Installation</h4>\r
30 <p>JABA web services require Java 6 to function. We recommend using Sun Java Virtual Machine. JABAWS can be deployed on any Servlet 2.4 compatible web application server. We have tested JABA on the Apache-Tomcat version 6 web application container, however, version 5.5 should do as well. To deploy JABAWS follow your web application server specific deployment procedures. For Apache-Tomcat just drop the war file into webapps directory. Tomcat will do the rest. At this point you should have JABA web services up and running on windows machines. There are more steps to do if you are deploying JABAWS on other operation systems. </p>\r
31 <p>JABA web services depend on the alignment programs to do the actual alignment, so it must have an access to the alignment programs which can be executed on your platform. JABAWS is bundled with native windows executables, native Linux i386 executables, and the source code for all alignment programs JABAWS wraps.  If you are installing it on Linux should not worry about installing the alignment programmes, the ones that comes with JABAWS should work.  For any other operation systems you need to make the alignment programs available to JABAWS. </p>\r
32 <p>If you are installing on Linux it may be just a matter of setting executable flag for the binaries bundled with JABAWS. There is a script which would help you with that. To use it cd to <span class="hightlight">&lt;webapplicationpath&gt;/binaries/src</span> and run <span class="hightlight">sh setexecflag.sh</span> script. Restart the Tomcat.  That is it JABAWS should work at this point. If not read on... or have a look at <a href="howto.html#usingtomcat">deploying on Tomcat </a>tips.  You may want to enable logging, <a href="#logfiles">see below how to do that</a>. </p>\r
33 <h4>Making Alignment Programs Available to JABAWS </h4>\r
34 <p>There are three possible solutions for this problem</p>\r
35 <ul>\r
36   <li>Reuse the binaries that are already have in your system</li>\r
37   <li> Use bundled with JABAWS alignment programs</li>\r
38   <li>    Obtain the alignment programs for your OS elsewhere</li>\r
39 </ul>\r
40 <p>They are described in greater details below </p>\r
41 <p><strong><a name="haveexec" id="haveexec"></a>If you would like to use the binaries you already have </strong></p>\r
42 <p> Than you just need to let JABAWS know there they are. For this edit <span class="code">conf/Executable.properties </span>file. Please provide an absolute path to  each executable in your system. For example default path for clustalw executable is defined as <span class="code">local.clustalw.bin=binaries/src/clustalw/src/clustalw2</span> replace it with absolute path to executable in your system. Instead of changing <span class="hightlight">Executable.properties</span> you could replace executables bundled with JABAWS with the once you have. Then the default configuration will work for you. If you like to find out more about <span class="hightlight">Executable.properties</span> file <a href="#exec">see below</a>. </p>\r
43 <p><strong>If you would like to use bundled with JABAWS alignment programs </strong></p>\r
44 <ol>\r
45   <li><a name="setexecflag" id="setexecflag"></a> Set executable flag for binaries. For this you could use the script provided. <span class="hightlight">cd</span> to <span class="hightlight">binaries/src</span><br />  \r
46     run <span class="hightlight">setexecflag.sh</span> script. </li>\r
47   <li>Make sure binaries supplied work under your OS. For this run each binary. You do not need any input or flags. If you see a error message complaining about missing libraries or other problems with an executable itself rather than with an input, you need to (a) recompile the binary.\r
48     <ul>\r
49       <li> To recompile all the binaries for your system you could use a script supplied with the JABAWS. <br />\r
50         For this cd to folder<span class="hightlight"> binaries/src</span>        execute script compilebin.sh \r
51         (either chmod +x it or sh compilebin.sh)</li>\r
52       <li>Makes sure everything compiled  and work<br />\r
53         correctly performing first part of a step 2 again. </li>\r
54       <li>If not everything compiled then, it may be that your system does not have all the tools required for recompilation. At a very least check that you have gcc, g++ and make installed in your system. If not install these packages and repeat step (a). </li>\r
55       <li>If compilation fails with unclear reason, try obtaining the <a href="#obtainexec">pre compiled binaries</a> for your OS</li>\r
56       </ul>\r
57      </li>\r
58   <li>Consider recompiling all binaries for your platform, this is likely to give you a performance increase. </li>\r
59 </ol>\r
60 <p><strong><a name="obtainexec" id="obtainexec"></a>Obtain alignment program for your operation system elsewhere </strong></p>\r
61 <p>You could search for pre-packaged compiled executable in your system package repository or try downloading compiled version from alignment program's home page. Then, executables supplied with the system can be replaced with downloaded or new path to the executable can be defined in <span class="hightlight">executable.properties</span> as described above.</p>\r
62 <h4>Default JABA Web Services Configuration</h4>\r
63 <p>By default JABAWS configured with local engine enabled and an output directory called &quot;jobsout&quot; within web application itself. This will give you a working copy of JABAWS straight after the deployment. You may be interested to know what is the the <a href="#warfile">war file</a>.</p>\r
64 <h4>JABAWS Configuration Details </h4>\r
65 There are three part of the system you can configure. The local and cluster engines and individual executables.  \r
66 <h4>Local Engine Configuration</h4>\r
67 <p>\r
68 Local engine configuration is achieved by changing settings in the properties file conf/Engine.local.properties.\r
69 Supported configuration settings are: \r
70 <br/>\r
71 <span class="hightlight">engine.local.enable=true</span> - # enable or disable local engine, valid values true | false\r
72 <br/>\r
73 <span class="hightlight">local.tmp.directory=D:\\clusterengine\\testoutput </span>- a directory to use for temporary files storage, optional, defaults to java temporary directory \r
74 <br/>\r
75 <span class="hightlight">engine.local.thread.number=4</span> -  Number of threads for tasks execution (valid values between 1 and 2x cpu. Where x is a number of cores available in the system). Optional defaults to the number of cores for core number <=4 and number of cores-1 for greater core numbers.</p>\r
76 <p>If you are planning to use local engine (which you have to if you do not have a cluster) it is a good idea to increase the amount of memory available for the web application server. Apache-Tomcat will be happy to take its memory settings from JAVA_OPTS environmental variable. We would recommend using Sun Java Virtual Machine (JVM) in preference to Open JDK. To specify which JVM to use for Apache-Tomcat just define a JAVA_HOME  environmental variable. Below is an example of code which can be added to <span class="hightlight">&lt;tomcat_dir&gt;/bin/setenv.sh</span> script to define which JVM to use and a memory settings for Tomcat server.  Tomcat server startup script (<span class="hightlight">catalina.sh</span>) will execute <span class="hightlight">setenv.sh</span> on each server start automatically. <br />\r
77   <span class="code">export JAVA_HOME=/homes/ws-dev2/jdk1.6.0_17/<br />\r
78     export JAVA_OPTS=&quot;-server -Xincgc -Xms512m -Xmx1024m&quot;</span></p>\r
79 <h4>Cluster Engine Configuration</h4>\r
80 <p>Supported configuration settings: <br/>\r
81 <span class="hightlight">engine.cluster.enable=true</span> - # enable or disable local engine true | false, defaults to false\r
82 <br/>\r
83 <span class="hightlight">cluster.tmp.directory=/homes/clustengine/testoutput- </span>a directory to use for temporary files storage. The value must be an absolute path to the temporary directory. Required. The value must be different from what is defined for local engine. This directory must be accessible from all cluster nodes. <br />\r
84 For the cluster engine to work SGE_ROOT and LD_LIBRARY_PATH environmental variable have to be defined. They tell the cluster engine where to find DRMAA libraries. These environmental variables should be defined on the web application server e.g. </p>\r
85 <p><span class="code">SGE_ROOT=/gridware/sge<br />\r
86   LD_LIBRARY_PATH=/gridware/sge/lib/lx24-amd64</span></p>\r
87 <p>Finally, do not forget to configure executables for the cluster execution, they may be the same as for the local execution but may be different. Please refer to the executable configuration section for further details. </p>\r
88 <h4><a name="exec" id="exec"></a>Executable Configuration</h4>\r
89 <p>All executables, the binary multiple sequence alignment programs are configured in conf/Executable.properties file. Each executable configured with a number of options they are: \r
90 <span class="code">\r
91   local.X.bin.windows=&lt;path to executable under windows system, optional&gt;\r
92   <br/>local.X.bin=&lt;path to the executable under non-windows system, optional&gt;\r
93   <br/>cluster.X.bin=&lt;path to the executable on the cluster, all cluster nodes must see it, optional&gt;\r
94   <br/>X.bin.env=&lt;semicolon separated list of environmental variables for executable, use hash symbol as name value separator, optional&gt;\r
95   <br/>X.--aamatrix.path=&lt;path to the directory containing substitution matrices, optional&gt;\r
96   <br/>X.presets.file=&lt;path to the preset configuration file, optional &gt;\r
97   <br/>X.parameters.file=&lt;path to the parameters configuration file, optional&gt; \r
98   <br/>X.limits.file=&lt;path to the limits configuration file, optional&gt;\r
99   <br/>X.cluster.settings=&lt;list of the cluster specific options, optional&gt;</span></p>\r
100 <p>\r
101   Where X is a short executable wrapper class name.  </p>\r
102 <p>Default JABAWS configuration includes path to local executables to be run by the local engine only, all cluster related settings are commened out, but they are there for you as example. Cluster engine is disabled by default. To configure executable for cluster execution uncomment the X.cluster settings and change them appropriately.<br/>\r
103   For example a complete Mafft configuration may look like this:<span class="code" >  local.mafft.bin.windows=\r
104   <br/>\r
105   local.mafft.bin=binaries/mafft\r
106   <br/>cluster.mafft.bin=/homes/cengine/mafft\r
107   <br/>mafft.bin.env=MAFFT_BINARIES#/homes/cengine/mafft;FASTA_4_MAFFT#/bin/fasta34;\r
108   <br/>mafft.--aamatrix.path=binaries/matrices\r
109   <br/>mafft.presets.file=conf/settings/MafftPresets.xml\r
110   <br/>mafft.parameters.file=conf/settings/MafftParameters.xml\r
111   <br/>mafft.limits.file=conf/settings/MafftLimits.xml\r
112   <br/>mafft.cluster.settings=-q bigmem.q -l h_cpu=24:00:00 -l h_vmem=6000M -l ram=6000M</span>\r
113 <p>Please not that relative paths must only be specified for the files that reside inside web application directory, all other paths must be supplied as absolute! </p>\r
114 <p>Unfortunately, it is unsafe to modify environmental variable values, thus you need to specify the absolute path to anything defined as environment variable. </p>\r
115 <p>If you are using JABAWS to submit jobs to the cluster (with cluster engine enabled), executables must be available from all cluster nodes the task can be sent to, also paths to the executables on the cluster e.g. <span class="hightlight">cluster.&lt;exec_name&gt;.bin</span> must be absolute.  </p>\r
116 <p>Executables can be located anywhere in your system, they do not have to reside on the server as long as the web application server can access and execute them. </p>\r
117 <p>Cluster settings are treated as a black box, the system will just pass whatever is specified in this line directly to the cluster submission library. This is how DRMAA itself treats this settings. More exactly DRMAA JobTemplate.setNativeSpecification() function will be called. </p>\r
118 <h5><a name="setexecenv"/>Defining Environmental Variables for Executable</h5>\r
119 <p>Environmental variables can be defined in property <span class="code">x.bin.env</span> Where <span class="hightlight">x</span> is one of five executables supported by JABAWS. Several environmental variables can be specified in the same line. For example. <br />\r
120   <span class="code" >mafft.bin.env=MAFFT_BINARIES#/homes/cengine/mafft;FASTA_4_MAFFT#/bin/fasta34;</span></p>\r
121 <p>The example above define two environmental variables with names MAFFT-BINARIES and FASTA_4_MAFFT and values /homes/cengine/mafft and /bin/fasta34 respectively. Semicolon is used as a separator between different environment variables whereas hash is used as a separator for name and value of the variable. </p>\r
122 <h4><a name="mafftconf" id="mafftconf"></a>Configure JABAWS to Work with Mafft </h4>\r
123 <p>If you use default configuration you do not need to read any further. The default configuration will work for you without any changes, however, if you want to install Mafft yourself then there is a couple of more steps to do. </p>\r
124 <p>Mafft executable needs to know the location of other files supplied with Mafft. In addition some Mafft functions depends on the fasta executable, which is not supplied with Mafft, but is a separate package. Mafft needs to know the location of fasta34 executable. </p>\r
125 <p>To let Mafft know where the other files from its package are change the value of MAFFT-BINARIES environmental variable. To let Mafft know where  is the fasta34 executable  set the value of FASTA_4_MAFFT environment variable to point to a location of fasta34 program. The latter can be added to the PATH variable instead. If you are using executables supplied with JABAWS, the path to Mafft binaries would be like <span class="hightlight">&lt;relative path to web application directory&gt;/binaries/src/mafft/binaries</span> and the path to fasta34 binary would be <span class="hightlight">&lt;relative path to web application directory&gt;/binaries/src/fasta34/fasta34</span>. You can specify the location of Mafft binaries as well as fasta34 program elsewhere by providing an absolute path to them. All these settings are defined in <span class="hightlight">conf/Executable.properties</span> file.</p>\r
126 <h4>Testing JABA Web Services</h4>\r
127 <p>You can use a  command line client (part of the client only package) to test you JABAWS installation as described <a href="howto.html#usingcclient">here</a>. If you downloaded a JABAWS server package, you can use <span class="hightlight">&lt;your_jaba_context_name&gt;/WEB-INF/lib/jaba-client.jar</span> to test JABAWS installation as described in <a href="howto.html#usingWsTester">how-to</a>. If you downloaded the source code, then you could run a number of test suits defined in the build.xml ant build file. </p>\r
128 \r
129 <h4><a name="logfiles" id="logfiles"></a>JABAWS Log Files  </h4>\r
130 <p>JABAWS can be configured to log what it is doing. This comes handy if you would like to see who is using your web services or need to chase some problems. JABAWS uses <a href="http://logging.apache.org/log4j/1.2/">log4j</a> to do the logging, the example of log4j configuration is bundled with JABAWS war file. You will find it in the <span class="hightlight">/WEB-INF/classes/log4j.properties</span> file. All the lines in this file are commented out. The reason why the logging is disabled by default it simple, log4j have to know the exact location where the log files should be stored. This is not known up until the deployment time. To enable the logging you need to define <span class="hightlight">logDir </span>property in the <span class="hightlight">log4j.properties</span> and uncomment section of the file which corresponds to your need. More information is given in the <span class="hightlight">log4j.properties</span> file itself. Restart the tomcat or the JABAWS web application to apply the settings. </p>\r
131 <p>After you have done this, assuming that you did not change the log4j.properties file yourself, you should see the application log file called <span class="hightlight">activity.log</span>.  The amount of information logged can be adjusted using different logging levels, it is  reduced in the following order of log levels TRACE, DEBUG, INFO, WARN, ERROR, FATAL. </p>\r
132 <p>If you would like to know who is using your services, you might want to <a href="howto.html#logs">enable tomcat access logging</a>. </p>\r
133 <h4><a name="warfile" id="warfile"></a>JABAWS War File Content </h4>\r
134 <table width="100%" >\r
135   <tr>\r
136     <th width="19%">Directory</th>\r
137     <th width="81%">Content description </th>\r
138   </tr>\r
139   <tr>\r
140     <td>conf/</td>\r
141     <td> contains configuration files such as Executable.properties, Engine.local.properties, Engine.cluster.properties</td>\r
142   </tr>\r
143   <tr>\r
144     <td>conf/settings</td>\r
145     <td>Contains individual executable description files. In particular XXXParameters.xml, XXXPresets.xml, XXXLimits.xml where XXX is the name of the executable </td>\r
146   </tr>\r
147   <tr>\r
148     <td>jobsout/</td>\r
149     <td>Individual executables input, output and some other task related files are stored. (optional)  </td>\r
150   </tr>\r
151   <tr>\r
152     <td>binaries/</td>\r
153     <td>Directory contains native executables - alignment programs, windows binaries (optional) </td>\r
154   </tr>\r
155   <tr>\r
156     <td>binaries/src</td>\r
157     <td>Contains source of native executables and Linux i386 binaries. </td>\r
158   </tr>\r
159   <tr>\r
160     <td>binaries/matrices</td>\r
161     <td>Substitution matrices</td>\r
162   </tr>\r
163   <tr>\r
164     <td>WEB-INF</td>\r
165     <td>Web application descriptor </td>\r
166   </tr>\r
167   <tr>\r
168     <td>WEB-INF/lib</td>\r
169     <td>Web application libraries </td>\r
170   </tr>\r
171   <tr>\r
172     <td>WEB-INF/classes</td>\r
173     <td>log4j.properties - log configuration file (optional) </td>\r
174   </tr>\r
175   <tr>\r
176     <td colspan="2"><strong>Help Pages </strong></td>\r
177     </tr>\r
178   <tr>\r
179     <td>/</td>\r
180     <td> help pages, index.html is the starting page</td>\r
181   </tr>\r
182   <tr>\r
183     <td>dm_javadoc</td>\r
184     <td>javadoc for JABAWS client (the link is available from How To pages) </td>\r
185   </tr>\r
186   <tr>\r
187     <td>prog_docs</td>\r
188     <td>documentation for programmes that JABAWS uses </td>\r
189   </tr>\r
190   <tr>\r
191     <td>images</td>\r
192     <td>images referenced by html pages</td>\r
193   </tr>\r
194 </table>\r
195 <p>&nbsp;</p>\r
196 </div>\r
197 <!-- content end--> \r
198 <div id="copyright">Last update: 7 July 2010<br/>\r
199 Peter Troshin and Geoff Barton, The Barton Group, University of Dundee, UK</div>\r
200 </div><!-- wrapper end-->\r
201 </div> <!-- page end-->\r
202 \r
203 </body>\r
204 </html>\r
205 \r