-/* Copyright (c) 2009 Peter Troshin\r
+/* Copyright (c) 2011 Peter Troshin\r
* \r
- * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 \r
+ * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 \r
* \r
* This library is free software; you can redistribute it and/or modify it under the terms of the\r
* Apache License version 2 as published by the Apache Software Foundation\r
\r
package compbio.ws.client;\r
\r
-import java.io.File;\r
import java.net.URL;\r
import java.util.Set;\r
\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
import javax.xml.namespace.QName;\r
import javax.xml.ws.Service;\r
\r
import compbio.data.msa.JABAService;\r
import compbio.data.msa.MsaWS;\r
import compbio.data.msa.SequenceAnnotation;\r
-import compbio.engine.client.ConfExecutable;\r
-import compbio.engine.client.Executable;\r
-import compbio.runner.conservation.AACon;\r
-import compbio.runner.disorder.Disembl;\r
-import compbio.runner.disorder.GlobPlot;\r
-import compbio.runner.disorder.Jronn;\r
-import compbio.runner.msa.ClustalW;\r
-import compbio.runner.msa.Mafft;\r
-import compbio.runner.msa.Muscle;\r
-import compbio.runner.msa.Probcons;\r
-import compbio.runner.msa.Tcoffee;\r
\r
/**\r
* List of web services currently supported by JABAWS version 2\r
* \r
*/\r
public enum Services {\r
- MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPred;\r
+ /*\r
+ * Make sure this class has NO references to runners or engines as it is a\r
+ * part of minimal client package. Such things should go into ServicesUtil\r
+ */\r
+ MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS;\r
\r
public static Services getService(String servName) {\r
servName = servName.trim().toLowerCase();\r
return null;\r
}\r
\r
- public static Services getServiceByRunner(\r
- Class<Executable<?>> runnerClassName) {\r
- assert runnerClassName != null;\r
- String sname = runnerClassName.getSimpleName().toLowerCase();\r
- for (Services service : Services.values()) {\r
- if (service.toString().toLowerCase().contains(sname)) {\r
- return service;\r
- }\r
- }\r
- return null;\r
- }\r
-\r
- public Class<? extends Executable<?>> getServiceImpl() {\r
- switch (this) {\r
- case AAConWS :\r
- return AACon.class;\r
- case ClustalWS :\r
- return ClustalW.class;\r
- case MafftWS :\r
- return Mafft.class;\r
- case MuscleWS :\r
- return Muscle.class;\r
- case TcoffeeWS :\r
- return Tcoffee.class;\r
- case ProbconsWS :\r
- return Probcons.class;\r
- case DisemblWS :\r
- return Disembl.class;\r
- case GlobPlotWS :\r
- return GlobPlot.class;\r
- case JronnWS :\r
- return Jronn.class;\r
- default :\r
- throw new RuntimeException(\r
- "Unknown web service implementation class for service: "\r
- + this);\r
- }\r
- }\r
-\r
- public static Class<? extends Executable<?>> getRunnerByJobDirectory(\r
- File jobdir) {\r
- Services service = getServiceByRunnerName(getRunnerNameByJobDirectory(jobdir));\r
- return service.getServiceImpl();\r
- }\r
-\r
- private static String getRunnerNameByJobDirectory(File jobdir) {\r
- String name = jobdir.getName().split("#")[0];\r
-\r
- if (name.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX)) {\r
- assert ConfExecutable.CLUSTER_TASK_ID_PREFIX.length() == 1;\r
- name = name.substring(1);\r
- }\r
- return name;\r
- }\r
-\r
- public static Services getServiceByJobDirectory(File jobdir) {\r
- return getServiceByRunnerName(getRunnerNameByJobDirectory(jobdir));\r
- }\r
-\r
- private static Services getServiceByRunnerName(String name) {\r
- for (Services service : Services.values()) {\r
- String runnerName = service.getServiceImpl().getSimpleName()\r
- .toLowerCase();\r
- name = name.trim().toLowerCase();\r
- if (name.startsWith(runnerName)) {\r
- return service;\r
- }\r
- }\r
- return null;\r
- }\r
-\r
Service getService(URL url, String sqname) {\r
QName qname = new QName(sqname, this.toString());\r
return Service.create(url, qname);\r
case JronnWS :\r
case DisemblWS :\r
case GlobPlotWS :\r
-\r
+ case IUPredWS :\r
return SequenceAnnotation.class;\r
\r
// deliberate leaking\r
case ClustalWS :\r
+ case ClustalOWS :\r
case MafftWS :\r
case MuscleWS :\r
case ProbconsWS :\r
this.toString() + "Port");\r
return service.getPort(portName, this.getServiceType());\r
}\r
+\r
+ public String getServiceInfo() {\r
+ switch (this) {\r
+ case AAConWS :\r
+ return AACON_INFO;\r
+ case ClustalOWS :\r
+ return CLUSTAL_OMEGA_INFO;\r
+ case ClustalWS :\r
+ return CLUSTAL_INFO;\r
+ case DisemblWS :\r
+ return DISEMBL_INFO;\r
+ case GlobPlotWS :\r
+ return GLOBPLOT_INFO;\r
+ case IUPredWS :\r
+ return IUPRED_INFO;\r
+ case JronnWS :\r
+ return JRONN_INFO;\r
+ case MafftWS :\r
+ return MAFFT_INFO;\r
+ case MuscleWS :\r
+ return MUSCLE_INFO;\r
+ case ProbconsWS :\r
+ return PROBCONS_INFO;\r
+ case TcoffeeWS :\r
+ return TCOFFEE_INFO;\r
+ default :\r
+ throw new RuntimeException("Unrecognised Web Service Type "\r
+ + this + " - Should never happened!");\r
+ }\r
+ }\r
+\r
+ public static final String AACON_INFO = new ServiceInfo(AAConWS,\r
+ "in preparation", "1.0", "http://www.compbio.dundee.ac.uk/aacon")\r
+ .toString();\r
+ public static final String CLUSTAL_INFO = new ServiceInfo(\r
+ ClustalWS,\r
+ "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
+ + "(2007). Clustal W and Clustal X version 2.0. Bioinformatics, 23, 2947-2948. ",\r
+ "2.0.12", "http://www.clustal.org/clustal2/").toString();\r
+ public static final String CLUSTAL_OMEGA_INFO = new ServiceInfo(\r
+ ClustalOWS,\r
+ "Fast, scalable generation of high quality protein multiple sequence alignments using Clustal Omega\r\n"\r
+ + "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
+ "1.0.2", "http://www.clustal.org/omega").toString();\r
+ public static final String DISEMBL_INFO = new ServiceInfo(\r
+ DisemblWS,\r
+ "R. Linding, L.J. Jensen, F. Diella, P. Bork, T.J. Gibson and R.B. Russell\r\n"\r
+ + "Protein disorder prediction: implications for structural proteomics\r\n"\r
+ + "Structure Vol 11, Issue 11, 4 November 2003", "1.5",\r
+ "http://dis.embl.de/").toString();\r
+ public static final String GLOBPLOT_INFO = new ServiceInfo(\r
+ GlobPlotWS,\r
+ "Rune Linding, Robert B. Russell, Victor Neduva and Toby J. Gibson "\r
+ + "'GlobPlot: exploring protein sequences for globularity and disorder.' Nucl. Acids Res. (2003) 31 (13): 3701-3708. doi: 10.1093/nar/gkg519\r\n",\r
+ "2.3", "http://globplot.embl.de/").toString();\r
+ public static final String IUPRED_INFO = new ServiceInfo(\r
+ IUPredWS,\r
+ "The Pairwise Energy Content Estimated from Amino Acid Composition Discriminates between Folded and Intrinsically Unstructured Proteins\r\n"\r
+ + "Zsuzsanna Dosztányi, Veronika Csizmók, Péter Tompa and István Simon\r\n"\r
+ + "J. Mol. Biol. (2005) 347, 827-839.", "1.0",\r
+ "http://iupred.enzim.hu/").toString();\r
+ public static final String TCOFFEE_INFO = new ServiceInfo(TcoffeeWS,\r
+ "T-Coffee: A novel method for multiple sequence alignments "\r
+ + "Notredame, Higgins, Heringa, JMB, 302 (205-217) 2000",\r
+ "8.99", "http://tcoffee.crg.cat/apps/tcoffee/index.html")\r
+ .toString();\r
+ public static final String MUSCLE_INFO = new ServiceInfo(\r
+ MuscleWS,\r
+ "Edgar, R.C. (2004) MUSCLE: multiple sequence alignment with high accuracy and high throughput.Nucleic Acids Res. 32(5):1792-1797.\r\n"\r
+ + "doi:10.1093/nar/gkh340", "3.8.31",\r
+ "http://www.drive5.com/muscle/").toString();\r
+ public static final String PROBCONS_INFO = new ServiceInfo(\r
+ ProbconsWS,\r
+ "Do, C.B., Mahabhashyam, M.S.P., Brudno, M., and Batzoglou, S. 2005. PROBCONS: "\r
+ + "Probabilistic Consistency-based Multiple Sequence Alignment. Genome Research 15: 330-340. ",\r
+ "1.12", "http://probcons.stanford.edu/").toString();;\r
+ public static final String JRONN_INFO = new ServiceInfo(\r
+ JronnWS,\r
+ "unpublished, original algorithm Yang,Z.R., Thomson,R., McMeil,P. and Esnouf,R.M. (2005) "\r
+ + "RONN: the bio-basis function neural network technique applied to the "\r
+ + "dectection of natively disordered regions in proteins Bioinformatics 21: 3369-3376\r\n",\r
+ "1.0", "http://www.compbio.dundee.ac.uk/jabaws/").toString();;\r
+ public static final String MAFFT_INFO = new ServiceInfo(\r
+ MafftWS,\r
+ "Katoh, Toh 2010 (Bioinformatics 26:1899-1900)\r\n"\r
+ + "Parallelization of the MAFFT multiple sequence alignment program. ",\r
+ "6.8.57", "http://mafft.cbrc.jp/alignment/software/").toString();;\r
+\r
+ @XmlAccessorType(XmlAccessType.FIELD)\r
+ static class ServiceInfo {\r
+ Services service;\r
+ String reference;\r
+ String version;\r
+ String moreinfo;\r
+ final static String jabaws_version = "2.0";\r
+ final static String line_delimiter = "\n";\r
+\r
+ private ServiceInfo() {\r
+ // Default constructor for JAXB\r
+ }\r
+ private ServiceInfo(Services service, String reference, String version,\r
+ String moreinfo) {\r
+ this.service = service;\r
+ this.reference = reference;\r
+ this.version = version;\r
+ this.moreinfo = moreinfo;\r
+ }\r
+\r
+ @Override\r
+ public String toString() {\r
+ String value = "SERVICE: " + service + " version " + version\r
+ + line_delimiter;\r
+ value += "JABAWS v. " + jabaws_version + line_delimiter;\r
+ value += "REFERENCES: " + reference + line_delimiter;\r
+ value += "MORE INFORMATION: " + moreinfo + line_delimiter;\r
+ return value;\r
+ }\r
+ }\r
+\r
+ public static void main(String[] args) {\r
+ System.out.println(MUSCLE_INFO);\r
+ }\r
}
\ No newline at end of file