From 928e216d738b36ba7d2cd6b80a65814c82598a42 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 20 May 2005 16:43:39 +0000 Subject: [PATCH] Semiworking generic MSA client --- src/jalview/ws/JPredClient.java | 2 +- src/jalview/ws/Jemboss.java | 33 +-- src/jalview/ws/MsaWSClient.java | 501 +++++++++++++++++++++------------------ 3 files changed, 271 insertions(+), 265 deletions(-) diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 2eecf46..ba3186c 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -50,7 +50,7 @@ public class JPredClient wsInfo.setProgressText("Job details for prediction on sequence :\nName : " + seq.getName() + "\nSequence : " + AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n"); - +// TODO: put proper url in JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default try { this.server = (JpredSoapBindingStub) loc.getjpred(); // JBPNote will be set from properties diff --git a/src/jalview/ws/Jemboss.java b/src/jalview/ws/Jemboss.java index 3e01b77..a2e97f6 100755 --- a/src/jalview/ws/Jemboss.java +++ b/src/jalview/ws/Jemboss.java @@ -59,30 +59,6 @@ public class Jemboss props.getEmbossEnvironmentArray()); } */ - private Hashtable uniquify(SequenceI[] sequences) { - // Generate a safely named sequence set and a hash to recover the sequence names - Hashtable map = new Hashtable(); - for (int i=0; i 0)) - { - try - { - result = server.getResult(jobId); - - if( result.isRunning() ) - wsInfo.setStatus(WebserviceInfo.STATE_RUNNING); - else if( result.isQueued() ) - wsInfo.setStatus(WebserviceInfo.STATE_QUEUING); - - if (result.isFinished()) - { - parseResult(); - jobComplete = true; - jobsRunning--; - } - else - { - wsInfo.setProgressText(OutputHeader + "\n" + result.getStatus()); - if (! (result.isJobFailed() || result.isServerError())) - { - Thread.sleep(5000); - // System.out.println("I'm alive "+seqid+" "+jobid); - } - } - } - catch (Exception ex) - { - allowedServerExceptions--; - wsInfo.appendProgressText("\n"+ServiceName+" Server exception!\n" + ex.getMessage()); - ex.printStackTrace(); - } - } - - if (! (result!=null && (result.isJobFailed() || result.isServerError()))) - wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_OK); - else - wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); - } - - void StartJob() - { - try - { - vamsas.objects.simple.WsJobId jobsubmit = server.align(seqs); - if (jobsubmit.getStatus()==1) { - System.out.println(jobId=jobsubmit.getJobId()); - } else { - throw new Exception(jobsubmit.getJobId()); - } - } - catch (Exception e) - { - System.out.println(ServiceName + " Client: Failed to submit the prediction\n" + - e.toString() + "\n"); - e.printStackTrace(); - } - } - - private void addFloatAnnotations(Alignment al, int[] gapmap, Vector values, String Symname, String Visname, float min, float max, int winLength) { - - Annotation[] annotations = new Annotation[al.getWidth()]; - for (int j = 0; j < values.size(); j++) - { - float value = Float.parseFloat(values.get(j).toString()); - annotations[gapmap[j]] = new Annotation("", value+"",' ',value); - } - al.addAnnotation(new AlignmentAnnotation(Symname, Visname, annotations, min, max, winLength)); - } - private jalview.datamodel.Sequence[] getVamsasAlignment(vamsas.objects.simple.Alignment valign) { - vamsas.objects.simple.Sequence[] seqs = valign.getSeqs().getSeqs(); - jalview.datamodel.Sequence[] msa = new jalview.datamodel.Sequence[seqs.length]; - for (int i=0, j=seqs.length; i