JAL-2629 default HMMBuild to alignment if not specified by args
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 10 May 2018 14:17:53 +0000 (15:17 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 10 May 2018 14:17:53 +0000 (15:17 +0100)
src/jalview/hmmer/HMMBuild.java

index 3c3bd40..6de7029 100644 (file)
@@ -96,11 +96,14 @@ public class HMMBuild extends HmmerCommand
           AlignViewportI viewport)
   {
     List<AnnotatedCollectionI> runBuildFor = new ArrayList<>();
+    boolean foundArg = false;
+
     for (ArgumentI arg : params)
     {
       String name = arg.getName();
       if (MessageManager.getString("label.hmmbuild_for").equals(name))
       {
+        foundArg = true;
         String value = arg.getValue();
         if (MessageManager.getString("label.alignment").equals(value))
         {
@@ -134,6 +137,15 @@ public class HMMBuild extends HmmerCommand
         }
       }
     }
+
+    /*
+     * default is to build for the whole alignment
+     */
+    if (!foundArg)
+    {
+      runBuildFor.add(alignment);
+    }
+
     return runBuildFor;
   }