import ext.vamsas.*;\r
\r
\r
-public class JPredClient\r
+public class JPredClient extends WSClient\r
{\r
- int jobsRunning = 0;\r
- ext.vamsas.JpredSoapBindingStub server;\r
- WebserviceInfo wsInfo;\r
+ ext.vamsas.JPredWS server;\r
String altitle = "";\r
java.util.Hashtable SequenceInfo = null;\r
+ private void setWebService() {\r
+ WebServiceName = "JNetWS";\r
+ WebServiceJobTitle = "JNet secondary structure prediction";\r
+ WebServiceReference="\"Cuff J. A and Barton G.J (1999) Application of enhanced "\r
+ + "multiple sequence alignment profiles to improve protein secondary structure prediction, "\r
+ + "Proteins 40:502-511\".";\r
+ WsURL="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";\r
+ }\r
public JPredClient(String title, SequenceI[] msf)\r
{\r
- wsInfo = new WebserviceInfo("JNet secondary structure prediction on "+title,\r
- "\"Cuff J. A and Barton G.J (1999) Application of enhanced multiple sequence alignment profiles to improve protein secondary structure prediction, Proteins 40:502-511\".");\r
-\r
+ wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference);\r
SequenceI seq = msf[0];\r
- altitle = "JNet prediction on "+seq.getName()+" using "+title;\r
+ altitle = "JNet prediction on "+seq.getName()+" using alignment from "+title;\r
+\r
wsInfo.setProgressText("Job details for MSA based prediction ("+title+") on sequence :\n>"\r
+ seq.getName() + "\n"\r
+ AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n");\r
JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default\r
// JBPNote url will be set from properties\r
try {\r
- this.server = (JpredSoapBindingStub) loc.getjpred(new java.net.URL("http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred"));\r
+ this.server = loc.getjpred(new java.net.URL(WsURL));\r
}\r
catch (Exception ex) {\r
- wsInfo.setProgressText("Serious! JPred Service location failed\nfor URL :"\r
- +loc.getjpredAddress()+"\n"+ex.getMessage());\r
+ JOptionPane.showMessageDialog(Desktop.desktop, "The Secondary Structure Prediction Service named "\r
+ +WebServiceName+" at "+WsURL+" couldn't be located.",\r
+ "Internal Jalview Error", JOptionPane.WARNING_MESSAGE);\r
+ wsInfo.setProgressText("Serious! "+WebServiceName+" Service location failed\nfor URL :"\r
+ +WsURL+"\n"+ex.getMessage());\r
}\r
\r
JPredThread jthread = new JPredThread(msf);\r
\r
public JPredClient(String title, SequenceI seq)\r
{\r
- wsInfo = new WebserviceInfo("JNet secondary structure prediction Job",\r
- "\"Cuff J. A and Barton G.J (1999) Application of enhanced multiple sequence alignment profiles to improve protein secondary structure prediction, Proteins 40:502-511\".");\r
-\r
-\r
+ setWebService();\r
+ wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference);\r
wsInfo.setProgressText("Job details for prediction on sequence :\n>"\r
+ seq.getName() + "\n" + AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n");\r
altitle = "JNet prediction for sequence "+seq.getName()+" from "+title;\r
SequenceInfo = jalview.analysis.SeqsetUtils.SeqCharacterHash(seq);\r
-// TODO: put proper url in\r
+\r
JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default\r
try {\r
- this.server = (JpredSoapBindingStub) loc.getjpred(new java.net.URL("http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred")); // JBPNote will be set from properties\r
+ this.server = loc.getjpred(new java.net.URL(WsURL)); // JBPNote will be set from properties\r
}\r
catch (Exception ex) {\r
- wsInfo.setProgressText("Serious! JPred Service location failed\nfor URL :"\r
- +loc.getjpredAddress()+"\n"+ex.getMessage());\r
+ JOptionPane.showMessageDialog(Desktop.desktop, "The Secondary Structure Prediction Service named "\r
+ +WebServiceName+" at "+WsURL+" couldn't be located.",\r
+ "Internal Jalview Error", JOptionPane.WARNING_MESSAGE);\r
+ wsInfo.setProgressText("Serious! "+WebServiceName+" Service location failed\nfor URL :"\r
+ +WsURL+"\n"+ex.getMessage());\r
}\r
\r
JPredThread jthread = new JPredThread(seq);\r
} else {\r
jobId = server.predict(sequence);\r
}\r
- System.out.println(jobId);\r
+ System.out.println(WsURL+" Job Id '"+jobId+"'");\r
}\r
catch (Exception e)\r
{\r
public class MsaWSClient
+ extends WSClient
{
- int jobsRunning = 0;
- ext.vamsas.MuscleWS server;
- WebserviceInfo wsInfo;
- /**
- * MsaWSClient
- *
- * @param msa SequenceI[]
- */
-
- String WebServiceName;
- String WebServiceJobTitle;
- String WebServiceReference;
- String WsURL;
+ /**
+ * server is a WSDL2Java generated stub for an archetypal MsaWSI service.
+ */
+ ext.vamsas.MuscleWS server;
+
private boolean setWebService(String MsaWSName) {
if (MsaWServices.info.containsKey(MsaWSName)) {
WebServiceName = MsaWSName;
}
}
-// public MsaWSClient(String MsaWSName, SequenceI[] msa) {
-// MsaWSClient(MsaWSName, msa, true);
-// }
public MsaWSClient(String MsaWSName, String altitle, SequenceI[] msa, boolean submitGaps, boolean preserveOrder)
{
// TODO: MuscleWS transmuted to generic MsaWS client
MuscleWSServiceLocator loc = new MuscleWSServiceLocator(); // Default
try {
- this.server = (MuscleWS) loc.getMuscleWS(// JBPNote will be set from properties
- new java.net.URL(WsURL));
+ this.server = (MuscleWS) loc.getMuscleWS(new java.net.URL(WsURL));
}
catch (Exception ex) {
wsInfo.setProgressText("Serious! "+WebServiceName+" Service location failed\nfor URL :"
{
vamsas.objects.simple.WsJobId jobsubmit = server.align(seqs);
if (jobsubmit.getStatus()==1) {
- System.out.println(jobId=jobsubmit.getJobId());
+ jobId=jobsubmit.getJobId();
+ System.out.println(WsURL+" Job Id '"+jobId+"'");
} else {
throw new Exception(jobsubmit.getJobId());
}