X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FMsaWSClient.java;h=479f22f1e1454d0a41b724e72a30189e0e17afd6;hb=8359bd8f5bae0bfc1a63ba114b7a4d67fbb62efe;hp=0c302011dd25ca0b44b8c36cb9719604b8ca8a84;hpb=98eb909d0a4fe04ff6ad93f71086f1127fe4a530;p=jalview.git diff --git a/src/jalview/ws/MsaWSClient.java b/src/jalview/ws/MsaWSClient.java index 0c30201..479f22f 100755 --- a/src/jalview/ws/MsaWSClient.java +++ b/src/jalview/ws/MsaWSClient.java @@ -57,7 +57,7 @@ public class MsaWSClient */ public MsaWSClient(ext.vamsas.ServiceHandle sh, String altitle, SequenceI[] msa, - boolean submitGaps, boolean preserveOrder) + boolean submitGaps, boolean preserveOrder, Alignment seqdataset) { if (!sh.getAbstractName().equals("MsaWS")) @@ -81,13 +81,13 @@ public class MsaWSClient return; } - startMsaWSClient(altitle, msa, submitGaps, preserveOrder); + startMsaWSClient(altitle, msa, submitGaps, preserveOrder, seqdataset); } private void startMsaWSClient(String altitle, SequenceI[] msa, - boolean submitGaps, boolean preserveOrder) + boolean submitGaps, boolean preserveOrder, Alignment seqdataset) { if (!locateWebService()) { @@ -99,7 +99,7 @@ public class MsaWSClient MsaWSThread musclethread = new MsaWSThread(WebServiceName + " alignment of " + altitle, msa, - submitGaps, preserveOrder); + submitGaps, preserveOrder, seqdataset); wsInfo.setthisService(musclethread); musclethread.start(); } @@ -125,7 +125,7 @@ public class MsaWSClient " Service location failed\nfor URL :" + WsURL + "\n" + ex.getMessage()); - wsInfo.setStatus(wsInfo.ERROR); + wsInfo.setStatus(WebserviceInfo.ERROR); ex.printStackTrace(); return false; @@ -145,20 +145,22 @@ public class MsaWSClient vamsas.objects.simple.SequenceSet seqs = new vamsas.objects.simple. SequenceSet(); Hashtable SeqNames = null; - boolean submitGaps = false; // and always store and recover sequence order + boolean submitGaps = false; // pass sequences including gaps to alignment service boolean preserveOrder = true; // and always store and recover sequence order String jobId; String alTitle; // name which will be used to form new alignment window. int allowedServerExceptions = 3; // thread dies if too many exceptions. boolean jobComplete = false; + Alignment dataset; // dataset to which the new alignment will be associated. + MsaWSThread(String title, SequenceI[] msa, boolean subgaps, - boolean presorder) + boolean presorder, Alignment seqset) { alTitle = title; submitGaps = subgaps; preserveOrder = presorder; - + dataset = seqset; OutputHeader = wsInfo.getProgressText(); SeqNames = new Hashtable(); @@ -257,7 +259,7 @@ public class MsaWSClient throw (new Exception( "Timed out when communicating with server\nTry again later.\n")); } - jalview.bin.Jalview.log.debug("Result state " + result.getState() + + jalview.bin.Cache.log.debug("Result state " + result.getState() + "(ServerError=" + result.isServerError() + ")"); if (result.isRunning()) @@ -280,9 +282,7 @@ public class MsaWSClient { if (result.getStatus() != null) { - System.out.println("result "+result.getStatus().length()); - wsInfo.setProgressText(OutputHeader + "\n" ); - // result.getStatus()); + wsInfo.setProgressText(OutputHeader + "\n"+ result.getStatus()); } if (result.isServerError()) { @@ -397,7 +397,7 @@ public class MsaWSClient e.toString() + "\n"); this.allowedServerExceptions = 0; - wsInfo.setStatus(wsInfo.STATE_STOPPED_SERVERERROR); + wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); wsInfo.appendProgressText( "Failed to submit sequences for alignment.\n" + "It is most likely that there is a problem with the server.\n" + @@ -437,21 +437,18 @@ public class MsaWSClient if (result.getStatus() != null) { - System.out.println("get status " +result.getStatus().length()); - // OutputHeader += ("\n" + result.getStatus()); + OutputHeader += ("\n" + result.getStatus()); } if (result.getMsa() != null) { - System.out.println("get msa"); - // OutputHeader += "\nAlignment Object Method Notes\n"; + OutputHeader += "\nAlignment Object Method Notes\n"; String[] lines = result.getMsa().getMethod(); -System.out.println("lines "+lines.length); for (int line = 0; line < lines.length; line++) { - // OutputHeader += (lines[line] + "\n"); + OutputHeader += (lines[line] + "\n"); } // JBPNote The returned files from a webservice could be hidden behind icons in the monitor window that, when clicked, pop up their corresponding data @@ -472,7 +469,9 @@ System.out.println("lines "+lines.length); jalview.analysis.SeqsetUtils.deuniquify(SeqNames, seqs); Alignment al = new Alignment(seqs); - + if (dataset!=null) { + al.setDataset(dataset); + } // TODO: JBPNote Should also rename the query sequence sometime... AlignFrame af = new AlignFrame(al); af.addSortByOrderMenuItem(ServiceName + " Ordering",