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
\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, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS;
\r
44 public static Services getService(String servName) {
\r
45 servName = servName.trim().toLowerCase();
\r
46 for (Services service : Services.values()) {
\r
47 if (service.toString().equalsIgnoreCase(servName)) {
\r
54 Service getService(URL url, String sqname) {
\r
55 QName qname = new QName(sqname, this.toString());
\r
56 return Service.create(url, qname);
\r
59 public static String toString(Set<Services> services) {
\r
60 if (services == null || services.isEmpty()) {
\r
64 String delim = ", ";
\r
65 for (Services serv : services) {
\r
66 value += serv.toString() + delim;
\r
68 value = value.substring(0, value.length() - delim.length());
\r
72 Class<? extends JABAService> getServiceType() {
\r
74 // deliberate leaking
\r
80 return SequenceAnnotation.class;
\r
82 // deliberate leaking
\r
92 throw new RuntimeException("Unrecognised Web Service Type "
\r
93 + this + " - Should never happened!");
\r
97 JABAService getInterface(Service service) {
\r
98 assert service != null;
\r
100 QName portName = new QName(service.getServiceName().getNamespaceURI(),
\r
101 this.toString() + "Port");
\r
102 return service.getPort(portName, this.getServiceType());
\r
105 public String getServiceInfo() {
\r
110 return CLUSTAL_OMEGA_INFO;
\r
112 return CLUSTAL_INFO;
\r
114 return DISEMBL_INFO;
\r
116 return GLOBPLOT_INFO;
\r
118 return IUPRED_INFO;
\r
124 return MUSCLE_INFO;
\r
126 return PROBCONS_INFO;
\r
128 return TCOFFEE_INFO;
\r
130 throw new RuntimeException("Unrecognised Web Service Type "
\r
131 + this + " - Should never happened!");
\r
135 public static final String AACON_INFO = new ServiceInfo(AAConWS,
\r
136 "in preparation", "1.0", "http://www.compbio.dundee.ac.uk/aacon")
\r
138 public static final String CLUSTAL_INFO = new ServiceInfo(
\r
140 "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
141 + "(2007). Clustal W and Clustal X version 2.0. Bioinformatics, 23, 2947-2948. ",
\r
142 "2.0.12", "http://www.clustal.org/clustal2/").toString();
\r
143 public static final String CLUSTAL_OMEGA_INFO = new ServiceInfo(
\r
145 "Fast, scalable generation of high quality protein multiple sequence alignments using Clustal Omega\r\n"
\r
146 + "Fabian Sievers, Andreas Wilm, David Dineen, Toby J. Gibson, Kevin Karplus, Weizhong Li, Rodrigo Lopez, Hamish McWilliam, Michael Remmert, Johannes Söding, Julie D. Thompson, Desmond G. Higgins",
\r
147 "1.0.2", "http://www.clustal.org/omega").toString();
\r
148 public static final String DISEMBL_INFO = new ServiceInfo(
\r
150 "R. Linding, L.J. Jensen, F. Diella, P. Bork, T.J. Gibson and R.B. Russell\r\n"
\r
151 + "Protein disorder prediction: implications for structural proteomics\r\n"
\r
152 + "Structure Vol 11, Issue 11, 4 November 2003", "1.5",
\r
153 "http://dis.embl.de/").toString();
\r
154 public static final String GLOBPLOT_INFO = new ServiceInfo(
\r
156 "Rune Linding, Robert B. Russell, Victor Neduva and Toby J. Gibson "
\r
157 + "'GlobPlot: exploring protein sequences for globularity and disorder.' Nucl. Acids Res. (2003) 31 (13): 3701-3708. doi: 10.1093/nar/gkg519\r\n",
\r
158 "2.3", "http://globplot.embl.de/").toString();
\r
159 public static final String IUPRED_INFO = new ServiceInfo(
\r
161 "The Pairwise Energy Content Estimated from Amino Acid Composition Discriminates between Folded and Intrinsically Unstructured Proteins\r\n"
\r
162 + "Zsuzsanna Dosztányi, Veronika Csizmók, Péter Tompa and István Simon\r\n"
\r
163 + "J. Mol. Biol. (2005) 347, 827-839.", "1.0",
\r
164 "http://iupred.enzim.hu/").toString();
\r
165 public static final String TCOFFEE_INFO = new ServiceInfo(TcoffeeWS,
\r
166 "T-Coffee: A novel method for multiple sequence alignments "
\r
167 + "Notredame, Higgins, Heringa, JMB, 302 (205-217) 2000",
\r
168 "8.99", "http://tcoffee.crg.cat/apps/tcoffee/index.html")
\r
170 public static final String MUSCLE_INFO = new ServiceInfo(
\r
172 "Edgar, R.C. (2004) MUSCLE: multiple sequence alignment with high accuracy and high throughput.Nucleic Acids Res. 32(5):1792-1797.\r\n"
\r
173 + "doi:10.1093/nar/gkh340", "3.8.31",
\r
174 "http://www.drive5.com/muscle/").toString();
\r
175 public static final String PROBCONS_INFO = new ServiceInfo(
\r
177 "Do, C.B., Mahabhashyam, M.S.P., Brudno, M., and Batzoglou, S. 2005. PROBCONS: "
\r
178 + "Probabilistic Consistency-based Multiple Sequence Alignment. Genome Research 15: 330-340. ",
\r
179 "1.12", "http://probcons.stanford.edu/").toString();;
\r
180 public static final String JRONN_INFO = new ServiceInfo(
\r
182 "unpublished, original algorithm Yang,Z.R., Thomson,R., McMeil,P. and Esnouf,R.M. (2005) "
\r
183 + "RONN: the bio-basis function neural network technique applied to the "
\r
184 + "dectection of natively disordered regions in proteins Bioinformatics 21: 3369-3376\r\n",
\r
185 "1.0", "http://www.compbio.dundee.ac.uk/jabaws/").toString();;
\r
186 public static final String MAFFT_INFO = new ServiceInfo(
\r
188 "Katoh, Toh 2010 (Bioinformatics 26:1899-1900)\r\n"
\r
189 + "Parallelization of the MAFFT multiple sequence alignment program. ",
\r
190 "6.8.57", "http://mafft.cbrc.jp/alignment/software/").toString();;
\r
192 @XmlAccessorType(XmlAccessType.FIELD)
\r
193 static class ServiceInfo {
\r
198 final static String jabaws_version = "2.0";
\r
199 final static String line_delimiter = "\n";
\r
201 private ServiceInfo() {
\r
202 // Default constructor for JAXB
\r
204 private ServiceInfo(Services service, String reference, String version,
\r
206 this.service = service;
\r
207 this.reference = reference;
\r
208 this.version = version;
\r
209 this.moreinfo = moreinfo;
\r
213 public String toString() {
\r
214 String value = "SERVICE: " + service + " version " + version
\r
216 value += "JABAWS v. " + jabaws_version + line_delimiter;
\r
217 value += "REFERENCES: " + reference + line_delimiter;
\r
218 value += "MORE INFORMATION: " + moreinfo + line_delimiter;
\r
223 public static void main(String[] args) {
\r
224 System.out.println(MUSCLE_INFO);
\r