X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2FJPredClient.java;h=08d72719b984107b9c22ee7842cd8f912f84bfda;hb=43c02ae950e2d1a068bf2455f33c8756951b82ed;hp=f503f912dd3a5aa8479d6a399febfc60aac3702c;hpb=58e82de6951f919828899de75b908cd1114d8511;p=jalview.git diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index f503f91..08d7271 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -27,6 +27,7 @@ import jalview.analysis.*; import jalview.datamodel.*; import jalview.gui.*; import jalview.io.FormatAdapter; +import jalview.io.*; public class JPredClient extends WSClient @@ -108,7 +109,7 @@ public class JPredClient WebServiceName = "JNetWS"; WebServiceJobTitle = "JNet secondary structure prediction"; WebServiceReference = - "\"Cuff J. A and Barton G.J (1999) Application of enhanced " + + "\"Cuff J. A and Barton G.J (2000) Application of " + "multiple sequence alignment profiles to improve protein secondary structure prediction, " + "Proteins 40:502-511\"."; WsURL = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred"; @@ -127,6 +128,8 @@ public class JPredClient { this.server = loc.getjpred(new java.net.URL(WsURL)); // JBPNote will be set from properties ( (JpredSoapBindingStub)this.server).setTimeout(60000); // one minute stub + //((JpredSoapBindingStub)this.server)._setProperty(org.apache.axis.encoding.C, Boolean.TRUE); + } catch (Exception ex) { @@ -238,6 +241,7 @@ public class JPredClient catch (Exception ex) { allowedServerExceptions--; + wsInfo.appendProgressText("\nJPredWS Server exception!\n" + ex.getMessage()); @@ -399,7 +403,7 @@ public class JPredClient { jalview.bin.Cache.log.debug("Getting associated alignment."); // we ignore the returned alignment if we only predicted on a single sequence - String format = jalview.io.IdentifyFile.Identify(result.getAligfile(), + String format = new jalview.io.IdentifyFile().Identify(result.getAligfile(), "Paste"); if (jalview.io.FormatAdapter.formats.contains(format)) @@ -439,101 +443,15 @@ public class JPredClient } } + al.setDataset(null); - AlignmentAnnotation annot; - Annotation[] annotations = null; - int i = 0; - int width = preds[0].getSequence().length(); - - int[] gapmap = al.getSequenceAt(FirstSeq).gapMap(); - - if (gapmap.length != width) - { - 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")); + try { + jalview.io.JnetAnnotationMaker.add_annotation(prediction, al, FirstSeq, + noMsa); } - - // JBPNote Should also rename the query sequence sometime... - i = 0; - - while (i < preds.length) - { - String id = preds[i].getName().toUpperCase(); - - if (id.startsWith("LUPAS") || id.startsWith("JNET") || - id.startsWith("JPRED")) - { - annotations = new Annotation[al.getWidth()]; - - if (id.equals("JNETPRED") || id.equals("JNETPSSM") || - id.equals("JNETFREQ") || id.equals("JNETHMM") || - id.equals("JNETALIGN") || id.equals("JPRED")) - { - for (int j = 0; j < width; j++) - { - annotations[gapmap[j]] = new Annotation("", "", - preds[i].getCharAt(j), 0); - } - } - else if (id.equals("JNETCONF")) - { - for (int j = 0; j < width; j++) - { - float value = Float.parseFloat(preds[i].getCharAt( - j) + ""); - annotations[gapmap[j]] = new Annotation(preds[i].getCharAt( - j) + "", "", preds[i].getCharAt(j), - value); - } - } - else - { - for (int j = 0; j < width; j++) - { - annotations[gapmap[j]] = new Annotation(preds[i].getCharAt( - j) + "", "", ' ', 0); - } - } - - if (id.equals("JNETCONF")) - { - annot = new AlignmentAnnotation(preds[i].getName(), - "JNet Output", annotations, 0f, - 10f, 1); - } - else - { - annot = new AlignmentAnnotation(preds[i].getName(), - "JNet Output", annotations); - } - - al.addAnnotation(annot); - - if (noMsa) - { - al.deleteSequence(preds[i]); - } - } - - i++; + catch (Exception e) { + jalview.bin.Cache.log.error("JNet Client: JPred Annotation Parse Error", e); } - - //Hashtable scores = prediction.getScores(); - - /* addFloatAnnotations(al, gapmap, (Vector)scores.get("JNETPROPH"), - "JnetpropH", "Jnet Helix Propensity", 0f,1f,1); - - addFloatAnnotations(al, gapmap, (Vector)scores.get("JNETPROPB"), - "JnetpropB", "Jnet Beta Sheet Propensity", 0f,1f,1); - - addFloatAnnotations(al, gapmap, (Vector)scores.get("JNETPROPC"), - "JnetpropC", "Jnet Coil Propensity", 0f,1f,1); - */ - wsInfo.setProgressText(OutputHeader); jalview.bin.Cache.log.debug("Finished parsing output."); AlignFrame af = new AlignFrame(al); @@ -544,8 +462,7 @@ public class JPredClient } catch (Exception ex) { - jalview.bin.Cache.log.warn("Exception whilst parsing JNet style secondary structure prediction."); - jalview.bin.Cache.log.debug("Exception: ",ex); + jalview.bin.Cache.log.warn("Exception whilst parsing JNet style secondary structure prediction.",ex); } } }