X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FJPredClient.java;h=4cb8aeeb348f1c4e28c79b0cc62c732edcddd2f7;hb=a487459285df2b2e06047098ad8cb8e4920b41b8;hp=04a6101f3196bd7a77884f81ee625a2b3660a8ae;hpb=cbccf5d4e522cfcbe4f61609cee61f7128f183ec;p=jalview.git diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 04a6101..4cb8aee 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -26,6 +26,7 @@ import ext.vamsas.*; import jalview.analysis.*; import jalview.datamodel.*; import jalview.gui.*; +import jalview.io.FormatAdapter; public class JPredClient extends WSClient @@ -63,15 +64,17 @@ public class JPredClient title + ") on sequence :\n>" + seq.getName() + "\n" + AlignSeq.extractGaps("-. ", seq.getSequence()) + "\n"); - - SequenceInfo = jalview.analysis.SeqsetUtils.SeqCharacterHash(seq); + SequenceI aln[] = new SequenceI[msf.length]; + for (int i=0,j=msf.length; i-1) { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.setProgressText( + "Failed to submit the prediction. (Just close the window)\n" + + + "It is most likely that there is a problem with the server.\n"); + System.err.println( + "JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n" + + e.getMessage() + "\n"); + + jalview.bin.Cache.log.warn("Server Exception",e); + } else { + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); + // JBPNote - this could be a popup informing the user of the problem. + wsInfo.setProgressText("Failed to submit the prediction:\n" + +e.getMessage()+ + wsInfo.getProgressText()); + + jalview.bin.Cache.log.debug("Failed Submission",e); + + } + allowedServerExceptions = -1; + jobComplete = true; + } } - private void addFloatAnnotations(Alignment al, int[] gapmap, + /* private void addFloatAnnotations(Alignment al, int[] gapmap, Vector values, String Symname, String Visname, float min, float max, int winLength) @@ -323,7 +350,7 @@ public class JPredClient al.addAnnotation(new AlignmentAnnotation(Symname, Visname, annotations, min, max, winLength)); - } + }*/ void parseResult() { @@ -350,29 +377,42 @@ public class JPredClient OutputHeader += ("\n" + result.getAligfile()); } - wsInfo.setProgressText(OutputHeader); + wsInfo.setProgressText(OutputHeader+"Parsing..."); try { + jalview.bin.Cache.log.debug("Parsing output from JNet job."); // JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt", "File"); jalview.io.JPredFile prediction = new jalview.io.JPredFile(result. getPredfile(), "Paste"); SequenceI[] preds = prediction.getSeqsAsArray(); + jalview.bin.Cache.log.debug("Got prediction profile."); Alignment al; int FirstSeq; // the position of the query sequence in Alignment al boolean noMsa = true; // set if no MSA has been returned by JPred if ( (this.msa != null) && (result.getAligfile() != null)) { + 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(), "Paste"); if (jalview.io.FormatAdapter.formats.contains(format)) { - al = new Alignment(jalview.io.FormatAdapter.readFile( + al = new Alignment(new FormatAdapter().readFile( result.getAligfile(), "Paste", format)); + for (int i=0, j=al.getHeight(); i