1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE html PUBLIC "XHTML 1.0 Strict"
\r
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
\r
4 <html xmlns="http://www.w3.org/1999/xhtml">
\r
6 <meta name="Last-modified" content="Fri, 28 Jun 2013 12:00:00 GMT"/>
\r
7 <title>Java Bioinformatics Analyses Web Services (JABAWS) client developers manual</title>
\r
8 <link href="ws.css" rel="stylesheet" type="text/css" media="screen, projection, handheld, tv" />
\r
9 <link rel="stylesheet" type="text/css" media="print" href="print.css" />
\r
10 <script type="text/javascript" src="prototype-1.6.0.3.js"></script>
\r
18 <td style="width:158px;"><a href="http://www.dundee.ac.uk"><img src="images/uod_lt_long.gif" width="158" height="90" alt="University of Dundee" class="logo" title="University of Dundee" longdesc="http://www.dundee.ac.uk"/></a></td>
\r
19 <td class="bg"><img src="images/jabaws25.png" width="263" height="60" alt="JABAWS-2.5" title="Java Bioinformatics Analysis Web Services version 2.5"/></td>
\r
20 <td class="bg"><img src="images/banner_right.png" alt="Disorder" width="200" height="80"/></td>
\r
28 <div id="panel"><a href="index.html">Home</a>
\r
29 <a href="quick_start.html">Getting Started</a>
\r
30 <a class="selected" href="man_about.html">Manual</a>
\r
32 <a href="man_about.html">About</a>
\r
33 <a href="man_servervm.html" title="JABAWS Server as Virtual Appliance">Server VA</a>
\r
34 <a href="man_awscloud.html" title="JABAWS Server in the Amazon EC2 Cloud">Server in the Cloud</a>
\r
35 <a href="man_serverwar.html" title="JABAWS Server as Web Application aRchive">Server WAR</a>
\r
36 <a href="man_configuration.html" >Server Configuration</a>
\r
37 <a href="man_client.html" title="JABAWS Command Line Client">CMD Client</a>
\r
38 <a href="man_stats.html" title="JABAWS Usage Statistics">Usage Statistics</a>
\r
39 <a class="selected" href="man_dev.html" title="Accessing JABAWS from your program">Accessing JABAWS</a>
\r
40 <a href="man_server_dev.html" >JABAWS Development</a>
\r
42 <a href="http://www.compbio.dundee.ac.uk/download">Download</a>
\r
43 <a href="PublicAnnualStat" title="JABAWS usage statistics">Usage Statistics</a>
\r
44 <a href="ServiceStatus" title="JABAWS webservices status. Click to test all web services. Please be patient while the services are being checked">Services Status</a>
\r
45 <a href="contacts.html">Contact Us</a>
\r
46 <a href="http://www.compbio.dundee.ac.uk" title="University of Dundee, The Barton Group" >Barton Group</a>
\r
47 <a href="jabaws_funding.html">Funding</a>
\r
53 <h2 id="headtitle">JABAWS MANUAL</h2>
\r
55 <h2>Using JABAWS From Your Program </h2>
\r
57 <li><a href="#wsfunctions">Web services functions overview </a></li>
\r
58 <li><a href="#templatestr">The template client structure</a></li>
\r
59 <li><a href="#connectto">Connecting to JABAWS</a></li>
\r
60 <li><a href="#validnames">Valid JABAWS service names and WSDL files</a></li>
\r
61 <li><a href="#defalign">Aligning sequences</a></li>
\r
62 <li><a href="#checkresults">Checking the status of the calculation </a></li>
\r
63 <li><a href="#presetalign">Aligning with presets</a></li>
\r
64 <li><a href="#customalign">Aligning with custom parameters</a></li>
\r
65 <li><a href="#writingaltofile">Writing alignments to a file</a></li>
\r
66 <li><a href="#compex">A complete client example </a></li>
\r
67 <li><a href="#buildart">Building web services artifacts</a></li>
\r
69 <h3><a name="wsfunctions" id="wsfunctions"></a>Web services functions overview </h3>
\r
70 <p>All JABA multiple sequence alignment web services comply to the same interface, thus the function described below are available from all the services. </p>
\r
71 <p><strong>Functions for initiating the alignment </strong><span class="code"> String id = align(List<FastaSequence> list)<br />
\r
72 String id = customAlign(List<FastaSequence> sequenceList, List<Option> optionList)<br />
\r
73 String id = presetAlign(List<FastaSequence> sequenceList, Preset preset)</span></p>
\r
74 <p><strong>Functions pertaining to job monitoring and control</strong><br />
\r
75 <span class="code">JobStatus status = getJobStatus(String id)<br />
\r
76 Alignment al = getResult(String id)<br />
\r
77 boolean cancelled = cancelJob(String id)<br />
\r
78 ChunkHolder chunk = pullExecStatistics(String id, long marker)</span></p>
\r
79 <p><strong>Functions relating to service features discovery</strong><br />
\r
80 <span class="code">RunnerConfig rc = getRunnerOptions()<br />
\r
81 Limit limit = getLimit(String name)<br />
\r
82 LimitsManager lm = getLimits()<br />
\r
83 PresetManager pm = getPresets()</span></p>
\r
84 <p>Please refer to a <a href="dm_javadoc/compbio/data/msa/MsaWS.html">data model javadoc</a> for a detailed description of each methods. </p>
\r
85 <h3><a name="templatestr" id="templatestr"></a>Structure of the template command line client</h3>
\r
86 <table width="100%" border="1">
\r
88 <td style="width:19%"><strong>Packages</strong></td>
\r
89 <td style="width:81%"><strong>Classes and Interfaces </strong></td>
\r
92 <td>compbio.data.msa </td>
\r
93 <td>MsaWS the interface for all multiple sequence alignment web services </td>
\r
96 <td>compbio.data.sequence</td>
\r
97 <td>JABAWS data types </td>
\r
100 <td>compbio.metadata</td>
\r
101 <td>JABAWS meta data types </td>
\r
104 <td>compbio.ws.client</td>
\r
105 <td>JABAWS command line client </td>
\r
108 <p>Additional utility libraries this client depend upon is the compbio-util-1.3.jar and compbio-annotation-1.0.jar. <br />
\r
109 Please refer to a <a href="dm_javadoc/index.html">data model javadoc</a> for a detailed description of each class and its methods. </p>
\r
110 <h3><a name="connectto" id="connectto"></a>Connecting to JABAWS</h3>
\r
111 <p class="attention">For a complete working example of JABAWS command line client please see compbio.ws.client.Jws2Client class. JABAWS command line client source code is available from the <a href="http://www.compbio.dundee.ac.uk/download">download page</a>. Please note that for now all the examples are in Java other languages will follow given a sufficient demand. </p>
\r
112 <p>Download a binary JABAWS client. Add the client to the class path. The following code excerpt will connect your program to Clustal web service deployed in the University of Dundee. </p>
\r
113 <p class="code"> import java.net.URL;<br />
\r
114 import javax.xml.namespace.QName;<br />
\r
115 import javax.xml.ws.Service;<br />
\r
116 ...............<br />
\r
117 1) String qualifiedName = "http://msa.data.compbio/01/01/2010/";<br />
\r
118 2) URL url = new URL("http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl");<br />
\r
119 3) QName qname = new QName(, "ClustalWS");<br />
\r
120 4) Service serv = Service.create(url, qname);<br />
\r
121 5) MsaWS msaws = serv.getPort(new QName(qualifiedName, "ClustalWSPort"),
\r
123 <p>Line 1 makes a qualified name for JABA web services.<br />
\r
125 constructs the URL to the web services WSDL. <br />
\r
126 Line 3 makes a qualified name instance for Clustal JABA web service. <br />
\r
127 Line 4 creates a service instance.<br />
\r
128 Line 5 makes a connection to the server. </p>
\r
129 <p>A more generic connection method would look like this </p>
\r
130 <p class="code"> import java.net.URL;<br />
\r
131 import javax.xml.namespace.QName;<br />
\r
132 import javax.xml.ws.Service;<br />
\r
133 import compbio.ws.client.Services<br />
\r
134 .............. <br />
\r
135 String qualifiedServiceName = "http://msa.data.compbio/01/01/2010/";<br />
\r
136 String host = "http://www.compbio.dundee.ac.uk/jabaws";<br />
\r
137 // In real life the service name can come from args<br />
\r
138 Services clustal = Services.ClustalWS;<br />
\r
139 URL url = new URL(host + "/" + clustal.toString() + "?wsdl");<br />
\r
140 QName qname = new QName(qualifiedServiceName, clustal.toString());<br />
\r
141 Service serv = Service.create(url, qname);<br />
\r
142 MsaWS msaws = serv.getPort(new QName(qualifiedServiceName, clustal<br />
\r
143 + "Port"), MsaWS.class);</p>
\r
144 <p>Where Services is enumeration of JABAWS web services. All JABAWS multiple sequence alignment methods confirm to MsaWS specification, thus from the caller point of view all JABAWS web services can be represented by MsaWS interface. The full documentation of MsaWS functions is available from the <a href="dm_javadoc/compbio/data/msa/MsaWS.html">javadoc</a>. </p>
\r
145 <h3><a name="validnames" id="validnames"></a>Valid JABAWS service names and WSDL files </h3>
\r
146 <p>Multiple sequence alignment services </p>
\r
147 <ul><li><a href="http://www.compbio.dundee.ac.uk/jabaws/ClustalOWS?wsdl">ClustalOWS</a> (http://www.compbio.dundee.ac.uk/jabaws/ClustalOWS?wsdl) </li>
\r
148 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl">ClustalWS</a> (http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl) </li>
\r
149 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/MuscleWS?wsdl">MuscleWS</a> (http://www.compbio.dundee.ac.uk/jabaws/MuscleWS?wsdl) </li>
\r
150 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/MafftWS?wsdl">MafftWS</a> (http://www.compbio.dundee.ac.uk/jabaws/MafftWS?wsdl) </li>
\r
151 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/TcoffeeWS?wsdl">TcoffeeWS</a> (http://www.compbio.dundee.ac.uk/jabaws/TcoffeeWS?wsdl) </li>
\r
152 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/ProbconsWS?wsdl">ProbconsWS</a> (http://www.compbio.dundee.ac.uk/jabaws/ProbconsWS?wsdl) </li>
\r
154 <p>Protein disorder prediction services </p>
\r
156 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/IUPredWS?wsdl">IUPredWS</a> (http://www.compbio.dundee.ac.uk/jabaws/IUPredWS?wsdl) </li>
\r
157 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/GlobPlotWS?wsdl">GlobPlotWS</a> (http://www.compbio.dundee.ac.uk/jabaws/GlobPlotWS?wsdl) </li>
\r
158 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/DisemblWS?wsdl">DisemblWS</a> (http://www.compbio.dundee.ac.uk/jabaws/DisemblWS?wsdl) </li>
\r
159 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/JronnWS?wsdl">JronnWS</a> (http://www.compbio.dundee.ac.uk/jabaws/JronnWS?wsdl) </li>
\r
161 <p>Amino acid conservation service</p>
\r
163 <li><a href="http://www.compbio.dundee.ac.uk/jabaws/AAConWS?wsdl">AAConWS</a> (http://www.compbio.dundee.ac.uk/jabaws/AAConWS?wsdl) </li>
\r
165 <p>Please replace <span class="hightlight">http://www.compbio.dundee.ac.uk/</span> with your JABAWS instance host name, and <span class="hightlight">jabaws</span> with your JABAWS context name to access your local version of JABAWS web services. For example <span class="hightlight">http://localhost:8080/jabaws</span> would be a valid URL for the default Apache-Tomcat installation and jabaws.war file deployment. </p>
\r
166 <h3><a name="defalign" id="defalign"></a>Aligning sequences </h3>
\r
167 <p>Given that <span class="hightlight">msaws</span> is web service proxy, created as described in "Connecting to JABAWS" section, the actual alignment can be obtained as follows: </p>
\r
168 <p class="code">1) List<FastaSequence> fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />
\r
169 2) String jobId = msaws.align(fastalist); <br />
\r
170 3) Alignment alignment = msaws.getResult(jobId);</p>
\r
171 <p>Line one loads FASTA sequence from the file<br />
\r
172 Line two submits them to web service represented by msaws proxy <br />
\r
173 Line three retrieves the alignment from a web service. This line will block the execution until the result is available. Use this with caution. In general, you should make sure that the calculation has been completed before attempting retrieving results. This is to avoid keeping the connection to the server on hold for a prolonged periods of time. While this may be ok with your local server, our public server (<a href="http://www.compbio.dundee.ac.uk/jabaws">www.compbio.dundee.ac.uk/jabaws</a>) will not let you hold the connection for longer than 10 minutes. This is done to prevent excessive load on the server. The next section describes how to check the status of the calculation.<br />
\r
174 Methods and classes mentioned in the excerpt are available from the JABAWS client library. </p>
\r
175 <h3><a name="checkresults" id="checkresults"></a>Checking the status of the calculation </h3>
\r
176 <p> You may have noticed that there was no pause between submitting the job and retrieving of the results. This is because <span class="hightlight">getResult(jobId)</span> method block the processing until the calculation is completed. However, taking into account that the connection holds server resources, our public server (<a href="http://www.compbio.dundee.ac.uk/jabaws">www.compbio.dundee.ac.uk/jabaws</a>) is configured to reset the connection after 10 minutes of waiting. To work around the connection reset you are encouraged to check whether the calculation has been completed before accessing the results. You can do it like this: </p>
\r
177 <p> <span class="code">while (msaws.getJobStatus(jobId) != JobStatus.FINISHED) {<br />
\r
178 Thread.sleep(2000); // wait two seconds, then recheck the status <br />
\r
180 <h3><a name="presetalign" id="presetalign"></a>Aligning with presets</h3>
\r
181 <p class="code">1) PresetManager presetman = msaws.getPresets();<br />
\r
182 2) Preset preset = presetman.getPresetByName(presetName);<br />
\r
183 3) List<FastaSequence> fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />
\r
184 4) String jobId = msaws.presetAlign(fastalist, preset);<br />
\r
185 5) Alignment alignment = msaws.getResult(jobId);</p>
\r
186 <p>Line one obtains the lists of presets supported by a web service.<br />
\r
187 Line two return a particular Preset
\r
189 Lines three to five are doing the same job as in the first <a href="#defalign"> aligning sequences example</a>.</p>
\r
190 <h3><a name="customalign" id="customalign"></a>Aligning with custom parameters</h3>
\r
191 <p class="code"> 1) RunnerConfig options = msaws.getRunnerOptions();<br />
\r
192 2) Argument matrix = options.getArgument("MATRIX");<br />
\r
193 3) matrix.setValue("PAM300");<br />
\r
194 4) Argument gapopenpenalty = options.getArgument("GAPOPEN");<br />
\r
195 5) gapopenpenalty.setValue("20");<br />
\r
196 6) List<Argument> arguments = new ArrayList<Argument>(); <br />
\r
197 7) arguments.add(matrix);
\r
198 arguments.add(gapopenpenalty);<br />
\r
199 8) List<FastaSequence> fastalist = SequenceUtil.readFasta(new FileInputStream(file));<br />
\r
200 9) String jobId = msaws.customAlign(fastalist, arguments);<br />
\r
201 10) Alignment alignment = msaws.getResult(jobId);</p>
\r
202 <p>Line one obtains the <span class="hightlight">RunnerConfig</span> object that holds information on supported parameters and their values<br />
\r
203 Line two retrieve a particular parameter from the holder by its name<br />
\r
204 Lines three sets a value to this parameter which will be used in the calculation. <br />
\r
205 Line four and five do the same but for another parameter<br />
\r
206 Line 6 makes a List to hold the parameters <br />
\r
207 Line seven puts the parameters into that list<br />
\r
209 and ten is the same as in previous examples<br />
\r
210 Line nine submit an alignment request with the sequences and the parameters <br />
\r
211 The names of all the parameters supported by a web service e.g. "PAM300" can be obtained using <span class="hightlight">options.getArguments() </span>method. Further details on the methods available from <span class="hightlight">RunnerConfig</span> object are available from the <a href="dm_javadoc/index.html">javadoc</a>. </p>
\r
212 <h3><a name="writingaltofile" id="writingaltofile"></a>Writing alignments to a file</h3>
\r
213 <p>There is a utility method in the client library that does exactly that. </p>
\r
214 <p> <span class="code">Alignment alignment = align(...) <br />
\r
215 FileOutputStream outStream = new FileOutputStream(file);<br />
\r
216 ClustalAlignmentUtil.writeClustalAlignment(outStream, align);</span></p>
\r
217 <h3><a name="compex" id="compex"></a>A complete client example </h3>
\r
218 <p>Finally, a complete example of the program that connects to JABAWS Clustal service and aligns sequences using one of the Clustal web service preset. Three is also a <a href="Example_template.pdf">PDF version</a> of this example with syntax highlighted. The text comments are commented by block style comments e.g. /* comment */, the alternatives given in the code are line commented // comment. You may want to remove line style comments to test alternatives of the functions. All you need for this to work is a <a href="http://www.compbio.dundee.ac.uk/download/get?id=min-jaba-client-2.0.jar">JABAWS binary client</a>. Please make sure that the client is in the Java class path before running this example.</p>
\r
219 <pre class="code" style="line-height:1em;">
\r
220 import java.io.ByteArrayInputStream;
\r
221 import java.io.FileNotFoundException;
\r
222 import java.io.IOException;
\r
223 import java.net.URL;
\r
224 import java.util.List;
\r
226 import javax.xml.namespace.QName;
\r
227 import javax.xml.ws.Service;
\r
229 import compbio.data.msa.MsaWS;
\r
230 import compbio.data.sequence.Alignment;
\r
231 import compbio.data.sequence.FastaSequence;
\r
232 import compbio.data.sequence.SequenceUtil;
\r
233 import compbio.metadata.JobSubmissionException;
\r
234 import compbio.metadata.LimitExceededException;
\r
235 import compbio.metadata.Preset;
\r
236 import compbio.metadata.PresetManager;
\r
237 import compbio.metadata.ResultNotAvailableException;
\r
238 import compbio.metadata.UnsupportedRuntimeException;
\r
239 import compbio.metadata.WrongParameterException;
\r
241 public class Example {
\r
244 * Input sequences for alignment
\r
246 static final String input = ">Foo\r\n"
\r
247 + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAVARLGR"
\r
248 + "VRWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDAGQAEAAAAAYTRAHQLLPEEPYITAQ"
\r
249 + "LLNWRRRLCDWRALDVLSAQVRAAVAQGVGAVEPFAFLSEDASAAEQLACARTRAQAIAASVRPL"
\r
250 + "APTRVRSKGPLRVGFVSNGFGAHPTGLLTVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQA"
\r
251 + "STLHDVTALGHLATAKHIRHHGIDLLFDLRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMD"
\r
252 + "YVLGDAFALPPALEPFYSEHVLRLQGAFQPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLN"
\r
253 + "PQSMARMLAVLREVPDSVLWLLSGPGEADARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHAD"
\r
254 + "LFLDTHPYNAHTTASDALWTGCPVLTTPGETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALAS"
\r
255 + "DPAALTALHARVDVLRRESGVFEMDGFADDFGALLQALARRHGWLGI\r\n"
\r
257 + ">Bar\r\n"
\r
258 + "MGDTTAGEMAVQRGLALHQQRHAEAAVLLQQASDAAPEHPGIALWLHALEDAGQAEAAAAYTRAH"
\r
259 + "QLLPEEPYITAQLLNAVAQGVGAVEPFAFLSEDASAAESVRPLAPTRVRSKGPLRVGFVSNGFGA"
\r
260 + "HPTGLLTVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQASTLHDVTALGHLATAKHIRHHG"
\r
261 + "IDLLFDLRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMDYVLGDAFALPPALEPFYSEHVL"
\r
262 + "RLQGAFQPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLNPQSMARMLAVLREVPDSVLWLL"
\r
263 + "SGPGEADARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHADLFLDTHPYNAHTTASDALWTGC"
\r
264 + "PVLTTPGETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALASDPAALTALHARVDVLRRESGV"
\r
265 + "FEMDGFADDFGALLQALARRHGWLGI\r\n"
\r
267 + ">Friends\r\n"
\r
268 + "MTADGPRELLQLRAAVRHRPQDVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAVARLGRV"
\r
269 + "RWTQQRHAEAAVLLQQASDAAPEHPGIALWLGHALEDHQLLPEEPYITAQLDVLSAQVRAAVAQG"
\r
270 + "VGAVEPFAFLSEDASAAEQLACARTRAQAIAASVRPLAPTRVRSKGPLRVGFVSNGFGAHPTGLL"
\r
271 + "TVALFEALQRRQPDLQMHLFATSGDDGSTLRTRLAQASTLHDVTALGHLATAKHIRHHGIDLLFD"
\r
272 + "LRGWGGGGRPEVFALRPAPVQVNWLAYPGTSGAPWMDYVLGDAFALPPALEPFYSEHVLRLQGAF"
\r
273 + "QPSDTSRVVAEPPSRTQCGLPEQGVVLCCFNNSYKLNPQSMARMLAVLREVPDSVLWLLSGPGEA"
\r
274 + "DARLRAFAHAQGVDAQRLVFMPKLPHPQYLARYRHADLFLDTHPYNAHTTASDALWTGCPVLTTP"
\r
275 + "GETFAARVAGSLNHHLGLDEMNVADDAAFVAKAVALASDPAALTALHARVDVLRRESI";
\r
277 public static void main(String[] args) throws UnsupportedRuntimeException,
\r
278 LimitExceededException, JobSubmissionException,
\r
279 WrongParameterException, FileNotFoundException, IOException,
\r
280 ResultNotAvailableException, InterruptedException {
\r
282 String qualifiedServiceName = "http://msa.data.compbio/01/01/2010/";
\r
284 /* Make a URL pointing to web service WSDL */
\r
286 "http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl");
\r
289 * If you are making a client that connects to different web services
\r
290 * you can use something like this:
\r
292 // URL url = new URL(host + "/" + Services.ClustalWS.toString() +
\r
293 // "?wsdl");
\r
295 QName qname = new QName(qualifiedServiceName, "ClustalWS");
\r
296 Service serv = Service.create(url, qname);
\r
298 * Multiple sequence alignment interface for Clustal web service
\r
301 MsaWS msaws = serv.getPort(new QName(qualifiedServiceName, "ClustalWS"
\r
302 + "Port"), MsaWS.class);
\r
304 /* Get the list of available presets */
\r
305 PresetManager presetman = msaws.getPresets();
\r
307 /* Get the Preset object by preset name */
\r
308 Preset preset = presetman
\r
309 .getPresetByName("Disable gap weighting (Speed-oriented)");
\r
312 * Load sequences in FASTA format from the file You can use something
\r
313 * like new FileInputStream(<filename>) to load sequence from the file
\r
315 List<FastaSequence> fastalist = SequenceUtil
\r
316 .readFasta(new ByteArrayInputStream(input.getBytes()));
\r
319 * Submit loaded sequences for an alignment using preset. The job
\r
320 * identifier is returned by this method, you can retrieve the results
\r
321 * with it sometime later.
\r
323 String jobId = msaws.presetAlign(fastalist, preset);
\r
325 /* This method will block for the duration of the calculation */
\r
326 Alignment alignment = msaws.getResult(jobId);
\r
329 * This is a better way of obtaining results, it does not involve
\r
330 * holding the connection open for the duration of the calculation,
\r
331 * Besides, as the University of Dundee public server will reset the
\r
332 * connection after 10 minutes of idling, this is the only way to obtain
\r
333 * the results of long running task from our public server.
\r
335 // while (msaws.getJobStatus(jobId) != JobStatus.FINISHED) {
\r
336 // Thread.sleep(1000); // wait a second, then recheck the status
\r
339 /* Output the alignment to standard out */
\r
340 System.out.println(alignment);
\r
342 // Alternatively, you can record retrieved alignment into the file in
\r
345 // ClustalAlignmentUtil.writeClustalAlignment(new FileOutputStream(
\r
346 // "output.al"), alignment);
\r
351 For a more detailed description of all available types and their functions please refer to the <a href="dm_javadoc/index.html">data model javadoc</a>.
\r
352 <h3><a name="buildart" id="buildart"></a>Building web services artifacts</h3>
\r
353 <p>JABAWS are the standard <a href="http://jax-ws.java.net/">JAX-WS</a> SOAP web services, which are <a href="http://www.ws-i.org/">WS-I</a> basic profile compatible. This means that you could use whatever tool your language has to work with web services. Below is how you can generate portable artifacts to work with JABAWS from Java. However, if programming in Java we recommend using our client library as it provides a handful of useful methods in addition to plain data types. </p>
\r
354 <p class="code">wsimport -keep http://www.compbio.dundee.ac.uk/jabaws/ClustalWS?wsdl</p>
\r
355 </div><!-- content end-->
\r
356 <div id="copyright">Last update: 28 June 2013<br/>Sasha Sherstnev, Peter Troshin, Jim Procter and Geoff Barton, The Barton Group, University of Dundee, UK</div>
\r
357 </div><!-- wrapper end-->
\r
358 </div><!-- page end-->
\r
361 <!-- Google analitics -->
\r
362 <script type="text/javascript">
\r
363 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
\r
364 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
\r
366 <script type="text/javascript">
\r
368 var pageTracker = _gat._getTracker("UA-5356328-1");
\r
369 pageTracker._trackPageview();
\r