JAL-1601 Propagate hidden columns to the output alignment
[jalview.git] / src / jalview / ws2 / gui / SearchServiceGuiHandler.java
index 49df466..e66315f 100644 (file)
@@ -8,6 +8,7 @@ import jalview.bin.Console;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.HiddenColumns;
 import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
 import jalview.gui.JvOptionPane;
@@ -142,6 +143,14 @@ class SearchServiceGuiHandler implements TaskEventListener<AlignmentI>
       alnCpy.setDataset(result.getDataset());
       for (AlignmentAnnotation annotation : result.getAlignmentAnnotation())
         alnCpy.addAnnotation(new AlignmentAnnotation(annotation));
+      if (result.hasSeqrep())
+      {
+        int idx = result.findIndex(result.getSeqrep());
+        if (idx >= 0)
+          alnCpy.setSeqrep(alnCpy.getSequenceAt(idx));
+      }
+      if (result.getHiddenColumns() != null)
+        alnCpy.setHiddenColumns(new HiddenColumns(result.getHiddenColumns()));
       displayResultsNewFrame(alnCpy);
     });
     SwingUtilities.invokeLater(infoPanel::setResultsReady);