import javax.xml.namespace.QName;\r
import jalview.analysis.AlignSeq;\r
\r
+import uk.ac.ebi.www.*;\r
\r
/**\r
* DOCUMENT ME!\r
this.ap = ap;\r
this.al = al;\r
output.setText(\r
- "To display sequence features an exact Uniprot id with 100% sequence identity match must be entered." +\r
- "\nIn order to display these features, try changing the names of your sequences to the ids suggested below.");\r
+ "To display sequence features an exact Uniprot id with 100% sequence identity match must be entered."\r
+ +"\nIn order to display these features, try changing the names of your sequences to the ids suggested below."\r
+ +"\n\nRunning WSWUBlast at EBI."\r
+ +"\nPlease quote Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R."\r
+ +"\nSOAP-based services provided by the European Bioinformatics Institute."\r
+ +"\nNucleic Acids Res. 33(1):W25-W28 (2005));");\r
+\r
Desktop.addInternalFrame(output,\r
"BLASTing for unidentified sequences ", 800, 300);\r
\r
String data;\r
String id2;\r
int maxFound = 90;\r
- StringBuffer buffer = new StringBuffer("\n\n" + seq.getShortName() + " :");\r
+ StringBuffer buffer = new StringBuffer("\n\n" + seq.getName() + " :");\r
\r
while (st.hasMoreTokens())\r
{\r
{\r
try\r
{\r
- Call call = (Call) new Service().createCall();\r
- call.setTargetEndpointAddress(new java.net.URL(\r
- "http://www.ebi.ac.uk/cgi-bin/webservices/WSWUBlast"));\r
- call.setOperationName(new QName("WSWUBlast", "polljob"));\r
-\r
- Object object = (String) call.invoke(new Object[]\r
- {\r
- jobid, "xml"\r
- });\r
-\r
- if(object instanceof String)\r
- {\r
- parseResult(sequence, (String)object);\r
+ WSWUBlastService service = new WSWUBlastServiceLocator();\r
+ WSWUBlast wublast = service.getWSWUBlast();\r
+ WSFile[] results = wublast.getResults(jobid);\r
+\r
+ if(results!=null)\r
+ {\r
+ String result = new String(wublast.poll(jobid, "tooloutput"));\r
+ parseResult(sequence, result);\r
jobComplete = true;\r
jobsRunning--;\r
- }\r
-\r
- Thread.sleep(5000);\r
-\r
- System.out.println("WSWuBlastClient: I'm alive "+sequence.getShortName()+" "+jobid); // log.debug\r
+ }\r
+ else\r
+ {\r
+ Thread.sleep(10000);\r
+ System.out.println("WSWuBlastClient: I'm alive " +\r
+ sequence.getName() + " " + jobid); // log.debug\r
+ }\r
}\r
catch (Exception ex)\r
{\r
\r
void StartJob()\r
{\r
- HashMap params = new HashMap();\r
- params.put("database", "uniprot");\r
- params.put("sensitivity", "low");\r
- params.put("sort", "totalscore");\r
- params.put("matrix", "pam10");\r
- params.put("program", "blastp");\r
- params.put("alignments", "5");\r
- params.put("type", "xml");\r
- params.put("async", "true");\r
-\r
- byte[] seqbytes = AlignSeq.extractGaps("-. ",\r
- sequence.getSequence()).getBytes();\r
-\r
- try\r
- {\r
- Call call = (Call) new Service().createCall();\r
- call.setTargetEndpointAddress(new java.net.URL(\r
- "http://www.ebi.ac.uk/cgi-bin/webservices/WSWUBlast"));\r
- call.setOperationName(new QName("WSWUBlast", "doWUBlast"));\r
-\r
- Object object = call.invoke(new Object[]\r
- {\r
- params, seqbytes\r
- });\r
+ InputParams params = new InputParams();\r
\r
- if(object instanceof byte[])\r
- jobid = new String( (byte[])object);\r
+ params.setProgram("blastp");\r
+ params.setDatabase("uniprot");\r
+ params.setMatrix("pam10");\r
\r
- else\r
- {\r
- jobComplete = true;\r
- jobsRunning--;\r
- parseResult(sequence, (String)object);\r
- }\r
+ params.setNumal(5);\r
+ params.setSensitivity("low");\r
+ params.setSort("totalscore");\r
+ params.setOutformat("txt");\r
+ params.setAsync(true);\r
\r
+ try\r
+ {\r
+ Data inputs[] = new Data[1];\r
+ Data input= new Data();\r
+ input.setType("sequence");\r
+ input.setContent(AlignSeq.extractGaps("-. ",sequence.getSequence()));\r
+ inputs[0]=input;\r
+\r
+ WSWUBlastService service = new WSWUBlastServiceLocator();\r
+ WSWUBlast wublast = service.getWSWUBlast();\r
+ jobid = wublast.runWUBlast(params, inputs);\r
}\r
catch (Exception exp)\r
{\r
- System.err.println("WSWUBlastClient error:\n" + exp.toString());\r
- exp.printStackTrace();\r
+ jobComplete = true;\r
+ jobsRunning--;\r
+ System.err.println("WSWUBlastClient error:\n" + exp.toString());\r
+ exp.printStackTrace();\r
}\r
}\r
}\r