JAL-2937 hmmbuild input data generated via AlignmentView from alignment, not directly...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 1 Jun 2018 14:00:49 +0000 (15:00 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 1 Jun 2018 14:00:49 +0000 (15:00 +0100)
src/jalview/hmmer/HMMBuild.java

index 6de7029..6fcd6db 100644 (file)
@@ -4,6 +4,7 @@ import jalview.api.AlignViewportI;
 import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
@@ -105,24 +106,29 @@ public class HMMBuild extends HmmerCommand
       {
         foundArg = true;
         String value = arg.getValue();
+
         if (MessageManager.getString("label.alignment").equals(value))
         {
-          runBuildFor.add(alignment);
+          runBuildFor.add(viewport.getAlignmentView(false)
+                  .getVisibleAlignment('-'));
         }
         else if (MessageManager.getString("label.groups_and_alignment")
                 .equals(value))
         {
-          runBuildFor.add(alignment);
-          runBuildFor.addAll(viewport.getAlignment().getGroups());
+          AlignmentView av = viewport.getAlignmentView(true);
+          runBuildFor.add(av.getVisibleAlignment('-'));
+          runBuildFor.addAll(av.getVisibleGroups('-'));
         }
         else if (MessageManager.getString("label.groups").equals(value))
         {
-          runBuildFor.addAll(viewport.getAlignment().getGroups());
+          AlignmentView av = viewport.getAlignmentView(false);
+          runBuildFor.addAll(av.getVisibleGroups('-'));
         }
         else if (MessageManager.getString("label.selected_group")
                 .equals(value))
         {
-          runBuildFor.add(viewport.getSelectionGroup());
+          AlignmentView av = viewport.getAlignmentView(true);
+          runBuildFor.add(av.getVisibleAlignment('-'));
         }
       }
       else if (MessageManager.getString("label.use_reference")
@@ -183,7 +189,8 @@ public class HMMBuild extends HmmerCommand
       else
       {
         SequenceI[] sel = ((SequenceGroup) ac)
-                .getSelectionAsNewSequences((AlignmentI) ac.getContext());
+                .getSelectionAsNewSequences((AlignmentI) ac.getContext(),
+                        false);
         for (SequenceI seq : sel)
         {
           copy.add(seq);