X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FJPredClient.java;h=6fd0a4a702b638ab129dbf6400040c77dc3b8c90;hb=01cc9bf86a687fa7c8a741128264b23eb7feba9b;hp=4302df203a6e0e231ae142db3c9a5eb28f7147cf;hpb=74e4d71835fd0031dd7c309e37ec6bf934e4de4a;p=jalview.git diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index 4302df2..6fd0a4a 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 @@ -56,6 +57,7 @@ public class JPredClient wsInfo = setWebService(); SequenceI seq = msf[0]; + altitle = "JNet prediction on " + seq.getName() + " using alignment from " + title; @@ -64,8 +66,10 @@ public class JPredClient AlignSeq.extractGaps("-. ", seq.getSequence()) + "\n"); 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; - wsInfo.setProgressText("Failed to submit the prediction. (Just close the window)\n" - + ((e.getMessage().indexOf("Exception")>-1) ? ( - "It is most likely that there is a problem with the server.\n") - : e.getMessage()) - +wsInfo.getProgressText()); - System.err.println( - "JPredWS Client: Failed to submit the prediction (Possibly a server error - see below)\n" + - e.getMessage() + "\n"); - - jalview.bin.Jalview.log.debug("Failed Submission",e); } } - 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) @@ -326,7 +353,7 @@ public class JPredClient al.addAnnotation(new AlignmentAnnotation(Symname, Visname, annotations, min, max, winLength)); - } + }*/ void parseResult() { @@ -357,38 +384,39 @@ public class JPredClient try { - jalview.bin.Jalview.log.debug("Parsing output from JNet job."); + 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.Jalview.log.debug("Got prediction profile."); + 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.Jalview.log.debug("Getting associated alignment."); + 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)); + SequenceI sqs[] = new SequenceI[al.getHeight()]; for (int i=0, j=al.getHeight(); i