From: Jim Procter Date: Wed, 16 Sep 2020 16:45:12 +0000 (+0100) Subject: JAL-3748 recover complement alignment from complement alignmentView rather than let... X-Git-Tag: Release_2_11_1_3~5^2~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1498662aa27c17a6db8e79edcfa4e9891e4437d2;p=jalview.git JAL-3748 recover complement alignment from complement alignmentView rather than let ‘alignAs’ to do the work --- diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index db6e03f..89cf024 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -974,13 +974,24 @@ class MsaWSThread extends AWS2Thread implements WSClientI { al.setDataset(dataset); } - propagateDatasetMappings(al); + Alignment complement=null; + if (input.hasComplementView()) + { + Object[] newcompl = input + .getComplementView() + .getAlignmentAndHiddenColumns(getRequestingAlignFrame() + .getViewport().getCodingComplement().getGapCharacter()); + complement = new Alignment((SequenceI[])newcompl[0]); + complement.setHiddenColumns((HiddenColumns) newcompl[1]); + complement.setDataset(dataset); + complement.alignAs(al); + } // JBNote- TODO: warn user if a block is input rather than aligned data ? if (newFrame) { - displayInNewFrame(al, alorders, hidden); + displayInNewFrame(al, alorders, hidden, complement); } else @@ -998,10 +1009,11 @@ class MsaWSThread extends AWS2Thread implements WSClientI * * @param al * @param alorders + * @param complement2 * @param columnselection */ protected void displayInNewFrame(AlignmentI al, - List alorders, HiddenColumns hidden) + List alorders, HiddenColumns hidden, AlignmentI complement) { AlignFrame af = new AlignFrame(al, hidden, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); @@ -1021,26 +1033,18 @@ class MsaWSThread extends AWS2Thread implements WSClientI * SplitFrame with the other pane similarly aligned. */ AlignFrame requestedBy = getRequestingAlignFrame(); - if (requestedBy != null && requestedBy.getSplitViewContainer() != null + if (complement!=null && requestedBy != null && requestedBy.getSplitViewContainer() != null && requestedBy.getSplitViewContainer() .getComplement(requestedBy) != null) { - AlignmentI complement = requestedBy.getSplitViewContainer() - .getComplement(requestedBy); String complementTitle = requestedBy.getSplitViewContainer() .getComplementTitle(requestedBy); // becomes null if the alignment window was closed before the alignment // job finished. - AlignmentI copyComplement = new Alignment(complement); - // todo should this be done by copy constructor? - copyComplement.setGapCharacter(complement.getGapCharacter()); - // share the same dataset (and the mappings it holds) - copyComplement.setDataset(complement.getDataset()); - copyComplement.alignAs(al); - if (copyComplement.getHeight() > 0) + if (complement.getHeight() > 0) { af.setTitle(alTitle); - AlignFrame af2 = new AlignFrame(copyComplement, + AlignFrame af2 = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); af2.setTitle(complementTitle); String linkedTitle = MessageManager