From: jprocter Date: Mon, 23 May 2005 17:45:51 +0000 (+0000) Subject: fixed window title names for prediction on MSA or Sequence. X-Git-Tag: Release_2_0~230 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7e58cf6fb477265076ae20f33a39e5e1b60a1e0c;p=jalview.git fixed window title names for prediction on MSA or Sequence. --- diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index ba3186c..9f68dca 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -17,21 +17,25 @@ public class JPredClient int jobsRunning = 0; ext.vamsas.JpredSoapBindingStub server; WebserviceInfo wsInfo; - - public JPredClient(SequenceI[] msf) + String altitle = ""; + java.util.Hashtable SequenceInfo = null; + public JPredClient(String title, SequenceI[] msf) { - wsInfo = new WebserviceInfo("JNet secondary structure prediction job", + wsInfo = new WebserviceInfo("JNet secondary structure prediction on "+title, "\"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\"."); SequenceI seq = msf[0]; - wsInfo.setProgressText("Job details for MSA based prediction on sequence :\nName : " - + seq.getName() + "\nSequence : " + altitle = "JNet prediction on "+seq.getName()+" using "+title; + wsInfo.setProgressText("Job details for MSA based prediction ("+title+") on sequence :\n>" + + seq.getName() + "\n" + AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n"); + SequenceInfo = jalview.analysis.SeqsetUtils.SeqCharacterHash(seq); JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default + // JBPNote url will be set from properties try { - this.server = (JpredSoapBindingStub) loc.getjpred(); // JBPNote will be set from properties + this.server = (JpredSoapBindingStub) loc.getjpred(new java.net.URL("http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred")); } catch (Exception ex) { wsInfo.setProgressText("Serious! JPred Service location failed\nfor URL :" @@ -44,16 +48,18 @@ public class JPredClient public JPredClient(SequenceI seq) { - wsInfo = new WebserviceInfo("JNet secondary structure prediction job", + wsInfo = new WebserviceInfo("JNet secondary structure prediction Job", "\"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\"."); - wsInfo.setProgressText("Job details for prediction on sequence :\nName : " - + seq.getName() + "\nSequence : " + AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n"); + wsInfo.setProgressText("Job details for prediction on sequence :\n>" + + seq.getName() + "\n" + AlignSeq.extractGaps("-. ",seq.getSequence()) + "\n"); + altitle = "JNet prediction for sequence "+seq.getName(); + SequenceInfo = jalview.analysis.SeqsetUtils.SeqCharacterHash(seq); // TODO: put proper url in JPredWSServiceLocator loc = new JPredWSServiceLocator(); // Default try { - this.server = (JpredSoapBindingStub) loc.getjpred(); // JBPNote will be set from properties + this.server = (JpredSoapBindingStub) loc.getjpred(new java.net.URL("http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred")); // JBPNote will be set from properties } catch (Exception ex) { wsInfo.setProgressText("Serious! JPred Service location failed\nfor URL :" @@ -217,6 +223,9 @@ public class JPredClient FirstSeq = prediction.getQuerySeqPosition(); } + if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash(al.getSequenceAt(FirstSeq), SequenceInfo)) + throw (new Exception("Couldn't recover sequence properties for JNet Query sequence!")); + AlignmentAnnotation annot; Annotation [] annotations = null; int i = 0; @@ -224,8 +233,9 @@ public class JPredClient int[] gapmap = al.getSequenceAt(FirstSeq).gapMap(); + if (gapmap.length!=width) { - throw (new Exception("Jpred Client Error\nNumber of residues in supposed query sequence :\n" + throw (new Exception("Jnet Client Error\nNumber of residues in supposed query sequence :\n" +al.getSequenceAt(FirstSeq).getName()+"\n" +al.getSequenceAt(FirstSeq).getSequence() +"\nDiffer from number of prediction sites in \n"+result.getPredfile()+"\n")); @@ -293,7 +303,7 @@ public class JPredClient Desktop.addInternalFrame(af, - "JNet Prediction for sequence ", + altitle, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT); }catch(Exception ex){ex.printStackTrace();}