X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FMsaWSClient.java;h=7d65cebb08cfd5f3b3476a2ea288fb3b0968fc95;hb=6fc9aca27f606f6e3a0121597896e1a5dae35c36;hp=0d4b2c13b27e20676ff02d323cfb1a9519987264;hpb=e5c2e37b24f09c90f2f7c748f6be10ce025da261;p=jalview.git diff --git a/src/jalview/ws/MsaWSClient.java b/src/jalview/ws/MsaWSClient.java index 0d4b2c1..7d65ceb 100755 --- a/src/jalview/ws/MsaWSClient.java +++ b/src/jalview/ws/MsaWSClient.java @@ -43,6 +43,7 @@ public class MsaWSClient * server is a WSDL2Java generated stub for an archetypal MsaWSI service. */ ext.vamsas.MuscleWS server; + AlignFrame alignFrame; /** @@ -56,10 +57,14 @@ public class MsaWSClient * @param preserveOrder DOCUMENT ME! */ - public MsaWSClient(ext.vamsas.ServiceHandle sh, String altitle, SequenceI[] msa, - boolean submitGaps, boolean preserveOrder) + public MsaWSClient(ext.vamsas.ServiceHandle sh, String altitle, + SequenceI[] msa, + boolean submitGaps, boolean preserveOrder, + Alignment seqdataset, + AlignFrame _alignFrame) { + alignFrame = _alignFrame; if (!sh.getAbstractName().equals("MsaWS")) { JOptionPane.showMessageDialog(Desktop.desktop, @@ -81,13 +86,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 +104,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 +130,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 +150,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 +264,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 +287,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()) { @@ -335,6 +340,7 @@ public class MsaWSClient +"\nSee help files for increasing Java Virtual Machine memory." ,"Out of memory", JOptionPane.WARNING_MESSAGE ); System.out.println("MsaWSClient: "+er); + System.gc(); } } @@ -396,7 +402,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" + @@ -436,21 +442,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 @@ -471,9 +474,15 @@ 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); + + //>>>This is a fix for the moment, until a better solution is found!!<<< + af.getFeatureRenderer().transferSettings(alignFrame.getFeatureRenderer()); + af.addSortByOrderMenuItem(ServiceName + " Ordering", msaorder);