JAL-1601 Propagate representative sequence to the final output alignment
[jalview.git] / src / jalview / ws2 / gui / SearchServiceGuiHandler.java
index 49df466..a57db1d 100644 (file)
@@ -142,6 +142,12 @@ 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));
+      }
       displayResultsNewFrame(alnCpy);
     });
     SwingUtilities.invokeLater(infoPanel::setResultsReady);