1 /* Copyright (c) 2011 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
19 package compbio.ws.client;
\r
21 import java.net.URL;
\r
22 import java.util.Set;
\r
24 import javax.xml.bind.annotation.XmlAccessType;
\r
25 import javax.xml.bind.annotation.XmlAccessorType;
\r
26 import javax.xml.namespace.QName;
\r
27 import javax.xml.ws.Service;
\r
29 import compbio.data.msa.JABAService;
\r
30 import compbio.data.msa.MsaWS;
\r
31 import compbio.data.msa.SequenceAnnotation;
\r
34 * List of web services currently supported by JABAWS version 2.1
\r
37 public enum Services {
\r
39 * Make sure this class has NO references to runners or engines as it is a
\r
40 * part of minimal client package. Such things should go into ServicesUtil
\r
42 MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, MSAprobsWS, GLprobsWS,
\r
44 JronnWS, DisemblWS, GlobPlotWS, IUPredWS,
\r
48 public static Services getService(String servName) {
\r
49 servName = servName.trim().toLowerCase();
\r
50 for (Services service : Services.values()) {
\r
51 if (service.toString().equalsIgnoreCase(servName)) {
\r
58 Service getService(URL url, String sqname) {
\r
59 QName qname = new QName(sqname, this.toString());
\r
60 return Service.create(url, qname);
\r
63 public static String toString(Set<Services> services) {
\r
64 if (services == null || services.isEmpty()) {
\r
65 return "No known services...\n";
\r
68 for (Services serv : services) {
\r
70 value += serv + "\n";
\r
72 value += "Unknown Service\n";
\r
78 Class<? extends JABAService> getServiceType() {
\r
86 return SequenceAnnotation.class;
\r
98 throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!");
\r
103 String getServiceNamespace() {
\r
105 case RNAalifoldWS :
\r
111 return JABAService.V2_SERVICE_NAMESPACE;
\r
121 return JABAService.SERVICE_NAMESPACE;
\r
123 throw new RuntimeException("Unrecognised JABAWS Namespace for service " + this +"!");
\r
127 JABAService getInterface(Service service) {
\r
128 assert service != null;
\r
130 QName portName = new QName(service.getServiceName().getNamespaceURI(), this.toString() + "Port");
\r
131 return service.getPort(portName, this.getServiceType());
\r
134 public String getServiceInfo() {
\r
137 return AACON_INFO.toString();
\r
139 return JPRED_INFO.toString();
\r
141 return CLUSTAL_OMEGA_INFO.toString();
\r
143 return CLUSTAL_INFO.toString();
\r
145 return DISEMBL_INFO.toString();
\r
147 return GLOBPLOT_INFO.toString();
\r
149 return IUPRED_INFO.toString();
\r
151 return JRONN_INFO.toString();
\r
153 return MAFFT_INFO.toString();
\r
155 return MUSCLE_INFO.toString();
\r
157 return PROBCONS_INFO.toString();
\r
159 return MSAPROBS_INFO.toString();
\r
161 return GLPROBS_INFO.toString();
\r
163 return TCOFFEE_INFO.toString();
\r
164 case RNAalifoldWS :
\r
165 return RNAALIFOLD_INFO.toString();
\r
167 throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!");
\r
171 public String getServiceReference() {
\r
174 return AACON_INFO.getReference();
\r
176 return JPRED_INFO.getReference();
\r
178 return CLUSTAL_OMEGA_INFO.getReference();
\r
180 return CLUSTAL_INFO.getReference();
\r
182 return DISEMBL_INFO.getReference();
\r
184 return GLOBPLOT_INFO.getReference();
\r
186 return IUPRED_INFO.getReference();
\r
188 return JRONN_INFO.getReference();
\r
190 return MAFFT_INFO.getReference();
\r
192 return MUSCLE_INFO.getReference();
\r
194 return PROBCONS_INFO.getReference();
\r
196 return MSAPROBS_INFO.getReference();
\r
198 return GLPROBS_INFO.getReference();
\r
200 return TCOFFEE_INFO.getReference();
\r
201 case RNAalifoldWS :
\r
202 return RNAALIFOLD_INFO.getReference();
\r
204 throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!");
\r
208 public String getServiceVersion() {
\r
211 return AACON_INFO.getVersion();
\r
213 return JPRED_INFO.getVersion();
\r
215 return CLUSTAL_OMEGA_INFO.getVersion();
\r
217 return CLUSTAL_INFO.getVersion();
\r
219 return DISEMBL_INFO.getVersion();
\r
221 return GLOBPLOT_INFO.getVersion();
\r
223 return IUPRED_INFO.getVersion();
\r
225 return JRONN_INFO.getVersion();
\r
227 return MAFFT_INFO.getVersion();
\r
229 return MUSCLE_INFO.getVersion();
\r
231 return PROBCONS_INFO.getVersion();
\r
233 return MSAPROBS_INFO.getVersion();
\r
235 return GLPROBS_INFO.getVersion();
\r
237 return TCOFFEE_INFO.getVersion();
\r
238 case RNAalifoldWS :
\r
239 return RNAALIFOLD_INFO.getVersion();
\r
241 throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!");
\r
245 public String getServiceGroup() {
\r
248 return "annotation";
\r
250 return "annotation";
\r
252 return "alignment";
\r
254 return "alignment";
\r
264 return "alignment";
\r
266 return "alignment";
\r
268 return "alignment";
\r
270 return "alignment";
\r
272 return "alignment";
\r
274 return "alignment";
\r
275 case RNAalifoldWS :
\r
276 return "annotation";
\r
278 throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!");
\r
282 static ServiceInfo AACON_INFO = new ServiceInfo(AAConWS,
\r
283 "in preparation", "1.0", "http://www.compbio.dundee.ac.uk/aacon");
\r
285 static ServiceInfo JPRED_INFO = new ServiceInfo(JpredWS,
\r
286 "Cole C, Barber JD, Barton GJ,\r\n" +
\r
287 "\"The Jpred 3 secondary structure prediction server\"\r\n" +
\r
288 "Nucl. Acids Res. 36 (suppl 2):W197 (2008)",
\r
289 "3.0.3", "http://www.compbio.dundee.ac.uk/www-jpred");
\r
291 static ServiceInfo CLUSTAL_INFO = new ServiceInfo(ClustalWS,
\r
292 "Larkin MA, Blackshields G, Brown NP, Chenna R, McGettigan PA, McWilliam H, Valentin F, Wallace IM, Wilm A, Lopez R, Thompson JD, Gibson TJ, Higgins DG,\r\n" +
\r
293 "\"Clustal W and Clustal X version 2.0\"\r\n" +
\r
294 "Bioinformatics, 23: 2947 (2007)",
\r
295 "2.0.12", "http://www.clustal.org/clustal2/");
\r
297 static ServiceInfo CLUSTAL_OMEGA_INFO = new ServiceInfo(ClustalOWS,
\r
298 "Sievers F, Wilm A, Dineen D, Gibson TJ, Karplus K, Li W, Lopez R, McWilliam H, Remmert M, Söding J, Thompson JD, Higgins DG,\r\n" +
\r
299 "\"Fast, scalable generation of high quality protein multiple sequence alignments using Clustal Omega\"\r\n" +
\r
300 "Mol Syst Biol. 7:539 (2011)",
\r
301 "1.0.2", "http://www.clustal.org/omega/");
\r
303 static ServiceInfo DISEMBL_INFO = new ServiceInfo(DisemblWS,
\r
304 "Linding R, Jensen LJ, Diella F, Bork P, Gibson TJ, and Russell RB,\r\n" +
\r
305 "\"Protein disorder prediction: implications for structural proteomics\"\r\n" +
\r
306 "Structure 11(11):1453 (2003)",
\r
307 "1.5", "http://dis.embl.de/");
\r
309 static ServiceInfo GLOBPLOT_INFO = new ServiceInfo(GlobPlotWS,
\r
310 "Linding R, Russell RB, Neduva V and Gibson TJ,\r\n" +
\r
311 "GlobPlot: exploring protein sequences for globularity and disorder\r\n" +
\r
312 "Nucl. Acids Res. 31 (13):3701 (2003)",
\r
313 "2.3", "http://globplot.embl.de/");
\r
315 static ServiceInfo IUPRED_INFO = new ServiceInfo(IUPredWS,
\r
316 "Dosztányi Z, Csizmók V, Tompa P, and Simon I,\r\n" +
\r
317 "\"The Pairwise Energy Content Estimated from Amino Acid Composition Discriminates between Folded and Intrinsically Unstructured Proteins\"\r\n" +
\r
318 "J. Mol. Biol. 347:827 (2005)",
\r
319 "1.0", "http://iupred.enzim.hu/");
\r
321 static ServiceInfo TCOFFEE_INFO = new ServiceInfo(TcoffeeWS,
\r
322 "Notredame C, Higgins DG, Heringa L,\r\n" +
\r
323 "\"T-Coffee: A novel method for multiple sequence alignments\"\r\n" +
\r
324 "JMB, 302(1):205 (2000)",
\r
325 "8.99", "http://tcoffee.crg.cat/apps/tcoffee/index.html");
\r
327 static ServiceInfo MUSCLE_INFO = new ServiceInfo(MuscleWS,
\r
329 "\"MUSCLE: multiple sequence alignment with high accuracy and high throughput\"\r\n" +
\r
330 "Nucleic Acids Res. 32(5):1792 (2004)",
\r
331 "3.8.31", "http://www.drive5.com/muscle/");
\r
333 static ServiceInfo PROBCONS_INFO = new ServiceInfo(ProbconsWS,
\r
334 "Do CB, Mahabhashyam MSP, Brudno M, and Batzoglou S,\r\n" +
\r
335 "\"PROBCONS: Probabilistic Consistency-based Multiple Sequence Alignment\"\r\n" +
\r
336 "Genome Research 15:330 (2005)",
\r
337 "1.12", "http://probcons.stanford.edu/");
\r
339 static ServiceInfo MSAPROBS_INFO = new ServiceInfo(MSAprobsWS,
\r
340 "Liu Y, Schmidt B, and Maskell DL,\r\n" +
\r
341 "\"MSAProbs: multiple sequence alignment based on pair hidden Markov models and partition function posterior probabilities\"\r\n" +
\r
342 "Bioinformatics, 26 (16):1958 (2010)",
\r
343 "0.9.7", "http://msaprobs.sourceforge.net/");
\r
345 static ServiceInfo GLPROBS_INFO = new ServiceInfo(GLprobsWS,
\r
346 "Yongtao Ye, Siu-Ming Yiu, David W. Cheung, Qing Zhan, Hing-Fung Ting, Yadong Wang, Tak-Wah Lam,\r\n" +
\r
347 "\"GLProbs: Aligning multiple sequences adaptively\"\r\n" +
\r
348 "in progress (2013)",
\r
349 "1.0", "http://sourceforge.net/projects/glprobs/");
\r
351 static ServiceInfo JRONN_INFO = new ServiceInfo(JronnWS,
\r
352 "unpublished, original algorithm Yang ZR, Thomson R, McMeil P, and Esnouf RM,\r\n" +
\r
353 "\"RONN: the bio-basis function neural network technique applied to the dectection of natively disordered regions in proteins\"\r\n" +
\r
354 "Bioinformatics 21:3369 (2005)\r\n",
\r
355 "1.0", "http://www.compbio.dundee.ac.uk/jabaws/");
\r
357 static ServiceInfo MAFFT_INFO = new ServiceInfo(MafftWS,
\r
358 "Katoh K, Toh H,\r\n" +
\r
359 "\"Parallelization of the MAFFT multiple sequence alignment program\"\r\n" +
\r
360 "Bioinformatics 26:1899 (2010)",
\r
361 "6.8.57", "http://mafft.cbrc.jp/alignment/software/");
\r
363 static ServiceInfo RNAALIFOLD_INFO = new ServiceInfo(RNAalifoldWS,
\r
364 "Hofacker IL, Fekete M, and Stadler PV,\r\n"+
\r
365 "\"Secondary Structure Prediction for Aligned RNA Sequences\"\r\n" +
\r
366 "J.Mol.Biol. 319:1059 (2002) and\r\n " +
\r
367 "Bernhart SH, Hofacker IL Will S, Gruber AR, and Stadler PF,\r\n" +
\r
368 "\"RNAalifold: Improved consensus structure prediction for RNA alignments\"\r\n" +
\r
369 "BMC Bioinformatics, 9:474 (2008)\r\n",
\r
370 "2.1.2", "http://www.tbi.univie.ac.at/RNA/");
\r
372 @XmlAccessorType(XmlAccessType.FIELD)
\r
373 static class ServiceInfo {
\r
378 final static String jabaws_version = "2.1";
\r
379 final static String line_delimiter = "\n";
\r
381 private ServiceInfo() {
\r
382 // Default constructor for JAXB
\r
384 private ServiceInfo(Services service, String reference, String version,
\r
386 this.service = service;
\r
387 this.reference = reference;
\r
388 this.version = version;
\r
389 this.moreinfo = moreinfo;
\r
393 public String toString() {
\r
394 String value = "SERVICE: " + service + " version " + version + line_delimiter + "\n";
\r
395 value += "JABAWS v. " + jabaws_version + line_delimiter;
\r
396 value += "REFERENCE: " + reference + line_delimiter + "\n";
\r
397 value += "MORE INFORMATION: " + moreinfo + line_delimiter;
\r
401 public String getReference() {
\r
402 return "REFERENCE: " + reference + line_delimiter + "<br>MORE INFORMATION: " + moreinfo + line_delimiter;
\r
405 public String getVersion() {
\r
410 public static void main(String[] args) {
\r
411 System.out.println(MUSCLE_INFO);
\r