X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FJPredClient.java;h=8f94e97a6d6946f4a1e9c08d9aade46da18f7d66;hb=83b24eab35785ea8473763ea5ed175a1fa63a4d1;hp=c7508df0bf95175b9e44e16fac139c1a71af90f3;hpb=ae0f884be559f2f706945b379d110e9c60642364;p=jalview.git diff --git a/src/jalview/ws/JPredClient.java b/src/jalview/ws/JPredClient.java index c7508df..8f94e97 100755 --- a/src/jalview/ws/JPredClient.java +++ b/src/jalview/ws/JPredClient.java @@ -26,11 +26,12 @@ import ext.vamsas.*; import jalview.analysis.*; import jalview.datamodel.*; import jalview.gui.*; +import jalview.io.FormatAdapter; public class JPredClient extends WSClient { - ext.vamsas.JPredWS server; + ext.vamsas.Jpred server; String altitle = ""; java.util.Hashtable SequenceInfo = null; public JPredClient(ext.vamsas.ServiceHandle sh, String title, SequenceI seq) { @@ -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; + } } @@ -347,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